Learning Efficient Detector with Semi-supervised Adaptive Distillation

Shitao Tang, Litong Feng, Wenqi Shao, Zhanghui Kuang, Wayne Zhang, Zheng LuBMVC 2019

Abstract

Knowledge Distillation (KD) has been used in image classification for model compression. However, rare studies apply this technology on single-stage object detectors. Focal loss shows that the accumulated errors of easily-classified samples dominate the overall loss in the training process. This problem is also encountered when applying KD in the detection task. For KD, the teacher-defined hard samples are far more important than any others. We propose ADL to address this issue by adaptively mimicking the teacher's logits, with more attention paid on two types of hard samples: hard-to-learn samples predicted by teacher with low certainty and hard-to-mimic samples with a large gap between the teacher's and the student's prediction. ADL enlarges the distillation loss for hard-to-learn and hard-to-mimic samples and reduces distillation loss for the dominant easy samples, enabling distillation to work on the single-stage detector first time, even if the student and the teacher are identical. Besides, ADL is effective in both the supervised setting and the semi-supervised setting, even when the labeled data and unlabeled data are from different distributions. For distillation on unlabeled data, ADL achieves better performance than existing data distillation which simply utilizes hard targets, making the student detector surpass its teacher. On the COCO database, semi-supervised adaptive distillation (SAD) makes a student detector with a backbone of ResNet-50 surpasses its teacher with a backbone of ResNet-101, while the student has half of the teacher's computation complexity.

Introduction

Knowledge Distillation (KD) is a popular technique where a small "student" network learns to mimic a large "teacher" network. While highly successful in image classification, it has historically struggled with single-stage object detectors like RetinaNet. The primary obstacle is sample imbalance. Single-stage detectors evaluate nearly 100,000 potential object locations (anchors) per image, the vast majority of which are "easy" background samples. In standard KD, the accumulated errors from these easy samples overwhelm the loss function, drowning out the "hard" samples that contain the most useful structural information.

Methodology

To address the imbalance problem, this paper introduces two major innovations:

Adaptive Distillation Loss (ADL)

Inspired by Focal Loss, ADL adaptively weights the importance of different samples. It focuses on two types of "hard" samples:

  • Hard-to-learn: Samples where the teacher itself is uncertain (high entropy in its prediction).
  • Hard-to-mimic: Samples where there is a large gap between the teacher’s and the student’s predictions.

ADL automatically reduces the influence of easy background samples, allowing the student to focus its limited capacity on the most informative regions. Notably, this method is effective even in self-distillation scenarios where the teacher and student share the same architecture.

Semi-supervised Adaptive Distillation (SAD)

To further boost performance, the authors leverage unlabeled data through a multi-step process:

  1. Data Filtering: Since many unlabeled images may not contain relevant objects, the teacher model filters the dataset, keeping only images where it detects at least one object.
  2. Hybrid Targets: The student learns from a combination of "hard targets" (the teacher's final bounding box predictions) and "soft targets" (the teacher's underlying probability distributions).
The SAD framework overview, showing the data filtering process and the distillation between teacher and student models.

Key Results

Evaluations on the MS COCO benchmark demonstrate that SAD allows smaller, faster detectors to not only mimic but actually surpass their larger teachers.

  • Surpassing the Teacher: A student with a ResNet-50 backbone achieved 36.7 mAP, surpassing its ResNet-101 teacher (36.0 mAP).
  • Efficiency Gains: The ResNet-50 student has roughly half the computational complexity of the ResNet-101 teacher, achieving higher accuracy at a significantly faster inference speed (90ms per image).
  • Robustness: The method remains effective even when unlabeled data (e.g., ImageNet) comes from a different distribution than the labeled training set (COCO).
Performance comparison of SAD across different student-teacher configurations on the COCO dataset, highlighting the impact of ground truth (GT), soft targets (ST), and hard targets (HT).

Conclusion

Semi-supervised Adaptive Distillation (SAD) effectively solves the sample imbalance problem in single-stage detector distillation. By focusing on hard-to-learn and hard-to-mimic samples and utilizing unlabeled data, it enables the creation of highly efficient detectors that can outperform their larger counterparts. The code is available at https://github.com/Tangshitao/Semi-supervised-Adaptive-Distillation.

Summary updated

BibTeX
@inproceedings{tang2019learning,
  author = {Shitao Tang and Litong Feng and Wenqi Shao and Zhanghui Kuang and Wayne Zhang and Zheng Lu},
  title = {{Learning Efficient Detector with Semi-supervised Adaptive Distillation}},
  booktitle = {BMVC},
  year = {2019},
  url = {https://openreview.net/forum?id=6XSVuf297o},
}
Figure