ResKD: Residual-Guided Knowledge Distillation

Xuewei Li, Songyuan Li, Bourahla Omar, Fei Wu, Xi LiIEEE TIP 2020 · DOI

Abstract

Knowledge Distillation (KD) is a powerful technique for model compression, yet it often suffers from a "capacity gap" where lightweight student models fail to fully capture the complex knowledge of heavy teacher networks. This paper introduces ResKD (Residual-Guided Knowledge Distillation), a multi-stage framework that bridges this gap by training a series of tiny "res-students" to learn the teacher's remaining errors. By combining these residuals and employing a sample-adaptive inference strategy, ResKD achieves teacher-level accuracy while utilizing as little as 18% of the original computational cost.

Introduction

The demand for deploying deep neural networks on mobile and embedded devices has made Knowledge Distillation (KD) a cornerstone of model compression. In standard KD, a large "teacher" model guides the training of a smaller "student" model. However, the inherent discrepancy in representational power—the capacity gap—often prevents the student from reaching the teacher's performance levels. While most research focuses on refining loss functions, ResKD proposes a structural solution: iteratively chipping away at the teacher's error using a sequence of specialized, ultra-lightweight students.

The ResKD Framework

The core of ResKD is inspired by polynomial approximation, where higher-order terms are added to refine a target function. Instead of relying on a single student $S_0$, the framework introduces "res-students" ($R_n$) trained specifically to capture the residual—the difference between the teacher's output and the current student ensemble's prediction.

The ResKD framework consists of multiple training stages where each subsequent res-student learns the residual of the previous stage, followed by an ensemble inference stage.

As shown in Figure 1, the process begins with a base student $S_0$. The gap $T - S_0$ then serves as the target for the first res-student $R_1$. This iterative process continues for $n$ stages, resulting in an ensemble $S_n = S_0 + \sum_{i=1}^n R_i$. To ensure efficiency, these res-students are not hand-designed; instead, Neural Architecture Search (NAS) is used to discover optimal, tiny structures tailored for residual learning.

Sample-Adaptive Inference

A key innovation of ResKD is its ability to adjust computational effort based on the difficulty of the input sample. Not every image requires the full ensemble to be correctly classified. ResKD utilizes an "Energy" metric derived from softmax confidence to implement an early-exit strategy.

The relationship between the energy threshold (TH_energy), accuracy, and computational cost (FLOPs) for the student ensemble.

If the base student $S_0$ produces a high-confidence (low-energy) prediction, the system skips the subsequent res-students. For more ambiguous "difficult" samples, the system progressively activates $R_1, R_2, \dots, R_n$ until a sufficient confidence threshold is met. This approach, illustrated in Figure 5, allows the model to maintain high average accuracy while drastically reducing the average FLOPs per inference.

Key Insights and Theoretical Grounding

The authors justify the effectiveness of ResKD through the concept of "Informativeness" (GI), based on gradient norms. They demonstrate that the "informativeness gap" between the student ensemble and the teacher shrinks as more res-students are added. Essentially, learning the residual is often a simpler task than learning the entire mapping from scratch, allowing even tiny models to contribute meaningful corrections.

Furthermore, ResKD acts as a generic wrapper. It is compatible with various distillation losses (e.g., KL-divergence, L2 distance) and robust across different architectures like VGG, MobileNetV2, and ShuffleNetV2.

Experimental Results

ResKD was evaluated on benchmarks ranging from CIFAR-10 to ImageNet. The results highlight a significant breakthrough in the accuracy-efficiency trade-off:

  • Accuracy Recovery: On CIFAR-100, a standard ResNet-20 student typically achieves ~70.09% accuracy. The ResKD ensemble reached 72.42%, nearly matching the 72.44% accuracy of the much larger teacher.
  • Efficiency: On CIFAR-10, ResKD achieved competitive performance using only 18.04% of the teacher's FLOPs. On the large-scale ImageNet dataset, it maintained high performance using 56.86% of the teacher's computational budget.

Conclusion

ResKD effectively addresses the capacity gap in knowledge distillation by treating the teacher's residual error as valuable knowledge. By combining NAS-optimized tiny students with an adaptive inference mechanism, the framework provides a flexible and efficient path for deploying high-performance models on resource-constrained hardware. Future work may extend this residual-guided approach to more complex vision tasks like object detection and semantic segmentation.

Summary updated

BibTeX
@article{li2020reskd,
  author = {Xuewei Li and Songyuan Li and Bourahla Omar and Fei Wu and Xi Li},
  title = {{ResKD: Residual-Guided Knowledge Distillation}},
  journal = {IEEE Trans. Image Process.},
  year = {2020},
  doi = {10.1109/tip.2021.3066051},
}
Figure