Bridging Cross-task Protocol Inconsistency for Distillation in Dense Object Detection

Longrong Yang, Xianpan Zhou, Xuewei Li, Liang Qiao, Zheyang Li, Ziwei Yang, Gaoang Wang, Xi Li · DOI

Abstract

Knowledge Distillation (KD) has become a cornerstone for compressing large-scale models into efficient architectures. However, in the realm of dense object detection, a fundamental "protocol inconsistency" exists between standard distillation practices and the operational requirements of detectors. While traditional KD relies on the Softmax function (relative probabilities), dense detectors utilize the Sigmoid function (absolute scores) to manage extreme class imbalance. This paper introduces Binary Classification Distillation (BCKD) and IoU-based Localization Distillation (ILKD) to bridge this gap. These methods achieve significant performance gains—up to +3.4 mAP on MS COCO—across various architectures without increasing inference costs.

Introduction

Dense object detectors, such as FCOS and RetinaNet, are designed to predict object categories and bounding box locations at nearly every pixel or anchor point. Due to the overwhelming prevalence of background samples in these dense grids, these models typically employ the Sigmoid function to produce independent confidence scores for each category.

Despite the success of Knowledge Distillation in image classification, its direct application to dense detection is hindered by a mismatch in classification protocols. Traditional KD methods often adopt the Softmax-based approach used in classification tasks. This paper identifies this as a "cross-task protocol inconsistency" that limits the effectiveness of the student model's learning process. By realigning the distillation loss with the detector's native Sigmoid protocol, we can significantly improve the transfer of knowledge from teacher to student.

The Protocol Inconsistency Problem

In standard image classification, Softmax turns model outputs into a probability distribution that sums to 1.0. This works well for identifying a single dominant class in a cropped image. However, in dense detection, the absolute classification scores are critical for distinguishing between foreground objects and background noise.

Softmax-based distillation focuses on the relative relationship between classes but ignores the absolute magnitude of the scores. Consequently, a student model might mimic a teacher's relative distribution perfectly while predicting absolute scores that are far too low or high, leading to poor detection performance. Furthermore, existing localization distillation methods often require specific, complex network "heads," which limits their portability across different detector architectures.

Proposed Methodology

To address these challenges, we propose two primary distillation components:

1. Binary Classification Distillation (BCKD)

Instead of treating classification as a single multi-class problem via Softmax, BCKD treats it as $K$ independent binary classification problems. By using the Sigmoid protocol for both the teacher and the student during the distillation process, the student learns to preserve the absolute score dynamics of the teacher. To further enhance this, we implement an importance weighting strategy inspired by Focal Loss. This strategy forces the student to prioritize learning from samples where its predictions deviate most significantly from the teacher’s, ensuring efficient knowledge transfer in the presence of massive class imbalance.

2. IoU-based Localization Distillation (ILKD)

Previous state-of-the-art methods for localization distillation required models to output discrete probability distributions for bounding box coordinates. We simplify this by introducing a "structure-free" approach. ILKD directly computes the Intersection over Union (IoU) between the teacher’s and student’s predicted boxes. This geometric signal is sufficient for the student to learn accurate localization, and because it does not rely on specific output formats, it can be applied to any detector architecture.

Experimental Results

We evaluated the proposed method on the MS COCO 2017 and Pascal VOC benchmarks. Our results demonstrate that BCKD and ILKD consistently outperform existing logit-based distillation methods.

  • Performance Gains: On MS COCO, a ResNet-50 student model distilled from a ResNet-101 teacher improved from 40.1 mAP to 43.2 mAP (+3.1).
  • Architectural Versatility: The method is effective across diverse backbones. For instance, a MobileNetV2 student saw an improvement from 32.6 to 35.1 mAP. It also showed strong results when applied to Swin Transformers.
  • Synergy with Feature Distillation: When combined with existing feature-based distillation methods like MGD or PKD, BCKD provided an additive boost, reaching 40.2 mAP on RetinaNet.
  • Self-Distillation: Interestingly, the method provides gains even when a model distills knowledge to itself (Self-KD), suggesting that these losses serve as superior regularizers compared to standard training objectives.

Conclusion

By identifying and resolving the cross-task protocol inconsistency in dense object detection, we provide a more effective framework for knowledge distillation. The combination of Sigmoid-based classification distillation (BCKD) and structure-free localization distillation (ILKD) allows for significant performance improvements across a wide range of detectors. Future work will explore the application of these consistent protocols to sparse detectors (like Faster R-CNN) and newer architectures such as Detection Transformers (DETR).

Summary updated

BibTeX
@misc{yang2023bridging,
  author = {Longrong Yang and Xianpan Zhou and Xuewei Li and Liang Qiao and Zheyang Li and Ziwei Yang and Gaoang Wang and Xi Li},
  title = {{Bridging Cross-task Protocol Inconsistency for Distillation in Dense Object Detection}},
  year = {2023},
  eprint = {2308.14286},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.14286},
}
Figure