知识蒸馏
知识蒸馏指的是模型压缩的思想,通过将预先训练的繁琐网络作为教师模型,知识蒸馏的目的是学习一个紧凑的学生模型,期望通过转移教师的知识来掌握教师的专业知识。
KD在15-nipsworskshop-Distilling the knowledge in a neural network.被首先提出。
KD主要有两条技术路线:label smoothing和feature distillation,前者利用teacher模型的输出分布作为一个平滑的label来训练student,后者利用中间表达的语义信息。
knowledge type
response-based knowledge: 教师网络的最后一层的神经反应,思想也就是模仿教师网络的最后预测。
Feature-based knowledge: 网络中间层输出的intermediate representation。直接匹配师生网络的feature activations, 或者直接匹配feature
Relation-Based Knowledge: 进一步探索了不同层或不同数据样本之间的关系。
Distillation Schemes
offline distillation: 大多数KD都是offline的,teacher网络是pre-train的
online distillation: 特别是在大规模的高性能的teacher网络不可用的情况下。online蒸馏中,师生网络同时更新