Non-maximum suppression (NMS) is an indispensable post-processing step in object detection. With the continuous optimization of network models, NMS has become the ``last mile'' to enhance the efficiency of object detection. This paper systematically analyzes NMS from a graph theory perspective for the first time, revealing its intrinsic structure. Consequently, we propose two optimization methods, namely QSI-NMS and BOE-NMS. The former is a fast recursive divide-and-conquer algorithm with negligible mAP loss, and its extended version (eQSI-NMS) achieves optimal complexity of $\mathcal{O}(n\log n)$. The latter, concentrating on the locality of NMS, achieves an optimization at a constant level without an mAP loss penalty. Moreover, to facilitate rapid evaluation of NMS methods for researchers, we introduce NMS-Bench, the first benchmark designed to comprehensively assess various NMS methods. Taking the YOLOv8-N model on MS COCO 2017 as the benchmark setup, our method QSI-NMS provides $6.2\times$ speed of original NMS on the benchmark, with a $0.1\%$ decrease in mAP. The optimal eQSI-NMS, with only a $0.3\%$ mAP decrease, achieves $10.7\times$ speed. Meanwhile, BOE-NMS exhibits $5.1\times$ speed with no compromise in mAP.
翻译:非极大值抑制(NMS)是目标检测中不可或缺的后处理步骤。随着网络模型的持续优化,NMS已成为提升目标检测效率的“最后一公里”。本文首次从图论视角系统分析了NMS,揭示了其内在结构。基于此,我们提出了两种优化方法,即QSI-NMS和BOE-NMS。前者是一种快速递归分治算法,其平均精度(mAP)损失可忽略不计,其扩展版本(eQSI-NMS)达到了$\mathcal{O}(n\log n)$的最优复杂度。后者专注于NMS的局部性,在恒定级别实现了优化,且不损失mAP。此外,为了便于研究人员快速评估NMS方法,我们引入了NMS-Bench,这是首个旨在全面评估各种NMS方法的基准测试。以MS COCO 2017数据集上的YOLOv8-N模型为基准设置,我们的方法QSI-NMS在基准测试中提供了原始NMS $6.2\times$ 的加速,mAP仅下降$0.1\%$。最优的eQSI-NMS在mAP仅下降$0.3\%$的情况下,实现了$10.7\times$ 的加速。同时,BOE-NMS在mAP无损失的情况下,表现出$5.1\times$ 的加速。