Dynamic neural network is an emerging research topic in deep learning. With adaptive inference, dynamic models can achieve remarkable accuracy and computational efficiency. However, it is challenging to design a powerful dynamic detector, because of no suitable dynamic architecture and exiting criterion for object detection. To tackle these difficulties, we propose a dynamic framework for object detection, named DynamicDet. Firstly, we carefully design a dynamic architecture based on the nature of the object detection task. Then, we propose an adaptive router to analyze the multi-scale information and to decide the inference route automatically. We also present a novel optimization strategy with an exiting criterion based on the detection losses for our dynamic detectors. Last, we present a variable-speed inference strategy, which helps to realize a wide range of accuracy-speed trade-offs with only one dynamic detector. Extensive experiments conducted on the COCO benchmark demonstrate that the proposed DynamicDet achieves new state-of-the-art accuracy-speed trade-offs. For instance, with comparable accuracy, the inference speed of our dynamic detector Dy-YOLOv7-W6 surpasses YOLOv7-E6 by 12%, YOLOv7-D6 by 17%, and YOLOv7-E6E by 39%. The code is available at https://github.com/VDIGPKU/DynamicDet.
翻译:动态神经网络是深度学习中的一个新兴研究课题。通过自适应推理,动态模型能够实现卓越的准确性和计算效率。然而,由于缺乏适用于目标检测的动态架构和退出准则,设计强大的动态检测器颇具挑战。为解决这些困难,我们提出了一种名为DynamicDet的目标检测动态框架。首先,我们基于目标检测任务的本质精心设计了动态架构。然后,我们提出了一种自适应路由器,用于分析多尺度信息并自动决定推理路径。我们还提出了一种新颖的优化策略,该策略基于检测损失为动态检测器设计了退出准则。最后,我们提出了一种变速推理策略,仅需一个动态检测器即可实现广泛的速度-精度权衡。在COCO基准上的大量实验表明,所提出的DynamicDet实现了新的最先进的速度-精度权衡。例如,在精度相当的情况下,我们的动态检测器Dy-YOLOv7-W6的推理速度分别比YOLOv7-E6、YOLOv7-D6和YOLOv7-E6E快12%、17%和39%。代码已开源在https://github.com/VDIGPKU/DynamicDet。