Introduction
In the pursuit of high-performance computer vision models, "bigger is better" has become a dominant trend, particularly with the rise of Transformer-based architectures. Masked Image Modeling (MIM) techniques, such as MAE and BEiT, have enabled these large models to learn exceptionally robust features by predicting missing image patches. However, deploying these massive models on edge devices remains a challenge due to their high computational demands.
Traditional Knowledge Distillation (KD) offers a solution by transferring knowledge from a large "teacher" model to a smaller "student" model. While effective when both models share the same architecture (e.g., CNN to CNN), a significant "heterogeneity gap" emerges when attempting to distill knowledge from a Transformer teacher into a CNN student. This paper introduces Heterogeneous Generative Knowledge Distillation (H-GKD), the first framework to successfully bridge this gap, enabling efficient CNNs to inherit the powerful generative wisdom of MIM-trained Transformers.
Bridging the Heterogeneity Gap
The authors identify two primary obstacles in heterogeneous distillation:
- The Masking Mismatch: Standard convolutions naturally "bleed" information from visible pixels into masked ones due to their sliding-window nature. This creates a distribution shift that prevents CNN students from learning the generative task as effectively as Transformers, which process patches independently.
- The Relational Gap: Conventional KD focuses on aligning individual feature maps or labels. However, the internal representations of Transformers and CNNs are fundamentally different. A more "universal language" is needed to align their understanding of data.
The H-GKD Framework
To address these challenges, H-GKD introduces three key innovations:
- Sparse Convolutions: By replacing standard convolutions with sparse kernels, the student CNN is forced to ignore masked regions during the encoding phase. This ensures the student processes "holey" images in a manner consistent with the Transformer teacher.
- UNet-style Student Architecture: To accommodate the multi-scale nature of CNNs while mimicking the teacher's generative output, the student employs a UNet-style structure. This allows for hierarchical feature reconstruction across multiple scales.
- Instance Similarity via Memory Queues: Rather than forcing feature maps to match, H-GKD aligns the relationships between images. A memory queue of 50,000 embeddings is maintained to compute a "similarity distribution" for each input. The student is trained to match the teacher's ranking of how the current image relates to the thousands of others in the queue, using the Pearson correlation coefficient as a loss function.
Experimental Results
The researchers evaluated H-GKD on ImageNet-1K for classification and MS-COCO for downstream tasks like object detection and segmentation.
The results demonstrate a substantial performance leap. A "Sparse" ResNet50 student, when distilled from a BEiT-L teacher, achieved a Top-1 accuracy of 80.01% on ImageNet-1K—a massive 3.03% improvement over its baseline of 76.98%. This performance consistently outperforms other state-of-the-art distillation methods like DIST and SEED.
Furthermore, the benefits of H-GKD extend to downstream tasks. On the MS-COCO dataset, the distilled ResNet50 student showed significant gains in both Box AP (object detection) and Mask AP (instance segmentation), proving that generative distillation produces more versatile and robust feature extractors.
Discussion and Future Work
H-GKD proves that "convolutions are too helpful" in standard generative tasks; by restricting them through sparsity, they become better learners. Moreover, it highlights that aligning relational "opinions" (similarity distributions) is more effective for heterogeneous models than aligning raw features.
While H-GKD sets a new benchmark, it does introduce computational overhead due to the large memory queue required for similarity matching. Future research may explore optimizing this queue or applying generative distillation to other domains, such as low-level image restoration or AI-generated content (AIGC).
Summary updated