Distilling Object Detectors via Decoupled Features

Jianyuan Guo, Kai Han, Yunhe Wang, Han Wu, Xinghao Chen, Chunjing Xu, Chang Xu

Introduction

Knowledge Distillation (KD) is a popular technique where a compact "student" network learns to mimic a high-performing "teacher" network. While successful in image classification, KD for object detection is complex because detectors must solve both classification and localization simultaneously. Most existing methods focus exclusively on foreground object regions, assuming background regions are merely "noise."

The authors of DeFeat (Decoupled Features) challenge this assumption, arguing that background features contain vital contextual information. A student needs to learn not just what an object looks like, but also what the absence of an object looks like to avoid false positives. However, simply distilling the whole image is often ineffective because strong signals from objects tend to "drown out" the subtler background signals.

Methodology: The DeFeat Framework

DeFeat treats foreground and background features as distinct entities during the distillation process. This decoupling occurs at two primary levels:

The DeFeat framework decouples features at the FPN level and RoIs at the classification head to independently distill foreground and background information.

1. Neck (FPN) Feature Distillation

Intermediate features from the Feature Pyramid Network (FPN) are split using ground-truth masks. The student mimics the teacher's features in object and background regions separately. By assigning different loss weights ($\alpha_{obj}$ and $\alpha_{bg}$), the student can learn from the background without being overwhelmed by foreground gradients.

2. Classification Head Distillation

Region proposals (RoIs) are also decoupled. Proposals overlapping with ground-truth objects (positive) and those that do not (negative) are processed separately. The student mimics the teacher’s classification logits using Kullback-Leibler (KL) divergence. Using different temperatures ($T$) for positive and negative samples allows the student to capture "dark knowledge" more effectively.

Key Insights and Analysis

A primary motivation for DeFeat is the observation of Gradient Discordance. The authors found that gradients from object regions are consistently much larger than those from the background. Without decoupling, the optimizer naturally ignores the background to focus on the foreground.

Gradient norm analysis shows that object regions (blue) consistently produce higher magnitude signals than background regions (orange), necessitating a decoupled approach to prevent background information from being ignored.

Other key findings include:

  • Background as a Teacher: Distilling only background regions provides a performance boost nearly identical to distilling only foreground regions, proving that background information is far from noise.
  • Reducing False Positives: Error analysis shows that background distillation specifically helps reduce "Background False Positives"—instances where the detector misidentifies empty space as an object.
  • Teacher Proposals: The method performs better when the student is supervised on the specific regions the teacher found interesting, rather than relying solely on its own proposals.

Experimental Results

DeFeat consistently outperformed previous state-of-the-art distillation methods across various architectures:

  • Faster R-CNN (Two-stage): A ResNet50 student distilled from a ResNet152 teacher improved from 37.4% to 40.9% mAP on COCO (+3.5%).
  • RetinaNet (One-stage): A ResNet50 student improved from 36.5% to 39.7% mAP (+3.2%).
  • Pascal VOC: DeFeat pushed a ResNet50 Faster R-CNN to 82.28% mAP, occasionally surpassing the teacher's performance.

Since DeFeat only modifies the training process, the resulting student models maintain their original compact size and fast inference speed.

Conclusion

DeFeat demonstrates that background context is crucial for distilling effective object detectors. By decoupling features and balancing their influence, the framework significantly reduces false positives and improves overall mAP. Future work may explore the application of this decoupling strategy to the regression head or specialized domains like medical imaging where context is paramount.

Summary updated

BibTeX
@inproceedings{guo2021distilling,
  author = {Jianyuan Guo and Kai Han and Yunhe Wang and Han Wu and Xinghao Chen and Chunjing Xu and Chang Xu},
  title = {{Distilling Object Detectors via Decoupled Features}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.00219},
}
Figure