Abstract
Standard knowledge distillation (KD) assumes that the $i$-th channel of a teacher network should map directly to the $i$-th channel of a student. This paper reveals a significant "knowledge discrepancy" where channels represent different features due to varying architectures or even just different random initializations. By introducing Knowledge Consistent Distillation (KCD), the authors use bipartite matching to reorder teacher channels to align with the student’s internal representation, leading to consistent performance gains across classification and detection tasks.
Introduction
Knowledge Distillation is a cornerstone technique for model compression, enabling a compact student model to inherit the performance of a larger teacher. Traditionally, this process involves minimizing the distance between intermediate feature maps. However, a fundamental flaw exists: the teacher-student knowledge discrepancy.
Even with identical architectures, different random initializations cause models to learn distinct internal representations. For instance, a teacher might encode "edge" features in Channel 5, while a student uses Channel 12 for the same task. Forcing a direct $i$-to-$i$ mapping introduces noise, hindering the distillation process. This issue is exacerbated when architectures differ significantly, such as between a ResNet teacher and a MobileNet student.
Methodology: Knowledge Consistent Distillation (KCD)
To address this misalignment, the authors propose finding an optimal "translation" between teacher and student representations through a three-step framework.
1. Consistency Measurement
Alignment is first quantified using a consistency matrix $M$. Each entry $M_{ij}$ represents the similarity (calculated via metrics like Pearson correlation or $L_p$ norm) between the $i$-th teacher channel and the $j$-th student channel across the training set. This matrix identifies which teacher channels most closely resemble the student's existing feature distribution.
2. Channel-based Feature Transformation
The teacher's features are transformed before distillation to match the student's "natural" distribution. Several strategies were evaluated:
- Greedy Matching: A 1-to-N mapping where each student channel is paired with its most similar teacher counterpart.
- Bipartite Matching: Utilizing the Kuhn-Munkres algorithm to find an optimal 1-to-1 mapping. This ensures all teacher information is utilized without redundancy and preserves the richness of the teacher's knowledge.
- Learning-based: Small sub-networks (FC or Residual) were tested but found to be less effective, likely because they failed to preserve the classification-relevant semantics of the features.
3. The KCD Workflow
The process involves briefly training the student to establish its feature distribution, calculating the optimal transformation (e.g., bipartite permutation), and then re-initializing the student for full distillation using the transformed teacher features.
Experimental Results
The KCD framework was validated across multiple benchmarks, demonstrating robust improvements in both classification and detection.
ImageNet Classification
Using a MobileNetV2-0.5× student and a ResNet50 teacher, KCD improved Top-1 accuracy from a baseline of 67.52% to 68.35%. The results indicate that providing the student with knowledge that fits its existing internal structure is more effective than forcing it to adopt the teacher's specific channel ordering.
Visual Analysis
Qualitative visualizations confirm that transformed teacher features align much more closely with the student's internal representations than the original teacher features. The difference maps (T - S1) show significantly less residual noise after the transformation is applied.
CIFAR-100 and Object Detection
On CIFAR-100, KCD consistently boosted state-of-the-art KD methods. For example, combining KCD with RCO pushed ResNet20 performance from 67.96% to 70.13%. In object detection on the COCO dataset, KCD improved the Average Precision (AP) of a ResNet18 student from 33.6 to 36.8, significantly outperforming standard $L_2$ distillation.
Conclusion
The core insight of this work is that alignment is more critical than mimicry. By respecting the student's existing internal structure through bipartite matching, KCD provides a cleaner supervisory signal. The authors also found that "static" transformations—calculated once at the start—are as effective as "dynamic" ones, simplifying implementation. Addressing the teacher-student discrepancy appears to be a vital step for maximizing the efficiency of knowledge distillation across diverse architectures.
Summary updated