Abstract
Knowledge Distillation (KD) is a critical technique for deploying deep learning models on resource-constrained devices. However, aligning intermediate features between disparate teacher and student architectures remains a significant challenge. This paper introduces Multi-Head Knowledge Distillation (MHKD), a method that utilizes auxiliary classifier heads to map intermediate features into a common probability space. By supervising the student with the teacher's intermediate predictions, MHKD achieves state-of-the-art performance on image classification benchmarks while remaining architecture-agnostic and computationally efficient during inference.
Introduction
Deep learning models are increasingly massive, often exceeding the memory and processing capabilities of edge devices. Knowledge Distillation (KD) addresses this by training a compact "student" model to mimic a high-capacity "teacher" model. While standard KD matches final logits, supervising intermediate layers provides richer "hints" for the student.
Existing intermediate distillation methods often struggle when the teacher and student have different architectures (e.g., different channel counts or spatial resolutions). These methods typically require complex mathematical projections or manual tuning to align mismatched feature maps. MHKD overcomes these hurdles by using the classification task itself as a universal bridge between layers.
Methods
The core innovation of Multi-Head Knowledge Distillation (MHKD) is the attachment of auxiliary classifier heads to specific intermediate units in both the teacher and student networks.
Architecture and Loss Function
Each auxiliary head is a lightweight mini-network consisting of two convolutional layers followed by two fully-connected layers. These heads map internal feature tensors to a probability distribution over the same $K$ classes as the final task. This creates a "common space" for comparison, regardless of the internal architecture of the models.
During training, the student is optimized using a multi-part loss function:
- Cross-Entropy Loss: Standard supervision using ground truth labels.
- Standard KD Loss: Matching the teacher's final output logits.
- MHKD Loss: The KL divergence between the outputs of the teacher’s auxiliary heads and the student’s corresponding auxiliary heads.
Crucially, these auxiliary heads are only utilized during the training phase. They are discarded at test time, ensuring that the student model remains lightweight and suffers no inference-time latency penalty.
Experimental Results
The authors evaluated MHKD on two standard image classification benchmarks: CIFAR-100 and SVHN. They tested a variety of teacher-student pairs, ranging from similar architectures (e.g., WideResNet) to highly dissimilar ones (e.g., VGG to MobileNetV2).
Key Findings
- Superior Performance: On CIFAR-100, MHKD consistently outperformed standard KD and other intermediate-matching methods such as FitNet, RKD, and CC. For instance, when distilling a VGG13 teacher into a MobileNetV2 student, MHKD achieved 69.11% accuracy, a significant improvement over the 67.37% achieved by standard KD.
- State-of-the-Art Synergy: When combined with Contrastive Representation Distillation (CRD), the "CRD+MHKD" approach set new state-of-the-art benchmarks. This suggests that matching intermediate predictions (MHKD) and intermediate representations (CRD) provide complementary learning signals.
- Multi-Head Advantage: Ablation studies confirmed that using multiple heads (Head-1+2+3) provides superior supervision compared to any single intermediate head, as it provides a granular roadmap for the student throughout its entire depth.
Discussion and Insights
The elegance of MHKD lies in its use of the "Common Ground of Classes." By asking what an internal layer "thinks" an image represents, the method creates a universal language for knowledge transfer. This deeper supervision helps mitigate the vanishing gradient problem and provides a more robust training signal. Furthermore, the simplicity of using standard convolutional layers and KL divergence makes MHKD easy to implement across various deep learning frameworks.
Limitations and Future Work
While effective, the capacity of the auxiliary heads must be carefully balanced; heads that are too powerful might mask discrepancies between teacher and student features. Additionally, the current placement of heads at the end of major network units is a heuristic that may require adjustment for non-standard architectures. Future research could explore the application of MHKD to tasks beyond classification, such as object detection or semantic segmentation, where output spaces are more complex.
Summary updated