Knowledge Distillation via Instance-level Sequence Learning

Haoran Zhao, Xin Sun, Junyu Dong, Zihe Dong, Qiong Li

Abstract

Deep Neural Networks (DNNs) are often too computationally intensive for deployment on resource-constrained edge devices. Knowledge Distillation (KD) addresses this by using a large, pre-trained "teacher" network to guide a smaller "student" network. However, the significant capacity gap between these models often hinders effective knowledge transfer when training on random data batches. We present Sequence Learning Knowledge Distillation (SLKD), a framework that employs a student-centric "easy-to-hard" curriculum. By ranking data difficulty based on the student's own intermediate performance, SLKD bridges the representation gap and achieves superior accuracy and compression across multiple computer vision benchmarks.

Introduction

While Deep Neural Networks (DNNs) have achieved state-of-the-art performance in various tasks, their deployment is often limited by high computational costs. Knowledge Distillation (KD) is a popular solution where a compact student network mimics the behavior of a larger teacher. A major flaw in standard KD is the use of random mini-batches, which ignores the "representation gap": a low-capacity student often struggles to grasp complex features immediately. This paper argues that a student should be guided gradually—learning simple concepts before tackling the teacher's most complex knowledge.

Methodology: Instance-level Sequence Learning

The core of the SLKD framework is the Instance-level Sequence Learning approach. Instead of treating all training data as equal from the start, it implements a multi-stage curriculum designed specifically for the student's limitations.

Overview of the SLKD framework, illustrating the interaction between the Snapshot Network, Curriculum Design, and the Teacher-Student distillation process.

The process follows four primary steps:

  1. Teacher Preparation: A large teacher network is pre-trained on the full dataset.
  2. Snapshot Generation: The student network undergoes a brief initial training phase to produce a "snapshot" model.
  3. Curriculum Design: The snapshot model acts as a scorer. Samples it predicts with high confidence are labeled "easy," while those with low confidence are "hard."
  4. Multi-stage Distillation: Training is divided into $N$ stages. The student is first trained on the easiest subset while mimicking the teacher. In subsequent stages, increasingly difficult subsets are added until the student is training on the entire dataset.

Notably, using the student's own intermediate state (the snapshot) creates a curriculum better suited to its specific capacity than a curriculum designed by a high-capacity teacher.

Experimental Results

The authors evaluated SLKD on standard benchmarks including CIFAR-10, CIFAR-100, SVHN, and CINIC-10. The framework consistently outperformed standard KD and other state-of-the-art methods like FitNet and Attention Transfer (AT).

  • Accuracy Gains: On CIFAR-100, an SLKD-trained ResNet-20 student achieved 70.02% accuracy, compared to 68.33% for a student trained from scratch and 69.10% for standard KD.
  • Compression Efficiency: The method successfully distilled a ResNet-110 (1.7M parameters) into a ResNet-20 (0.27M parameters), achieving a 6x compression ratio with only a marginal 0.8% loss in accuracy.
  • Generalization: SLKD proved effective across diverse architectures, including MobileNet and ShuffleNetV2.

Discussion and Key Insights

A critical insight of this work is that the student network perceives the feature space differently than the teacher. A curriculum helps the student "climb the ladder" of complexity rather than being overwhelmed by the full dataset's difficulty at the outset.

Training loss and testing accuracy curves comparing standard Knowledge Distillation (KD) and Sequence Learning (SL). The SL curves show characteristic spikes when new data subsets are introduced, eventually leading to higher final accuracy.

As illustrated in the training curves, while adding new, harder data causes temporary spikes in loss, the overall trajectory leads to a better local minimum and higher final accuracy than standard KD. Furthermore, the framework achieves better performance with fewer total iterations compared to standard training methods.

Conclusion

SLKD offers a robust method for bridging the representation gap in knowledge distillation through student-centric curriculum learning. While currently focused on image classification and requiring empirical tuning for stage scheduling, the framework demonstrates significant potential for efficient model compression. Future work may explore automated snapshot timing and applications in more complex tasks like object detection.

Summary updated

BibTeX
@article{zhao2021knowledge,
  author = {Haoran Zhao and Xin Sun and Junyu Dong and Zihe Dong and Qiong Li},
  title = {{Knowledge Distillation via Instance-level Sequence Learning}},
  journal = {Knowledge-Based Systems},
  year = {2021},
  doi = {10.1016/j.knosys.2021.107519},
}
Figure