Abstract
Dense visual prediction tasks, such as detection and segmentation, are crucial for time-critical applications like autonomous driving. While deep models achieve strong performance, their efficiency remains a challenge. Knowledge distillation (KD) is an effective model compression technique, but existing feature-based KD methods rely on static, teacher-driven feature selection, failing to adapt to the student's evolving learning state. We propose Adaptive student-teacher Cooperative Attention Masking for Knowledge Distillation (ACAM-KD), which introduces Student-Teacher Cross-Attention Feature Fusion (STCA-FF) and Adaptive Spatial-Channel Masking (ASCM). These components adaptively integrate features and dynamically generate importance masks. ACAM-KD improves object detection on COCO2017 by up to 1.4 mAP and semantic segmentation on Cityscapes by 3.09 mIoU over baselines.
Introduction: The Limitations of Static Distillation
Knowledge Distillation (KD) typically involves a large "teacher" model guiding a smaller "student" model. In dense prediction tasks, feature-based KD—aligning intermediate layer representations—is standard. However, most existing methods utilize static, teacher-driven selection mechanisms. They assume the teacher's attention (or human-defined heuristics like bounding boxes) is the absolute gold standard for what the student should learn.
This approach has two primary flaws. First, it ignores the student's evolving state; a student's learning needs change as training progresses, moving from basic structural features to fine-grained details. Second, the teacher is not infallible. Forcing a student to strictly mimic a teacher's potentially suboptimal focus can hinder performance. ACAM-KD addresses these by making distillation a cooperative, dynamic process.
The ACAM-KD Framework
The core of ACAM-KD lies in moving from passive mimicry to active cooperation. The architecture consists of two primary modules designed to facilitate this interaction.
Student-Teacher Cross-Attention Feature Fusion (STCA-FF)
Instead of treating teacher features as a fixed target, STCA-FF employs a cross-attention mechanism. The teacher’s features serve as the Query, while the student’s features provide the Key and Value. This fusion creates a representation that reflects the specific interaction between the two models, allowing the distillation process to be informed by what the student currently "knows" and what the teacher can "provide."
Adaptive Spatial-Channel Masking (ASCM)
Using the fused features from STCA-FF, the ASCM module generates learnable masks. While traditional KD often focuses solely on spatial regions (where to look), ASCM generates both spatial and channel-wise masks. This dual-masking approach allows the system to prioritize specific feature dimensions that are most informative for the student at any given epoch. To ensure these masks remain diverse and informative, a Dice coefficient-based diversity loss is applied, preventing the masks from collapsing into redundant patterns.
Experimental Results and Insights
The researchers evaluated ACAM-KD on MS COCO 2017 for object detection and Cityscapes for semantic segmentation.
Performance Gains
On COCO, distilling a ResNet-50 student from a ResNet-101 teacher yielded a 1.4 mAP improvement over previous state-of-the-art methods. When using a ResNeXt-101 teacher, the student's performance jumped by 4.1 mAP. In semantic segmentation on Cityscapes, a DeepLabV3-MobileNetV2 student saw a 3.09% mIoU boost over the baseline.
Visualizing the Evolving Student
A key insight of the paper is the dynamic nature of student attention. As shown in the visualizations, the student's focus shifts significantly throughout the training process.
By Epoch 12, the student model often demonstrates localization capabilities that rival or even exceed the teacher's fixed attention maps. Static KD methods fail to exploit this phenomenon, whereas ACAM-KD's adaptive masks allow the student to leverage its own strengths while still benefiting from teacher guidance.
Conclusion
ACAM-KD represents a shift in knowledge distillation philosophy: from mimicry to cooperation. By allowing the student to participate in selecting what it learns through cross-attention and adaptive masking, the framework achieves superior performance in dense prediction tasks without adding any inference-time overhead. Future work may extend this adaptive approach to other domains such as depth estimation or instance segmentation.
Summary updated