跨架构知识蒸馏新方法,让不同模型间知识传递更顺畅。
Fuse Before Transfer: Knowledge Fusion for Heterogeneous Distillation
- 用辅助模型融合卷积与注意力模块,弥合异构模型特征差距。
- 引入空间无关的InfoNCE损失,提升异构特征对齐效果,最高增益11.47%。
- 适用于CNN、ViT、MLP任意组合,适合多模型协同训练场景。
现有知识蒸馏(KD)多聚焦于同构教师-学生结构,如均为卷积神经网络(CNN)。但将蒸馏扩展至跨架构蒸馏(CAKD)——即异构教师与学生间灵活迁移知识——可大幅提升潜力与灵活性。其核心挑战在于异构模型间显著的特征差异,源于内在归纳偏置与模块功能的不同。为此,我们引入一个辅助模型作为桥梁,促进异构教师与学生间的平滑特征知识传递。更重要的是,在所提设计原则下,该辅助模型融合了学生与教师模块功能中的卷积与注意力机制。此外,我们发现异构特征在空间分布上差异显著,导致传统像素级均方误差(MSE)损失效果不佳。因此,我们采用空间无关的InfoNCE损失,在空间平滑后对齐特征,从而提升CAKD中的特征对齐性能。该方法在多个同构与异构组合(包括CNN、ViT、MLP)上评估,表现达到当前最优,在CIFAR-100上最高提升11.47%,ImageNet-1K上达3.67%。代码与模型将公开。
原文摘要 · Abstract (English)
Most knowledge distillation (KD) methodologies predominantly focus on teacher-student pairs with similar architectures, such as both being convolutional neural networks (CNNs). However, the potential and flexibility of KD can be greatly improved by expanding it to novel Cross-Architecture KD (CAKD), where the knowledge of homogeneous and heterogeneous teachers can be transferred flexibly to a given student. The primary challenge in CAKD lies in the substantial feature gaps between heterogeneous models, originating from the distinction of their inherent inductive biases and module functions. To this end, we introduce an assistant model as a bridge to facilitate smooth feature knowledge transfer between heterogeneous teachers and students. More importantly, within our proposed design principle, the assistant model combines the advantages of cross-architecture inductive biases and module functions by merging convolution and attention modules derived from both student and teacher module functions. Furthermore, we observe that heterogeneous features exhibit diverse spatial distributions in CAKD, hindering the effectiveness of conventional pixel-wise mean squared error (MSE) loss. Therefore, we leverage a spatial-agnostic InfoNCE loss to align features after spatial smoothing, thereby improving the feature alignments in CAKD. Our proposed method is evaluated across some homogeneous model pairs and arbitrary heterogeneous combinations of CNNs, ViTs, and MLPs, achieving state-of-the-art performance for distilled models with a maximum gain of 11.47% on CIFAR-100 and 3.67% on ImageNet-1K. Our code and models will be released.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。