General Instance Distillation for Object Detection

Xing Dai, Zeren Jiang, Zhao Wu, Yiping Bao, Zhicheng Wang, Si Liu, Erjin Zhou

Knowledge Distillation (KD) has proven effective for model compression in image classification but faces significant hurdles in object detection due to foreground-background imbalance and architectural dependencies. We present General Instance Distillation (GID), a framework-agnostic approach that identifies informative "General Instances" (GIs) where teacher and student models disagree. By distilling feature, relation, and response-based knowledge from these GIs, GID allows lightweight students to significantly narrow the performance gap, frequently outperforming their larger teachers.

The Challenges of Detection Distillation

While successful in classification, applying KD to object detection is challenging for three primary reasons:

  1. Foreground-Background Imbalance: Detection images are dominated by background, leading standard KD to focus on uninformative regions.
  2. Framework Dependency: Many existing methods are tied to specific detector architectures (e.g., two-stage vs. one-stage).
  3. Over-reliance on Ground Truth (GT): Most methods rely strictly on GT labels, ignoring the "dark knowledge" a teacher might possess regarding background context or inter-object relationships.

The GID Framework

To address these issues, GID introduces a General Instance Selection Module (GISM) to automatically identify the most discriminative regions for distillation without being tethered to GT labels.

Overview of the General Instance Distillation (GID) framework.

The GID pipeline consists of teacher and student backbones, the GISM for region selection, and a set of distillation losses targeting different levels of the network hierarchy: feature-based, relation-based, and response-based.

General Instance Selection Module (GISM)

The core of GID is the GISM, which identifies "General Instances" (GIs) by measuring the "information gap" between the teacher and student. The module calculates the $L_1$ distance between the classification scores of the teacher and student across the entire image. Regions with high distance indicate where the student's predictions deviate most from the teacher's, representing high-value learning opportunities. These regions are refined using Non-Maximum Suppression (NMS) to select the top $K$ GIs.

Three Pillars of Knowledge Transfer

Once GIs are identified, GID employs three distinct distillation strategies:

  • Feature-based Distillation: Uses ROIAlign to extract features from the backbones (specifically the FPN) corresponding to the GIs. The student is trained to match the teacher's internal representations in these specific areas.
  • Relation-based Distillation: A novel component that captures the spatial and semantic relationships between different GIs. By minimizing the Euclidean distance between the relational matrices of the teacher and student, the student learns the global context perceived by the teacher.
  • Response-based Distillation: Targets the final prediction heads. The student mimics the teacher's classification and regression outputs specifically within the GI regions.

Visualizing General Instances

The effectiveness of GISM lies in its ability to find regions that are not just limited to GT objects but are discriminative for the model's decision-making process.

Visualization of General Instances (GIs) and corresponding attention maps.

As shown in the visualization, GIs often cover objects of interest but also include surrounding context that helps the model distinguish foreground from background. The attention maps demonstrate that GID focuses the student's learning on areas where the teacher has strong activations, effectively transferring the teacher's "focus."

Key Results

GID was evaluated on MSCOCO 2017 and PASCAL VOC across various architectures, showing significant mAP improvements:

  • RetinaNet: A ResNet-50 student achieved 39.1% mAP on COCO, a +2.9% boost over the baseline and higher than the ResNet-101 teacher's 38.1% mAP.
  • FCOS: The student improved by +3.5% mAP, reaching 42.0%.
  • Faster R-CNN: The student saw a +1.9% mAP improvement.
  • Heterogeneous Backbones: A lightweight MobileNet-v2 student saw a +2.5% mAP gain when distilled from a ResNet-101 teacher.

Conclusion

General Instance Distillation provides a robust, framework-agnostic solution for object detection KD. By focusing on the information gap between models rather than just ground truth, GID captures a richer set of knowledge. The ability of students to surpass their teachers suggests that GID serves as an effective regularizer, pushing lightweight models toward better generalization.

Summary updated

BibTeX
@inproceedings{dai2021general,
  author = {Xing Dai and Zeren Jiang and Zhao Wu and Yiping Bao and Zhicheng Wang and Si Liu and Erjin Zhou},
  title = {{General Instance Distillation for Object Detection}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.00775},
}
Figure