Learning Student Networks via Feature Embedding

Hanting Chen, Yunhe Wang, Chang Xu, Chao Xu, Dacheng Tao

TL;DR

This paper introduces a novel knowledge distillation method that treats the "teacher-student" learning process as a feature embedding task. By using a locality preserving loss, the authors enable a compact student network to inherit the intrinsic manifold structure of a heavy teacher network's features without adding any auxiliary parameters, resulting in faster training and state-of-the-art accuracy.

What Problem Does This Paper Address?

Deep Convolutional Neural Networks (CNNs) are powerful but computationally expensive, making them difficult to deploy on mobile and edge devices. Knowledge Distillation (KD) is a popular solution where a small "student" network learns from a large, pre-trained "teacher" network.

However, standard KD methods face a hurdle: the student's layers are usually "thinner" (fewer filters) than the teacher's. To bridge this dimensionality gap, existing methods like FitNets introduce auxiliary fully-connected layers to map student features to the teacher's space. These auxiliary layers can be massive—sometimes larger than the networks themselves—leading to significant memory overhead and slower training. The authors aim to transfer knowledge effectively without these extra, resource-heavy variables.

Methods

The core innovation is viewing distillation through the lens of manifold learning. The authors propose that if two images are "neighbors" in the teacher's high-dimensional feature space, they should remain neighbors in the student's low-dimensional feature space.

Fig. 1: The diagram of the proposed method for learning portable deep neural networks. The top line is the teacher network and the bottom line is the student network. By applying the proposed method with a locality preserving loss, the student network embeds features in a low-dimensional space and maintains the relationship between samples in the high-dimensional space.

Key components include:

  • Locality Preserving Loss (LLP): Inspired by Locality Preserving Projections (LPP), this loss function penalizes the student if the relative distances between samples in a mini-batch don't match the teacher's "neighborhood" structure.
  • No Auxiliary Parameters: Unlike FitNets, which require a transformation matrix $r$ to match feature dimensions, the LLP loss works directly on the relationships between samples, requiring zero extra parameters.
  • Unified Objective: The final training loss combines standard cross-entropy, the original KD loss (matching soft-max outputs), and the new LLP loss for intermediate feature matching.

Datasets

The authors evaluated their method on four standard computer vision benchmarks:

  • MNIST: For initial validation and feature visualization.
  • CIFAR-10 & CIFAR-100: To test performance on more complex, small-scale color images.
  • ImageNet (ILSVRC 2012): To demonstrate scalability on a large-scale, real-world dataset using ResNet-101 as the teacher and Inception-BN as the student.

Key Insights and Ideas

  • Relationships Matter More Than Values: Instead of trying to force the student's raw feature values to match the teacher's (which is hard due to different architectures), it is more effective to preserve the structure of the data.
  • Efficiency via Complexity Shift: The authors prove that their method has a computational complexity of $O(m^2(d_S + d_T))$, whereas traditional hint-based methods are $O(m d_S d_T)$. Since the batch size $m$ is typically much smaller than the feature dimensions $d$, the proposed method is significantly faster.
  • Manifold Preservation: The student network acts as a non-linear dimensionality reduction tool that learns to compress information while keeping the "semantic clusters" intact.

Key Results

The proposed method consistently outperformed state-of-the-art distillation techniques across all datasets:

  • Accuracy: On CIFAR-10, the "Student 4" model achieved 91.91% accuracy, surpassing the teacher (90.21%) and the FitNet baseline (91.55%). On ImageNet, it achieved a top-5 accuracy of 93.13%, outperforming standard back-propagation and other KD variants.
  • Memory Efficiency: In one example (Student 4), the auxiliary layer required by FitNet took 135MB of memory—nearly 4x the size of the teacher network. The proposed method eliminated this overhead entirely.
  • Feature Visualization: Visualizing MNIST features (Figure 2) shows that the proposed method produces much cleaner, more separable clusters than standard back-propagation or FitNet, closely mimicking the teacher's feature distribution.
Fig. 2: Visualization of features generated by different networks on the MNIST test set. (a) features of the original teacher network; (b) features of the student network learned using the standard back-propagation strategy; (c) features of the student network learned using FitNet; (d) features of the student network learned using the proposed method with locality preserving loss. Note that features of the same category in each figures are marked with the same color.

Limitations and Future Work

The authors note that while they focused on single-layer feature embedding, using multiple guided/hint layers could potentially yield further (albeit minor) improvements. They also acknowledge that the selection of which layers to bridge is an open question, though experimental evidence suggests that different choices have only a small impact on final accuracy. Future work could explore automated ways to select these layers or apply this manifold-based approach to other tasks like object detection or segmentation.

Summary updated

BibTeX
@misc{chen2018learning,
  author = {Hanting Chen and Yunhe Wang and Chang Xu and Chao Xu and Dacheng Tao},
  title = {{Learning Student Networks via Feature Embedding}},
  year = {2018},
  eprint = {1812.06597},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1812.06597},
}
Figure