Face Model Compression by Distilling Knowledge from Neurons

Ping Luo, Zhenyao Zhu, Ziwei Liu, Xiaogang Wang, Xiaoou Tang

Introduction

Modern face recognition systems rely on massive Deep Neural Networks (DNNs) or ensembles to achieve high accuracy. However, these models are computationally expensive, often containing millions of parameters, which hinders deployment on resource-constrained mobile or embedded devices. Traditional Knowledge Distillation (KD) attempts to address this by training a smaller "student" network to mimic the "soft targets" (output probabilities) of a larger "teacher" network. In face recognition, where identity classes can number in the tens of thousands, these soft targets become extremely high-dimensional and sparse, leading to slow convergence and difficult training.

Methodology

This research proposes a shift from distilling final labels to distilling internal representations. The approach focuses on two key innovations:

  1. Distillation from Hidden Neurons: Instead of matching final output probabilities, the student network mimics the neurons in the teacher's top hidden layer. This representation is more compact (e.g., 512 dimensions) while preserving essential discriminative information.
  2. Attribute-Aware Neuron Selection: Not all neurons contribute equally to identity recognition; some may capture "noise" like lighting or expressions. The authors formulate neuron selection as an optimization problem on a graph, where nodes represent neurons weighted by their sensitivity to Identity-related Attributes (IA) versus Non-identity Attributes (NA). By selecting a subset of highly discriminative, low-redundancy neurons, the student learns a more robust feature set.

Distributed Representations in Face Models

A core insight of this work is that deeply learned face representations are distributed across specific attributes. Analysis reveals that individual neurons often specialize in detecting combinations of traits, such as gender, race, or specific facial features.

Visualization of individual neurons and the facial attributes they represent, demonstrating how identity information is distributed across the network.

By identifying and filtering neurons sensitive to non-identity factors (e.g., "smiling" or "wearing earrings"), the distillation process forces the student to focus on features that generalize better for verification tasks. This filtering helps the student avoid overfitting to the teacher's noise.

Experimental Results

The proposed student network, a simplified version of the DeepID2+ architecture, was evaluated on the Labeled Faces in the Wild (LFW) benchmark.

Performance and Efficiency

The student model achieved a verification accuracy of 98.43% AUC when mimicking a six-network ensemble, actually surpassing the performance of a single teacher model (97.83%). More importantly, the model achieved significant gains in efficiency:

Comparison of runtime (ms) and parameter counts (millions) between teacher models (T1, T2, T1-ens) and the compressed student model (S).

As shown in the figures above, the student model (S) provides a 51.6x compression ratio and a 90x speed-up compared to the state-of-the-art ensemble. With a storage footprint of only 4 MB and the ability to process 250 frames per second on a standard CPU, the model is highly suitable for real-time mobile applications.

Training Convergence

The use of selected neurons as supervisors significantly accelerated training. The student model converged at least five times faster than models trained using traditional soft targets or hard labels, demonstrating that hidden layers provide a richer and more stable signal for distillation than final softmax outputs.

Conclusion

By distilling knowledge from informative internal neurons rather than sparse output labels, this method produces face recognition models that are both smaller and more accurate than their teachers. This approach highlights the potential of using domain-specific neuron selection to create highly efficient DNNs for specialized tasks beyond face recognition.

Summary updated

BibTeX
@inproceedings{luo2016face,
  author = {Ping Luo and Zhenyao Zhu and Ziwei Liu and Xiaogang Wang and Xiaoou Tang},
  title = {{Face Model Compression by Distilling Knowledge from Neurons}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2016},
  doi = {10.1609/aaai.v30i1.10449},
}
Figure