Teacher Network Calibration Improves Cross-Quality Knowledge Distillation

Pia Čuk, Robin Senge, Mikko Lauri, Simone FrintroparXiv 2023

TL;DR

This paper demonstrates that Cross-Quality Knowledge Distillation (CQKD)—training a low-resolution student network using a high-resolution teacher—significantly improves accuracy and inference speed. The researchers show that the secret to success lies in model calibration: by using temperature smoothing to increase the entropy of the teacher's signals, the student better handles the inherent uncertainty of low-resolution images, leading to higher accuracy and better-calibrated predictions.

What Problem Does This Paper Address?

Deep Neural Networks (DNNs) are notoriously resource-hungry, making them difficult to deploy on edge devices like robots or embedded systems. While standard Knowledge Distillation (KD) usually focuses on shrinking a large model into a smaller one, this paper tackles a different bottleneck: input resolution.

Processing high-resolution images is computationally expensive. If we could train a student network to perform well on low-resolution images by "learning" from a teacher that sees the full-resolution version, we could drastically reduce the computational load at inference time. However, there is a "quality gap"—the features visible at 224x224 pixels aren't the same as those at 56x56. Simply forcing a student to mimic a high-res teacher can lead to overconfidence and poor performance if the teacher's signals aren't properly adjusted for the student's harder task.

Methods

The authors utilize Cross-Quality Knowledge Distillation (CQKD). In this setup:

  1. The Teacher ($f^t$) receives a full-resolution image ($x$).
  2. The Student ($f^s$) receives a downsampled, low-resolution version of the same image ($\tilde{x}$).
Fig. 1: In cross-quality knowledge distillation (CQKD), the input to the teacher network is a full-resolution image, and the student receives a downscaled low- resolution image as input. The student is trained with a weighted loss using the cross-entropy on the target label and the Kullback-Leibler divergence between the student and teacher output distributions. At inference time, the student network is retained and only low-resolution images need to be processed.

The student is trained using a weighted loss function that combines standard cross-entropy (comparing student predictions to ground truth labels) and Kullback-Leibler (KL) divergence (comparing student outputs to teacher outputs).

The key innovation explored here is Temperature Smoothing ($\tau$). By increasing the temperature hyperparameter in the Softmax function, the teacher's output distribution becomes "softer" (higher entropy). The authors hypothesize that this softer signal is essential because it reflects the increased uncertainty inherent in classifying low-resolution images, preventing the student from becoming overconfident in its (potentially wrong) guesses.

Datasets

The study uses the ImageNet dataset, a large-scale benchmark consisting of 1,000 image classes. ImageNet is ideal for this research because its images are large enough (at least 224x224) to allow for significant downsampling experiments.

  • Teacher: A pre-trained ResNet-50.
  • Student: ResNet-18 (initialized randomly).
  • Resolutions tested: 168, 112, 56, 42, and 28 pixels.

Key Insights and Ideas

  • The Calibration Connection: Modern DNNs are often overconfident. The authors found that a poorly calibrated teacher makes a poor mentor. By smoothing the teacher's output, they effectively "re-calibrate" the teaching signal to match the student's more difficult, low-res reality.
  • Bridging the Resolution Gap: When the resolution difference is small (e.g., student at 112px, teacher at 224px), standard KD works well. However, when the resolution drops significantly (e.g., 56px), the student needs a higher-entropy signal ($\tau=20$) to maintain accuracy and calibration.
  • Efficiency Gains: CQKD is highly efficient. It adds less than 10% to the training time compared to standard supervised learning, whereas alternative methods like Deep Mutual Learning (DML) can double the training time.

Key Results

The experimental results highlight a clear trade-off between resolution, accuracy, and calibration.

Fig. 2: Accuracy, training time, ECE, and entropy on ImageNet as a function of training image size. For cross-quality KD, we report a setting with τ = 10 and τ = 20. Up to image size 112, the baseline and DML outperform KD. For larger image sizes, KD performs best.
  • Accuracy: For image sizes of 112px and above, CQKD consistently outperforms both standard supervised learning and DML.
  • Calibration: Using a higher temperature ($\tau=20$) significantly reduced the Expected Calibration Error (ECE) for smaller image sizes. For example, at 56px, $\tau=20$ resulted in much lower ECE than $\tau=10$, indicating the student was less prone to overconfident errors.
  • Speed vs. Performance: Reducing resolution to 168px reduced training time by roughly 33% while only incurring a 5% drop in accuracy. For many real-world applications, this is a highly favorable trade-off.

Limitations and Future Work

  • Extreme Downsampling: The authors noted that when the student's input is less than one-fourth the size of the teacher's (below 112px), accuracy drops below the supervised baseline. This suggests a limit to how much "knowledge" can be transferred when the feature spaces become too disparate.
  • Manual Tuning: Currently, the temperature parameter $\tau$ must be tuned manually. The authors suggest that future work should focus on automatic re-calibration methods that can adapt the teacher's distribution dynamically based on the student's input quality.
  • Domain Specificity: The current study is limited to image classification. Exploring CQKD in other domains (like object detection or segmentation) remains an open area for research.

Summary updated

BibTeX
@misc{cuk2023teacher,
  author = {Pia Čuk and Robin Senge and Mikko Lauri and Simone Frintrop},
  title = {{Teacher Network Calibration Improves Cross-Quality Knowledge Distillation}},
  year = {2023},
  eprint = {2304.07593},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.07593},
}
Figure