Abstract
There is an increasing interest on accelerating neural networks for real-time applications. We study the student-teacher strategy, in which a small and fast student network is trained with the auxiliary information learned from a large and accurate teacher network. We propose to use conditional adversarial networks to learn the loss function to transfer knowledge from teacher to student. The proposed method is particularly effective for relatively small student networks. Moreover, experimental results show the effect of network size when the modern networks are used as student. We empirically study the trade-off between inference time and classification accuracy, and provide suggestions on choosing a proper student network.
Introduction
Deep Neural Networks (DNNs) have achieved state-of-the-art performance across various computer vision tasks. However, high-performing models like ResNet or Wide Residual Networks (WRNs) are often computationally expensive and memory-intensive, making them difficult to deploy on resource-constrained mobile or embedded systems.
Knowledge Distillation (KD) is a popular technique to address this by training a compact "student" network to mimic a larger "teacher" network. Traditionally, this involves minimizing a fixed loss function, such as Kullback-Leibler (KL) divergence, between the networks' probability distributions. This paper argues that such rigid, hand-engineered loss functions may be suboptimal, especially when the student's capacity is significantly lower than the teacher's. Instead, the authors propose using Conditional Adversarial Networks to learn a flexible loss function tailored for knowledge transfer.
Proposed Method: Adversarial Knowledge Distillation
The core innovation is a GAN-based framework where the loss function is learned rather than predefined. The system consists of three main components:
- The Generator (Student): A compact network designed for efficient inference.
- The Teacher: A fixed, pre-trained high-performance network.
- The Discriminator: A Multi-Layer Perceptron (MLP) that evaluates the "logits" (raw output scores) from both networks. Its goal is to distinguish between the teacher's expert outputs and the student's approximations.
Instead of matching specific values, the student is trained to "fool" the discriminator into believing its outputs are indistinguishable from the teacher's. This allows the student to capture the underlying distribution of the teacher's "dark knowledge" more flexibly. To ensure stability and performance, the objective function combines the adversarial loss ($L_{GAN}$) with a standard supervised cross-entropy loss ($L_S$) and an $L_1$ instance alignment loss.
Experimental Results
The researchers evaluated the method on CIFAR-10, CIFAR-100, and ImageNet32. The GAN-based approach consistently outperformed both standalone training and traditional KD methods. For example, on CIFAR-100, a WRN-10-4 student achieved a 25.75% error rate with the proposed method, compared to 27.06% with traditional KD.
A key finding is the improved trade-off between accuracy and efficiency. As shown in the experimental analysis, the proposed method (labeled "Ours") maintains a lower error rate across various inference time budgets compared to standard KD. In some cases, the student network was 7x smaller and 5x faster than the teacher while retaining high accuracy.
Discussion and Conclusion
By shifting from a fixed loss to a learned adversarial loss, this framework allows low-capacity student networks to better approximate complex teacher outputs. The method is less sensitive to hyperparameter tuning than traditional KD and handles multi-modal distributions more effectively. While adversarial training introduces some complexity during the training phase, the resulting student networks are highly efficient for real-time deployment. Future work may explore extending this approach to ensembles of multiple teachers to further enhance the quality of the transferred knowledge.
Summary updated