[ICCV 2019] Be Your Own Teacher: Improve the Performance of CNN via Self Distillation

Introduction

  • 传统的知识蒸馏存在以下问题:(1) 从教师模型到学生模型的知识迁移效率不高,学生模型很难利用到教师模型提供的所有知识,也就很难训练出性能超过教师模型的学生模型;(2) 需要花大量精力去设计和训练一个合适的教师模型
  • 为了解决上述问题,作者提出了一种新的通用训练框架 – 自蒸馏 (self distillation),自蒸馏无需教师模型,而是用模型的深层特征去蒸馏浅层特征,相比传统的知识蒸馏算法,在训练时间模型精度上都得到了提升

在这里插入图片描述

Self Distillation

在这里插入图片描述

  • (1) Shallow Classifier. 首先按照模型结构将模型划分为若干 sections,然后在每个 section 后添加额外的 bottleneck 和全连接层构成 shallow classifiers,这里添加 bottleneck 主要是为了降低不同 shallow classifier 之间的影响以及对齐不同深度特征图大小,便于后续加入对特征的蒸馏 (L2 loss from hints). 每个分类器均可输出类别概率进行预测,因此在推理时需要进行精度和速度的权衡,可以根据硬件条件合理选择使用哪一层的分类器进行预测,或者也可以对所有分类器进行集成
  • (2) Cross entropy loss from labels. Cross entropy loss from labels to not only the deepest classifier, but also all the shallow classifiers.
    在这里插入图片描述其中,q i q_iqi 为第 i ii 个分类器输出的类别概率 (temperature ),共有 C CC 个分类器
  • (3) Kullback-Leibler divergence loss from distillation. 用最深层的 classifier 输出的类别概率去蒸馏 shallow classifiers
    在这里插入图片描述其中,q C q^CqC 为最深层的 classifier 输出的类别概率
  • (4) L2 loss from hints. 用最后一个 section 输出的特征去蒸馏浅层 section 后 bottleneck 输出的特征
    在这里插入图片描述
  • (5) Total loss.
    在这里插入图片描述其中,deepest classifier 对应的 λ , α \lambda,\alphaλ,α 为 0

Experiments

Compared with Standard Training

在这里插入图片描述
在这里插入图片描述

Compared with Distillation

在这里插入图片描述

Compared with Deeply Supervised Net

在这里插入图片描述

Scalable Depth for Adapting Inference

在这里插入图片描述

Self distillation can help models converge to flat minima which features in generalization inherently

  • Gaussian noise is added to the parameters of the two models and then their entropy loss and predicted accuracy on the training set are obtained and plotted in Figure 4.
    在这里插入图片描述

Self distillation prevents models from vanishing gradient problem

在这里插入图片描述

More discriminating features are extracted with deeper classifiers in self distillation

在这里插入图片描述

References


版权声明:本文为weixin_42437114原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。