Knowledge distillation (KD) for object detection typically relies on a larger, cumbersome teacher detector to train a smaller student detector. This paper flips the script by introducing a classifier-to-detector distillation framework, proving that a strong image classification model can successfully teach a compact object detector to improve both its category recognition and bounding box localization.
The Problem with Standard Distillation
To deploy object detectors on edge devices like drones or mobile phones, engineers often use Knowledge Distillation to train a small, fast "student" network using the outputs of a massive, accurate "teacher" network.
However, existing KD methods for object detection are strictly detector-to-detector. This means the teacher and student usually have to share the same architectural paradigm (e.g., a massive Faster R-CNN teaching a tiny Faster R-CNN). This is computationally expensive and highly restrictive. Furthermore, the authors noticed that the classification heads of state-of-the-art object detectors often underperform compared to dedicated image classifiers.
This raises a novel question: Can we transfer knowledge across entirely different tasks, using a standard image classifier to teach an object detector?
A Cross-Task Distillation Framework
The authors propose a framework that distills knowledge from a classification teacher (e.g., ResNet50) to a detection student (e.g., SSD or Faster R-CNN) using two complementary strategies:
-
Classification Distillation ($KD_{cls}$): The student detector's classification head learns to mimic the teacher classifier's softened probability distributions. Because different detectors use different loss functions, $KD_{cls}$ is designed to work with both categorical cross-entropy (used by Faster R-CNN/SSD) and binary cross-entropy (used by RetinaNet).
-
Localization Distillation ($KD_{loc}$): How can a classifier, which doesn't output bounding boxes, teach localization? The authors use a clever feature-matching trick. They use a differentiable Spatial Transformer Network (STN) to crop the image region corresponding to the student's predicted bounding box. They pass this crop through the classification teacher to extract intermediate feature maps. They then penalize the difference between these features and the teacher's features extracted from the ground-truth bounding box crop. If the student's bounding box is inaccurate, the features won't match.
To make this work, the classification teacher is first trained on a custom dataset ($D_{cls}$) created by cropping out all the ground-truth objects from the standard MS COCO 2017 detection training set.
Key Insights and Results
The classifier-to-detector approach yields significant performance boosts, particularly for highly compact student networks. Because the teacher is just a classifier, it acts as a "universal" teacher—it isn't tied to any specific detection architecture. The authors successfully used the exact same ResNet50 classification teacher to distill knowledge into two-stage detectors (Faster R-CNN) and one-stage detectors (SSD, RetinaNet).
- Compact Detectors: The method improved a lightweight Faster RCNN-QR50 by +3.9 mAP (from 23.3 to 27.2) and an SSD300 by +2.3 mAP (from 25.6 to 27.9).
- Complementary Error Reduction: The two distillation losses target different failure modes. $KD_{cls}$ primarily reduces classification errors (boosting Average Precision at lower IoU thresholds), while $KD_{loc}$ forces tighter bounding boxes (boosting Average Precision at strict, high IoU thresholds).
- Outperforming Standard KD: On compact models, this method outperformed state-of-the-art detector-to-detector distillation methods by ~1.0 mAP, despite using a simpler teacher.
- Orthogonal Benefits: The method can be stacked with existing detector-to-detector KD techniques. When combined with a state-of-the-art detector KD method (FKD), a Faster RCNN-R50 student improved from 38.4 mAP to 41.9 mAP, achieving state-of-the-art distilled performance.
Limitations and Future Work
While the method provides massive gains for highly compact networks (like MobileNet-based detectors), the standalone improvement shrinks when applied to larger student networks (like Faster R-CNN with a standard ResNet50 backbone). However, it still provides a notable boost when combined with traditional KD.
Ultimately, this research opens the door to a broader paradigm of cross-task distillation. Future work could explore transferring knowledge between other distinct computer vision tasks, reducing the need to train specialized, massive teacher models for every specific niche application.
Summary updated