Skip to main content
QUICK REVIEW

[论文解读] One-for-All: Bridge the Gap Between Heterogeneous Architectures in Knowledge Distillation

Zhiwei Hao, Jianyuan Guo|arXiv (Cornell University)|Oct 30, 2023
Advanced Neural Network ApplicationsComputer Science被引用 31
一句话总结

本文提出了 OFA-KD,一种跨体系结构的知识蒸馏框架,通过在 logits 空间使用额外的出口分支和自适应的目标信息增强损失来对齐异构的教师–学生表示,从而提升 CNN、ViT 和 MLP 学生的性能。

ABSTRACT

Knowledge distillation~(KD) has proven to be a highly effective approach for enhancing model performance through a teacher-student training scheme. However, most existing distillation methods are designed under the assumption that the teacher and student models belong to the same model family, particularly the hint-based approaches. By using centered kernel alignment (CKA) to compare the learned features between heterogeneous teacher and student models, we observe significant feature divergence. This divergence illustrates the ineffectiveness of previous hint-based methods in cross-architecture distillation. To tackle the challenge in distilling heterogeneous models, we propose a simple yet effective one-for-all KD framework called OFA-KD, which significantly improves the distillation performance between heterogeneous architectures. Specifically, we project intermediate features into an aligned latent space such as the logits space, where architecture-specific information is discarded. Additionally, we introduce an adaptive target enhancement scheme to prevent the student from being disturbed by irrelevant information. Extensive experiments with various architectures, including CNN, Transformer, and MLP, demonstrate the superiority of our OFA-KD framework in enabling distillation between heterogeneous architectures. Specifically, when equipped with our OFA-KD, the student models achieve notable performance improvements, with a maximum gain of 8.0% on the CIFAR-100 dataset and 0.7% on the ImageNet-1K dataset. PyTorch code and checkpoints can be found at https://github.com/Hao840/OFAKD.

研究动机与目标

  • 在特征空间显著发散的异构体系结构(CNN、Transformer、MLP)之间推动知识蒸馏。
  • 证明直接特征匹配在跨体系结构 KD 中无效,并提出一种在 logits 空间对齐的策略。
  • 开发一种自适应损失(OFA),根据教师的置信度强调目标类别信息。
  • 在 CIFAR-100 和 ImageNet-1K 上通过多组教师–学生对展示广泛的实证提升。

提出的方法

  • 在学生模型中引入出口分支,将中间特征投射到 logits 空间,以实现跨体系结构的蒸馏。
  • 用多个学生出口对齐教师的 logits,同时从中间特征中去除体系结构特定信息。
  • 给出带有调节参数 gamma 的改进 KD 损失(OFA)的公式,用以根据教师置信度自适应增强目标信息。
  • 提供训练细节的指南,包括出口的放置位置以及如何设定优化超参数和 gamma。

实验结果

研究问题

  • RQ1当教师和学生具有异构体系结构(CNN、ViT、MLP)时,跨体系结构的知识蒸馏能否有效进行?
  • RQ2通过额外出口在 logits 空间对齐表示,是否能实现跨体系结构的有意义的知识迁移?
  • RQ3当教师对不同样本的置信度不同寻常时,适应性的目标信息增强损失是否能提升蒸馏效果?
  • RQ4在多样的教师–学生对中,OFA-KD 在 CIFAR-100 和 ImageNet-1K 的经验提升是多少?

主要发现

  • OFA-KD 在所有异构组合中对强基线持续带来提升,在 CIFAR-100 上最多提升 8.0% 的准确率,在 ImageNet-1K 上最多提升 0.7%。
  • 将中间表示对齐到 logits 空间,去除了体系结构特定信息,并实现跨体系结构蒸馏。
  • 自适应的 OFA 损失(带有调节参数 gamma)在教师自信时增加目标信息,在教师不确定时减小干扰。
  • 消融研究表明使用多个出口并在四个阶段分布它们可获得最佳性能。
  • 对某些体系结构来说,使用异构教师的蒸馏甚至可超越同构教师设置(例如 ResNet50 与 ViT-B 教师),凸显跨体系结构 KD 的价值。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。