DHS-DETR: Efficient DETRs with Dynamic Head Switching

Hang Chen,Chufeng Tang,Xiaolin Hu
DOI: https://doi.org/10.1016/j.cviu.2024.104106
IF: 4.886
2024-01-01
Computer Vision and Image Understanding
Abstract:Detection Transformer (DETR) and its variants have emerged anew paradigm to object detection, but their high computational cost hinders practical applications. By investigating their essential components, we found that the transformer-based head usually occupies a significant amount of computation. Through further comparing heavy and light transformer heads, we observed that both heads produced satisfactory results for easy images while showing a noticeable difference for hard images. Inspired by these findings, we propose a dynamic head switching (DHS) strategy to dynamically select the proper head for each image at inference for a better balance of efficiency and accuracy. Specifically, our DETR model incorporates multiple heads with different computational complexity and a lightweight module which selects proper heads for given images. This module is optimized to maximize detection accuracy while adhering to the overall computational budget limitations. To minimize the potential accuracy drop when executing the lighter heads, we propose online head distillation (OHD) to improve the accuracy of the lighter heads with the help of the heavier head. Extensive experiments on the MS COCO dataset validated the effectiveness of the proposed method, which demonstrated abetter accuracy-efficiency trade-off compared to the baseline using static heads.
What problem does this paper attempt to address?