[Paper Review] Instance-Conditional Knowledge Distillation for Object Detection
This paper proposes Instance-Conditional Knowledge Distillation (ICD), a novel framework that uses instance-aware attention to selectively distill knowledge from a teacher to a student detector, improving both localization and classification. By treating each object instance as a query and using attention to weigh relevant features, ICD achieves a 3.3 mAP gain on COCO, with a ResNet-50 student surpassing a ResNet-101 teacher.
Knowledge distillation has shown great success in classification, however, it is still challenging for detection. In a typical image for detection, representations from different locations may have different contributions to detection targets, making the distillation hard to balance. In this paper, we propose a conditional distillation framework to distill the desired knowledge, namely knowledge that is beneficial in terms of both classification and localization for every instance. The framework introduces a learnable conditional decoding module, which retrieves information given each target instance as query. Specifically, we encode the condition information as query and use the teacher's representations as key. The attention between query and key is used to measure the contribution of different features, guided by a localization-recognition-sensitive auxiliary task. Extensive experiments demonstrate the efficacy of our method: we observe impressive improvements under various settings. Notably, we boost RetinaNet with ResNet-50 backbone from 37.4 to 40.7 mAP (+3.3) under 1x schedule, that even surpasses the teacher (40.4 mAP) with ResNet-101 backbone under 3x schedule. Code has been released on https://github.com/megvii-research/ICD.
Motivation & Objective
- To address the imbalance and ambiguity in knowledge distillation for object detection, where features from different spatial locations contribute unequally to detection performance.
- To improve distillation quality by explicitly identifying and transferring knowledge that is most relevant to each detected instance, rather than applying uniform distillation across features.
- To develop a learnable, query-based mechanism that dynamically retrieves instance-specific knowledge from the teacher network’s intermediate representations.
- To optimize the knowledge retrieval process via a localization- and recognition-sensitive auxiliary task, enhancing the decoder’s ability to locate useful features.
- To enable small student detectors to surpass larger teacher models in accuracy, especially under resource-constrained settings.
Proposed method
- A conditional decoding module is introduced, where each detected object instance is embedded as a query to attend over the teacher’s feature maps, which are used as keys and values.
- Instance-aware cross-attention is used to compute attention weights between the query (object instance) and the teacher’s features, enabling selective feature retrieval.
- Knowledge distillation is performed only on the weighted features selected by the attention mechanism, focusing on regions most relevant to each object.
- An auxiliary task is designed to guide the decoder: it predicts both classification and bounding box regression for each instance, aligning the attention mechanism with detection objectives.
- The decoder is trained end-to-end with the student detector, using a multi-task loss that combines detection and auxiliary knowledge retrieval supervision.
- The method is compatible with various detectors and does not require architectural changes to the student or teacher networks.
Experimental results
Research questions
- RQ1How can knowledge distillation in object detection be made more selective and instance-specific, rather than applying uniform distillation across all features?
- RQ2Can a learnable attention mechanism that uses object instances as queries improve the quality and relevance of distilled knowledge?
- RQ3Does introducing an auxiliary task that aligns knowledge retrieval with detection objectives lead to better performance than heuristic or rule-based feature selection?
- RQ4Can a smaller student network surpass a larger teacher network in mAP through instance-conditional distillation?
- RQ5What is the computational and memory cost of integrating such a conditional decoding module into standard detection pipelines?
Key findings
- ICD achieves a 3.3 mAP improvement on MS-COCO using RetinaNet with a ResNet-50 backbone, increasing mAP from 37.4 to 40.7 under a 1× schedule.
- The student model with ResNet-50 outperforms the teacher model with ResNet-101 under a 3× schedule, achieving 40.7 mAP compared to the teacher’s 40.4 mAP.
- The proposed instance-conditional attention mechanism yields a 0.9 mAP gain over the baseline and 0.4 mAP over the best alternative attention method.
- Ablation studies show that 8 attention heads yield the best performance, and cascaded decoders provide minimal improvement, suggesting the decoder’s capacity is sufficient with a single stage.
- The training cost for the decoder is negligible—only 1.3 hours on 8 A100 GPUs—making the method practical for real-world deployment.
- Visualization confirms that different attention heads attend to different components (e.g., salient parts, boundaries), validating the model’s ability to focus on semantically relevant regions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.