Improving Self-supervised Lightweight Model Learning via Hard-Aware Metric Distillation

Hao Liu, Mang Ye

Abstract

Self-supervised learning (SSL) has achieved remarkable success in training large-scale neural networks without manual labels. However, a significant "capacity gap" exists when applying these techniques to lightweight models suitable for edge devices. This paper proposes Hard-aware Metric Distillation (SMD), a novel framework that transfers the relational knowledge (metrics) from a large teacher model to a smaller student model. By employing difference-guided mining and a dynamic weighting mechanism, SMD enables lightweight models like MobileNet-V3 to achieve performance levels previously reserved for much larger architectures.

Introduction: The Capacity Gap in SSL

While large models like ResNet-50 excel in self-supervised settings, lightweight models often struggle. For instance, a MobileNet-V3 trained with MoCo-V2 achieves only ~36% accuracy on ImageNet, a stark contrast to the 75%+ accuracy achieved with supervised labels. Existing distillation methods often rely on simple feature alignment or massive memory banks, which fail to capture the complex inter-sample relationships essential for robust self-supervised representations.

The SMD Framework

The core philosophy of SMD is metric transfer: the student should learn to perceive the relative distances between data points in the same way the teacher does, rather than merely mimicking absolute feature values.

The SMD framework: Feature Extraction, Difference-Guided Mining, and Hard-aware Metric Distillation.

The framework consists of three primary stages:

  1. Difference-Guided Mining: To identify positive (similar) and negative (dissimilar) pairs in unlabeled data, SMD uses a dynamic boundary. It calculates the distance between teacher and student features for the same image. If two different images are closer in the teacher's embedding space than this "teacher-to-student metric difference," they are treated as a positive pair.
  2. Hard-aware Distillation: Instead of optimizing for all pairs, SMD focuses on "batch hard mining"—identifying the furthest positive and closest negative samples to maximize information gain.
  3. Dynamic Weighting: A weighting factor based on "template relations" from the teacher handles the uncertainty of unlabeled data. It "mutes" likely misclassified samples and stops optimization once the student's performance on a pair exceeds the teacher's, preventing overfitting to teacher errors.

Comparison with Existing Methods

Unlike previous approaches like CompPress, SEED, or DisCo, which focus on logits or simple feature matching, SMD emphasizes the underlying metric space.

Comparison of SMD with existing self-supervised distillation frameworks.

As shown in Figure 1, while methods like SEED use memory banks and DisCo uses MLP-based feature alignment, SMD introduces a Cross Metric approach that leverages template relations to guide the student's feature learning more effectively.

Experimental Evaluation

The researchers evaluated SMD on CIFAR-100 and ImageNet-1K.

Key Results

  • ImageNet: An SMD-distilled ResNet-18 reached 61.8% Top-1 accuracy, outperforming SEED (57.9%) and DisCo (60.6%).
  • MobileNet-V3: SMD achieved 64.5% accuracy, a massive improvement over the 36.3% baseline.
  • Supervised Versatility: In supervised settings on CIFAR-100, SMD outperformed established methods like CRD. Notably, a WRN-16-2 student reached 76.39% accuracy, actually surpassing its WRN-40-2 teacher (75.61%).

Discussion and Conclusion

SMD demonstrates that focusing on relative distances (metrics) rather than absolute features allows lightweight models to learn more robust representations. The "dynamic boundary" creates an effective curriculum, while the "cut-off at zero" strategy allows students to potentially surpass their teachers by avoiding the replication of noisy embeddings.

While the method depends on an initial $L_2$ alignment phase and a high-quality teacher, it opens new avenues for deploying powerful self-supervised models on resource-constrained devices. Future work may extend this metric-based approach to object detection and non-visual domains.

Summary updated

BibTeX
@inproceedings{liu2022improving,
  author = {Hao Liu and Mang Ye},
  title = {{Improving Self-supervised Lightweight Model Learning via Hard-Aware Metric Distillation}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19821-2\_17},
}
Figure