Abstract
Feature regression is a simple way to distill large neural network models to smaller ones. We show that with simple changes to the network architecture, regression can outperform more complex state-of-the-art approaches for knowledge distillation from self-supervised models. Surprisingly, the addition of a multi-layer perceptron head to the CNN backbone is beneficial even if used only during distillation and discarded in the downstream task. Deeper non-linear projections can thus be used to accurately mimic the teacher without changing inference architecture and time. Moreover, we utilize independent projection heads to simultaneously distill multiple teacher networks. We also find that using the same weakly augmented image as input for both teacher and student networks aids distillation. Experiments on ImageNet dataset demonstrate the efficacy of the proposed changes in various self-supervised distillation settings.
Introduction
Self-supervised learning (SSL) has revolutionized computer vision by allowing models to learn from massive unlabeled datasets. However, the most performant SSL models are often massive, making them impractical for edge devices or real-time applications. To solve this, researchers use Knowledge Distillation (KD) to "teach" a smaller student model to mimic a large teacher.
In supervised learning, this typically involves matching class probabilities. However, SSL models produce high-dimensional latent feature vectors rather than probabilities. Previous state-of-the-art solutions involved complex contrastive losses, massive memory banks, and finicky hyperparameters. Simple feature regression—directly matching vectors—was generally considered too naive to work well. SimReg challenges this assumption by demonstrating that with specific architectural choices, simple regression can outperform complex alternatives.
Methods
The core of SimReg (Regression as a Simple yet Effective Tool) involves three key components designed to maximize the efficiency of feature matching:
- The MLP Prediction Head: During training, a non-linear MLP (typically 2 or 4 layers) is placed on top of the student backbone. The student is trained to regress its MLP output to match the teacher's fixed feature vector using a squared Euclidean distance loss.
- Discarding the Head for Inference: Crucially, the MLP head is only used during distillation. For the actual downstream task (inference), the head is discarded, and features are taken directly from the student backbone. This ensures the student's inference speed and memory footprint remain unchanged.
- Weak, Identical Augmentation: Unlike standard SSL training, which uses aggressive and different augmentations for two views of an image, SimReg finds that using the same weakly augmented image for both the teacher and student leads to significantly better distillation results.
Key Insights: The Backbone Paradox
One of the most surprising findings in SimReg is that the features from the student's backbone (before the MLP) actually perform better on downstream tasks than the features from the final MLP layer. This is counter-intuitive because the final MLP layer is the one explicitly trained to match the teacher and achieves a lower Mean Squared Error (MSE).
Adding a deep MLP head allows the student to mimic the teacher more accurately during training without increasing the complexity of the model used at test time. It acts as a "buffer" that helps the backbone learn more generalizable representations. Furthermore, this architecture naturally extends to multiple teachers by giving the student a separate MLP head for each teacher, allowing it to aggregate knowledge from different SSL paradigms (e.g., MoCo-v2 and BYOL) into a single backbone.
Results
SimReg was evaluated extensively on ImageNet and a transfer learning suite of 10 diverse datasets. The results demonstrate that simple regression, when properly structured, is a formidable baseline.
- ImageNet Performance: On linear evaluation, a MobileNet-v2 student distilled from a MoCo-v2 ResNet-50 teacher achieved 69.1% accuracy, significantly outperforming the previous best method, CompRess-1q (65.8%), and the standard regression baseline (48.0%).
- Closing the Gap: The distilled MobileNet-v2 is only 1.7 points behind its much larger teacher, despite being significantly more efficient.
- Outperforming Scratch: A ResNet-50 distilled from a SimCLR teacher using SimReg achieved 74.2% accuracy—4.9 points higher than a ResNet-50 trained from scratch using SimCLR.
Conclusion
SimReg proves that we may be over-engineering SSL distillation. By showing that regression can beat complex methods like CompRess or CRD, the authors highlight the importance of architectural "buffers" like the MLP head. While the empirical results are strong, the theoretical reason why backbone features outperform the explicitly trained MLP features remains an open question. Future work may explore if these insights translate to non-CNN architectures like Vision Transformers (ViTs).
Summary updated