Knowledge distillation via adaptive instance normalization

Jing Yang, Brais Martínez, Adrian Bulat, Georgios TzimiropoulosarXiv 2020

Abstract

Knowledge distillation (KD) is a critical technique for compressing deep neural networks, enabling their deployment on resource-constrained edge devices. Traditional KD methods often rely on matching output logits or intermediate feature maps, which can be either too high-level or overly restrictive. This paper proposes a novel approach that transfers channel-wise feature statistics (mean and variance) from a teacher to a student network. By employing Adaptive Instance Normalization (AdaIN), the student's statistics are injected into the teacher's feature maps, allowing the teacher to evaluate the functional utility of the learned statistics. This method consistently outperforms state-of-the-art distillation techniques across various architectures and datasets, including CIFAR and ImageNet.

Introduction

The deployment of high-performance Convolutional Neural Networks (CNNs) on resource-constrained edge devices necessitates effective model compression. Knowledge Distillation (KD) has emerged as a leading strategy, where a compact "student" network is trained under the guidance of a high-capacity "teacher" network.

Historically, KD research has focused on two extremes: matching the teacher's final output probabilities (logits) or matching entire intermediate feature maps. However, matching full feature maps can be overly rigid, potentially hindering the student's convergence by forcing it to replicate noise or task-irrelevant details. This paper identifies an unexplored middle ground: transferring feature statistics—specifically channel-wise mean and variance. While these statistics are widely used in style transfer and domain adaptation, their potential for KD has remained largely untapped.

Methodology

The authors propose a distillation framework that combines standard supervised learning with two statistics-based losses.

Statistics Matching Loss ($L_{SM}$)

The most direct way to transfer statistics is through a simple $L_2$ distance penalty. This loss encourages the student's channel-wise mean ($\mu_S$) and variance ($\sigma_S$) to align with the teacher's ($\mu_T, \sigma_T$) at corresponding layers.

AdaIN-based Distillation ($L_{AdaIN}$)

The core innovation of this work is the use of Adaptive Instance Normalization (AdaIN) as a task-aware evaluator. Instead of just matching numbers, the method tests if the student's statistics are "good enough" for the teacher's classification task.

Overview of (a) the goal of matching statistics, (b) the standard $L_2$ matching approach, and (c) the proposed AdaIN-based distillation framework.

As shown in the diagram above, the teacher's intermediate feature map is first normalized. Then, the student's predicted mean and variance are applied to this normalized map via AdaIN. This "hybrid" feature map—containing teacher "content" and student "style" (statistics)—is passed through the remaining frozen layers of the teacher network. The $L_{AdaIN}$ loss minimizes the discrepancy between the resulting prediction and the teacher's original prediction. This ensures that the statistics learned by the student are functionally relevant to the final classification objective.

Experimental Results

The proposed method was evaluated on CIFAR-10, CIFAR-100, and ImageNet-1K across several architectures, including ResNet, Wide ResNet, and MobileNetV2.

Performance on Standard Benchmarks

On CIFAR-100, distilling a Wide ResNet-40-4 teacher into a Wide ResNet-16-4 student resulted in a Top-1 accuracy of 78.25%, a significant improvement over the 75.68% baseline and the 77.17% achieved by standard KD. Similar gains were observed on ImageNet, where a ResNet-18 student reached 71.82% Top-1 accuracy when distilled from a ResNet-34 teacher.

Cross-Domain Robustness

A key strength of the AdaIN-based approach is its robustness across different network domains. The authors successfully distilled knowledge from a real-valued ResNet-34 into a highly constrained Binary Neural Network (BNN). On CIFAR-100, the binary student's accuracy improved from 65.34% to 70.15%, demonstrating the method's versatility.

Ablation Study

Ablation experiments confirmed that $L_{SM}$ and $L_{AdaIN}$ are complementary. While $L_{SM}$ provides a basic alignment, $L_{AdaIN}$ provides the task-specific refinement necessary for peak performance. Applying the distillation at deeper layers was also found to be more effective, as deeper features are more task-specific and discriminative.

Conclusion

This paper introduces a powerful new paradigm for knowledge distillation by leveraging Adaptive Instance Normalization to transfer feature statistics. By treating the teacher as an active evaluator of the student's learned statistics, the method provides a flexible yet task-aware supervisory signal. The consistent performance gains across various datasets and architectures suggest that statistics-based transfer is a highly effective tool for model compression.

Summary updated

BibTeX
@misc{yang2020knowledge,
  author = {Jing Yang and Brais Martínez and Adrian Bulat and Georgios Tzimiropoulos},
  title = {{Knowledge distillation via adaptive instance normalization}},
  year = {2020},
  eprint = {2003.04289},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2003.04289},
}
Figure