Contrastive Representation Distillation via Multi-Scale Feature Decoupling

Cuipeng Wang, Tieyuan Chen, Haipeng WangarXiv 2025 · DOI

Abstract

Knowledge Distillation (KD) aims to transfer knowledge from a complex teacher network to a compact student network. Traditional feature-based KD methods often suffer from semantic confusion due to global feature alignment and high memory requirements for contrastive learning. We present MSDCRD (Contrastive Representation Distillation via Multi-Scale Feature Decoupling), a framework that decouples global features into multi-scale local patches. By filtering these patches for quality and applying dual contrastive losses within a single training batch, MSDCRD achieves state-of-the-art performance across various architectures, including cross-family distillation between Transformers and CNNs.

Introduction

Knowledge Distillation (KD) is a critical technique for deploying deep learning models on resource-constrained devices. However, current feature-based KD methods face three primary challenges:

  1. Semantic Confusion: Aligning global features often ignores the fact that a single image contains multiple semantic regions. Forcing a student to match a global average can lead to a loss of fine-grained detail.
  2. Inefficiency of Contrastive Learning: Standard Contrastive Representation Distillation (CRD) requires massive memory buffers to store negative samples, making it computationally expensive.
  3. The Architecture Gap: Distilling knowledge between heterogeneous architectures (e.g., Transformer to CNN) is difficult because their internal feature representations differ significantly.
Semantic confusion in global features: different regions of an image may correspond to different class activations.

Methods

The proposed MSDCRD method addresses these issues through three core components designed to capture and transfer fine-grained semantic knowledge efficiently.

Multi-Scale Feature Decoupling

Instead of relying on global feature maps, MSDCRD uses Multi-Scale Pooling (MSP). By employing sliding windows of various sizes, the model extracts local feature patches. This allows the student to learn from specific semantic regions rather than a blurred global average.

Sample Selection (SS)

To ensure only high-quality knowledge is transferred, the authors implement a Sample Selection mechanism. The teacher’s pre-trained classifier scores the extracted local patches. Patches with high confidence scores are prioritized as "high-quality" knowledge, while low-confidence patches (often representing background noise) are filtered or down-weighted.

The MSDCRD framework: Multi-scale decoupling, sample selection, and dual contrastive losses.

Dual Contrastive Losses

MSDCRD utilizes two types of contrastive losses to align the student with the teacher without requiring an external memory buffer:

  • Sample-wise Contrastive Loss: Aligns the student’s local patches with the teacher’s corresponding patches within the same mini-batch.
  • Feature-wise Contrastive Loss: Analyzes relationships between feature channels across the batch to help the student capture semantic directions mastered by the teacher.

Experimental Results

Performance on Standard Benchmarks

MSDCRD was evaluated on CIFAR-100, ImageNet, and MS COCO 2017. On CIFAR-100, it consistently outperformed previous state-of-the-art (SOTA) methods. Notably, when distilling a Swin Transformer into a ResNet18, it achieved an accuracy of 84.47%, a +6.79% improvement over the baseline.

On ImageNet, distilling a ResNet34 into a ResNet18 yielded a 72.21% top-1 accuracy, outperforming standard CRD by over 1%.

Cross-Family Distillation and Object Detection

The method excels in "cross-family" distillation (e.g., ConvNeXt to ResMLP), frequently outperforming competing methods by several percentage points. Furthermore, applying MSDCRD to object detection frameworks like Faster R-CNN on the COCO dataset resulted in significant gains in Mean Average Precision (mAP), demonstrating the robustness of the learned features.

Conclusion

MSDCRD introduces a memory-efficient and semantically aware approach to knowledge distillation. By decoupling global features into local patches and using the teacher as a quality controller, the framework bridges the gap between heterogeneous architectures and achieves superior performance on both classification and detection tasks. Future work may involve extending this decoupling principle to other domains such as Natural Language Processing.

Summary updated

BibTeX
@misc{wang2025contrastive,
  author = {Cuipeng Wang and Tieyuan Chen and Haipeng Wang},
  title = {{Contrastive Representation Distillation via Multi-Scale Feature Decoupling}},
  year = {2025},
  eprint = {2502.05835},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.05835},
}
Figure