Matching Guided Distillation

Kaiyu Yue, Jiangfan Deng, Feng Zhou

Abstract

Feature distillation typically relies on additional adaptation modules to align the dimensions of teacher and student models. However, these modules introduce extra parameters and can disturb pre-trained features. We present Matching Guided Distillation (MGD), a parameter-free approach that treats channel alignment as a bipartite matching problem. By utilizing the Hungarian algorithm for optimal pairing and Absolute Max Pooling (AMP) for channel reduction, MGD achieves state-of-the-art performance across various vision tasks while maintaining a low memory footprint.

Introduction

Knowledge distillation (KD) has evolved from logit-based methods to feature-based distillation, which transfers knowledge from intermediate layers. A persistent challenge in this domain is the "semantic gap" caused by differing channel counts and activation patterns between teacher and student models. Traditional methods bridge this gap using adaptation modules, such as $1 \times 1$ convolutions. While effective, these modules increase computational overhead and can hinder the distillation of pre-trained models due to the disturbance caused by random initialization.

Methodology

Matching Guided Distillation (MGD) replaces learned adaptation layers with a mathematical matching process. The framework consists of two primary components: channel matching and channel reduction, optimized through an iterative process.

The MGD framework and optimization process.

Channel Matching as an Assignment Problem

MGD calculates a distance matrix between all teacher and student channels using Euclidean distance. The Hungarian algorithm is then employed to find the optimal many-to-one matching, ensuring each student channel is paired with the most semantically relevant teacher channels. This dynamic alignment ensures the student is always guided by the most appropriate features as training progresses.

Channel Reduction Strategies

To align the teacher's feature dimensions with the student's, the matched teacher channels must be reduced. The authors explore three strategies:

  1. Sparse Matching (SM): Retains only the single most relevant teacher channel for each student channel.
  2. Random Drop (RD): Randomly samples one teacher channel from the matched group.
  3. Absolute Max Pooling (AMP): The most effective strategy, which performs element-wise pooling by selecting the value with the largest absolute magnitude. This preserves the "sharpest" features—both strong positive and strong negative activations—which carry critical semantic information.
Comparison of channel reduction methods.

Optimization

The training process follows a coordinate descent approach, alternating between solving for the optimal matching matrix $M$ and updating the student's weights using standard backpropagation based on the distillation loss.

Results and Discussion

MGD demonstrates superior performance across multiple benchmarks, including CIFAR-100, ImageNet, and CUB-200.

  • Classification: On CIFAR-100, MGD-AMP achieved a 21.12% error rate on a WideResNet-28-2 student, outperforming previous state-of-the-art methods like Overhaul (21.98%).
  • Transfer Learning: In fine-grained recognition on CUB-200, MGD-AMP helped a MobileNet-V2 student reduce its error rate from 24.61% to 20.64%.
  • Object Detection: On the COCO dataset, MGD improved the mAP of a ResNet-18 backbone by nearly 1.0 point.
  • Efficiency: By removing adaptation modules, MGD avoids adding millions of parameters. This makes it significantly more memory-efficient, preventing the Out-of-Memory (OOM) errors that often affect complex distillation frameworks on standard hardware.

Conclusion

By eliminating the need for adaptation modules, Matching Guided Distillation offers a robust, parameter-free alternative for feature distillation. Its ability to dynamically align channels through bipartite matching and preserve critical information via Absolute Max Pooling makes it a versatile and efficient tool for enhancing student models across a wide range of computer vision tasks.

Summary updated

BibTeX
@inproceedings{yue2020matching,
  author = {Kaiyu Yue and Jiangfan Deng and Feng Zhou},
  title = {{Matching Guided Distillation}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58555-6\_19},
}
Figure