Abstract
Knowledge distillation (KD) aims to improve the performance of a student network by mimicking the knowledge from a powerful teacher network. Existing methods focus on studying what knowledge should be transferred and treat all samples equally during training. This paper introduces adaptive sample weighting to KD. We discover that previous effective hard mining methods are not appropriate for distillation. Furthermore, we propose Prime-Aware Adaptive Distillation (PAD) by the incorporation of uncertainty learning. PAD perceives the prime samples in distillation and then emphasizes their effect adaptively. PAD is fundamentally different from and would refine existing methods with the innovative view of unequal training. For this reason, PAD is versatile and has been applied in various tasks including classification, metric learning, and object detection. With ten teacher-student combinations on six datasets, PAD promotes the performance of existing distillation methods and outperforms recent state-of-the-art methods.
Introduction: The Capacity Gap
Knowledge Distillation (KD) is a widely used technique for transferring knowledge from a large "teacher" model to a smaller "student" model. While significant research has explored what features to transfer—such as logits, attention maps, or intermediate representations—most existing frameworks treat all training samples with equal importance.
This paper identifies a fundamental issue in this approach: the capacity gap. Because the student network has significantly fewer parameters than the teacher, it often lacks the representational power to accurately model the teacher's logic on complex, "hard" samples. In standard supervised learning, "hard example mining" is a common strategy to improve robustness. However, in the context of distillation, forcing a student to mimic a teacher on samples it cannot comprehend introduces noise, ultimately degrading performance.
Methodology: Prime-Aware Adaptive Distillation (PAD)
To address the capacity gap, we propose Prime-Aware Adaptive Distillation (PAD). Instead of treating all samples equally or focusing on hard samples, PAD prioritizes "prime" samples—those that the student can reliably learn from the teacher.
Uncertainty Learning
PAD utilizes Uncertainty Learning to dynamically weight samples. The student network is modified to predict both a mean ($\mu$) and a variance ($\sigma^2$) for its output. The variance $\sigma^2$ serves as a proxy for the student's uncertainty regarding a specific sample.
The distillation loss is reformulated based on a Gaussian distribution, resulting in a loss function ($L_{PAD}$) that naturally weights samples by $1/\sigma^2$:
- Prime Samples: Low uncertainty ($\sigma^2$) leads to high weights, emphasizing reliable knowledge.
- Hard/Noisy Samples: High uncertainty ($\sigma^2$) leads to low weights, preventing the student from being distracted by samples beyond its capacity.
Crucially, the auxiliary variance branch is only used during training and is discarded during inference, ensuring PAD adds no computational overhead to the deployed model.
Experimental Results
The effectiveness of PAD was evaluated across image classification, metric learning, and object detection tasks. A key strength of PAD is its versatility. Since it modifies the weighting of the loss rather than the content of the knowledge, it can be integrated into existing distillation frameworks like Attention Transfer (AT), $L_2$ distillation, and FitNet.
As shown in the results, PAD consistently improves the performance of these baseline methods. For instance, on CIFAR100, PAD improved the $L_2$ distillation baseline from 72.85% to 74.06%. On the massive ImageNet dataset, it achieved 71.71% top-1 accuracy, outperforming the state-of-the-art CRD method.
In other domains, PAD reached a Rank@1 of 61.4% on the CUB-200 metric learning dataset. In object detection, PAD enabled a ResNet50-based detector to reach 56.41 mmAP on Pascal VOC, slightly exceeding its ResNet101 teacher (56.22 mmAP).
Conclusion
Prime-Aware Adaptive Distillation (PAD) shifts the focus of knowledge distillation from what to transfer to how to weight samples. By recognizing that "hard" samples can be detrimental due to the student's limited capacity, PAD leverages uncertainty learning to focus on "prime" samples. This approach is computationally efficient at inference, highly versatile, and sets new performance benchmarks across a variety of computer vision tasks.
Summary updated