Accelerating Non-Maximum Suppression: A Graph Theory Perspective

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.

Paper

References (47)

Scroll for more · 35 remaining

Similar papers

Peer review

Reviewer HR1f5/10 · confidence 4/52024-07-12

Summary

The article "Accelerating Non-Maximum Suppression: A Graph Theory Perspective" explores a novel way to optimize Non-Maximum Suppression (NMS) in object detection using graph theory. The authors present two new methods, QSI-NMS and BOE-NMS, which greatly enhance the efficiency of NMS while maintaining mean Average Precision (mAP). They also introduce NMS-Bench, a benchmarking framework designed to evaluate different NMS methods effectively.

Strengths

- This article brings an interesting and fresh perspective to NMS by applying graph theory. - The proposed QSI-NMS and BOE-NMS algorithms show impressive improvements in computational efficiency, with QSI-NMS achieving up to 10.7× speedup and BOE-NMS achieving 5.1× speedup, all without sacrificing mean Average Precision (mAP). - One of the standout contributions is NMS-Bench, a benchmarking framework that standardizes the evaluation of NMS algorithms, potentially driving further advancements in the field. - Additionally, the paper provides a detailed analysis of the intrinsic structure of NMS through the lens of graph theory, offering valuable insights into its computational bottlenecks and optimization strategies.

Weaknesses

1. In section 5.2 Results, we can find QSI-NMS operates with some performance decrease, and the paper doesn't thoroughly discuss what aspects of the algorithm might be causing this decline (maybe missing some data but exactly what is missed). 2. The connection between the proposed methods and graph theory appears weak. QSI-NMS is essentially a quicksort-based algorithm, and the size of the weakly connected components (WCC) or their independence doesn't seem to significantly impact its performance. BOE-NMS, on the other hand, introduces a heuristic for the search space, which doesn't strongly tie into graph theory principles either. 3. Regarding eQSI-NMS, there are questions about the clarity and effectiveness of the methods. The pseudo-code in Appendix E.2 is difficult to understand, and there might be an issue with the line "for s ∈ S do s ← −s;" in eQSI-NMS. It’s unclear how this part of the code functions and whether it introduces any problems. 4. The evaluation is primarily limited to the YOLOv8-N model on the MS COCO 2017 dataset. To gain a more comprehensive understanding of the algorithms' generalizability, broader evaluations across various models and datasets would be beneficial.

Questions

see weakness part for details

Rating

5

Confidence

4

Soundness

3

Presentation

2

Contribution

3

Limitations

delineate the constraints of their proposed method in the paper.

Reviewer kDQX5/10 · confidence 3/52024-07-13

Summary

The paper, "Accelerating Non-Maximum Suppression: A Graph Theory Perspective," presents a novel approach to enhancing the efficiency of the Non-Maximum Suppression (NMS) algorithm used in object detection. By analyzing NMS through graph theory, it introduces two new optimization methods: Quicksort Induced NMS (QSI-NMS) and Boxes Outside Excluded NMS (BOE-NMS). These methods leverage the structure of weakly connected components in a graph to reduce computational complexity and speed up the process, with minimal impact on the mean Average Precision (mAP). The paper also introduces NMS-Bench, a benchmarking framework to evaluate NMS methods rapidly.

Strengths

1. Innovative Approach: The paper applies graph theory to optimize NMS, a critical post-processing step in object detection, demonstrating significant improvements in computational efficiency. 2. Comprehensive Evaluation: It includes a robust evaluation using the newly developed NMS-Bench, providing detailed comparisons of performance improvements over traditional methods. 3. Practical Impact: The proposed methods, particularly eQSI-NMS, offer substantial speed increases with minimal loss in accuracy, which is highly beneficial for real-time object detection applications.

Weaknesses

1. Complexity of Graph-Theoretical Analysis: The paper's reliance on graph theory might limit its accessibility to those without a background in this area. The proofs and theoretical explanations are dense and could be challenging to follow for non-specialists. 2. Limited Discussion on Scalability: While the paper shows efficiency improvements, it does not extensively discuss the scalability of the proposed methods across different hardware or larger datasets beyond those tested. 3. Dependency on Specific Conditions: The effectiveness of the proposed methods may depend heavily on the characteristics of the data and the specific architectures of the detection systems used, which may not generalize well to all types of object detection tasks.

Questions

1. Details on Graph Construction (Line 99-104): The paper mentions the construction of graph G using bounding boxes and suppression relationships. Could you elaborate on the computational overhead of this graph construction process and its impact on the overall efficiency of NMS? 2. Experimental Setup (Line 260-265): The results presented are impressive; however, could more information be provided on how the different configurations of bounding boxes were handled during the experiments, especially concerning their distribution and density? 3. Proof of Theorem 1 (Line 510-520): Could you clarify how the dynamic programming approach adapts to variations in graph structure, particularly for non-standard configurations of bounding boxes?

Rating

5

Confidence

3

Soundness

3

Presentation

3

Contribution

2

Limitations

Complexity for Non-Specialists: The application of graph theory to optimize the Non-Maximum Suppression (NMS) process introduces complex mathematical concepts and proofs that might not be easily accessible or understandable for practitioners or researchers without a background in graph theory. This complexity could limit the broader application and adaptation of the proposed methods in the field. Dependence on Data Characteristics: The effectiveness of the proposed QSI-NMS and BOE-NMS methods is highly dependent on the specific characteristics of the data, such as the distribution and density of bounding boxes. This dependency might restrict the generalizability of the methods across different object detection tasks and datasets where these characteristics vary significantly.

Reviewer snSe6/10 · confidence 4/52024-07-15

Summary

This paper presents a method from a new perspective to enhance the efficiency of the Non-Maximum Suppression (NMS) algorithm with affordable accuracy decrease. The authors introduce a novel perspective by analyzing NMS through the lens of graph theory, revealing its intrinsic structure as a directed acyclic graph. This insight leads to the development of two NMS optimization methods: QSI-NMS and BOE-NMS. Furthermore, the authors also introduce NMS-Bench, an end-to-end benchmark that facilitates rapid and comprehensive validation of various NMS algorithms.

Strengths

(1)The paper innovatively applies graph theory to NMS, offering a detailed theoretical basis for the proposed QSI-NMS and BOE-NMS algorithms, which excel in enhancing speed while preserving accuracy. (2)The experimental results does support the effectiveness of the efficiency of the proposed algorithm. (3)The construction of the benchmark is a solid contribution to the community. (4)The paper offers a new perspective and tool for understanding and optimizing the NMS step in object detection.

Weaknesses

(1)A case study that illustrate the overly suppressed samples is welcomed. (2) How was the average latency calculated, more information if preferred. This is not clear. (3) How is the performance of the proposed algorithm on the Yolo V10 and mask RCNN. (4) Although the proposed method is tested on the proposed NMS-Bench, experimental results in detection bench-mark algorithms are still prefered.

Questions

(1) How was the average latency calculated, more information if preferred. Please report the time of graph construction and the time of NMS, respectively. (2) How is the performance of the proposed algorithm on the Yolo V10 and mask RCNN.

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

The effectiveness of the proposed should be evaluated on more real world cases. More detailed analysis of which kinds of samples are miss detected by the algorithm is missing.

Reviewer pEVt6/10 · confidence 2/52024-07-18

Summary

This work focuses on improving the latency of Non-Maximum Suppression (NMS), a crucial step for nearly all object detectors. The work analyzes NMS, as a directed acyclic graph (DAG) treating bounding boxes as nodes, and suppression relationships as arcs allowing NMS solutions based on dynamic programming. Based on this graph interpreation, the work proposes two new approximate versions of NMS, named QSI-NMS, and BOE-NMS with different precision v/s latency tradeoffs. Finally, the proposed NMS approaches are evaluated on a new benchmark NMS-bench, showing improved latency with little to no mAP loss.

Strengths

1. The paper is written adequately, and offers a new graph theory perspective for non-maximum suppression, further exploring avenues for new research in the area. 2. The proposed approaches show improved latency compared to other NMS approaches including original (greedy NMS), Fast NMS and Cluster NMS, while maintaining mAP. This is achieved without fine-tuning the underlying model.

Weaknesses

1. The paper does not compare against (or even cite) other approximations to NMS proposed in the literature such as MaxPoolNMS[1], PSRR-MaxpoolNMS [2] or ASAP-NMS [3]. It's unclear how the contribution, and performance of proposed approximations differs from the literature. For example, the idea behind BOE-NMS, using locality b/w suppression relationships is already explored in the above works. 2. Can this approach be utilized for two-stage object detectors as well for both stages of NMS? The proposed benchmark only applies the methods this for single-stage object detectors, it's unclear how the method performs on single stage detectors. [1] Cai, Lile, et al. "Maxpoolnms: getting rid of nms bottlenecks in two-stage object detectors." _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_. 2019. [2] Zhang, Tianyi, et al. "Psrr-maxpoolnms: Pyramid shifted maxpoolnms with relationship recovery." _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_. 2021. [3] Tripathi, Rohun, et al. "Asap-nms: Accelerating non-maximum suppression using spatially aware priors." _arXiv preprint arXiv:2007.09785_ (2020).

Questions

1. The worst case complexity of the proposed approaches is still O(n log n), while other approaches, stated above claim O(n) complexity. Does this imply the other approaches scale better?

Rating

6

Confidence

2

Soundness

3

Presentation

2

Contribution

2

Limitations

The work does an adequate job of discussing the limitations of the proposed work.

Reviewer pEVt2024-08-11

Official Response

I thank the authors for their detailed response. My main concern regarding comparison with prior work, especially PSRR-MaxPoolNMS has been partially addressed in the rebuttal. The proposed work provides a new perspective for NMS using graph theory, and the best method offered eQSI-NMS offers improved latency, while it's still unclear how much it trades-off in terms of performance compared to PSRR-MaxPoolNMS. I've improved my rating, as my perception of the paper has improved. I would still like to see detailed mAP comparison on NMS-bench against PSRR-MaxPoolNMS. If the authors have implemented the algorithm, I don't see why mAP performance has not been reported in the rebuttal for PSSR-MaxPoolNMS?

Authorsrebuttal2024-08-11

We sincerely appreciate the time and effort you have invested in reviewing our rebuttal, and we are pleased that our response has addressed your main concern. We are also more than happy to provide a comparison of the mAP performance comparison between our methods and PSRR-MaxpoolNMS. We apologize for being unable to fully present this in the rebuttal, as we had reached the character limit. We tested anchor-based models (Faster R-CNN, YOLOv5) where PSRR-MaxpoolNMS is applicable, using the MS COCO dataset. Please see the results in the tables below. Table 1: Faster R-CNN R50-FPN (average #bounding boxes: 251) ||Original NMS|PSRR-MaxpoolNMS|BOE-NMS|QSI-NMS|eQSI-NMS| | ---------------- | ------------ | ---- | ------- | ------- | -------- | | mAP(%) |39.8| 37.5 | 39.8 | 39.5 | 39.3 | | latency($\mu s$) |53.0| 89.0 | 43.1 | 34.3 | 24.6 | Table 2: Faster R-CNN R101-FPN (average #bounding boxes: 236) ||Original NMS|PSRR-MaxpoolNMS|BOE-NMS|QSI-NMS|eQSI-NMS| | ---------------- | ------------ | ---- | ------- | ------- | -------- | | mAP(%)|41.8|39.5|41.8|41.5|41.4| | latency($\mu s$)|45.5|86.4|38.6|31.9|23.0| Table 3: Faster R-CNN X101-FPN (average #bounding boxes: 214) || Original NMS | PSRR-MaxpoolNMS | BOE-NMS | QSI-NMS | eQSI-NMS | | ---------------- | ------------ | --------------- | ------- | ------- | -------- | | mAP(%)| 43.0| 40.5| 43.0| 42.7| 42.5| | latency($\mu s$) | 37.0| 86.9| 33.4| 28.6| 20.6| Table 4: YOLOv5-N (average #bounding boxes: 2898) || Original NMS | PSRR-MaxpoolNMS | BOE-NMS | QSI-NMS | eQSI-NMS | | ---------------- | ------------ | --------------- | ------- | ------- | -------- | | mAP(%)| 27.8| 26.5| 27.8| 27.5|27.4| | latency($\mu s$)|8568.5| 599.6| 906.2|628.0|325.6| Table 5: YOLOv5-S (average #bounding boxes: 1974) | | Original NMS | PSRR-MaxpoolNMS | BOE-NMS | QSI-NMS | eQSI-NMS | | ---------------- | ------------ | --------------- | ------- | ------- | -------- | | mAP(%) | 37.2| 35.6 | 37.2 | 36.9 | 36.6 | | latency($\mu s$) | 3858.2 | 409.4 | 547.7 | 408.2 | 217.5 | Table 6: YOLOv5-M (average #bounding boxes: 1810) | | Original NMS | PSRR-MaxpoolNMS | BOE-NMS | QSI-NMS | eQSI-NMS | | ---------------- | ------------ | --------------- | ------- | ------- | -------- | | mAP(%)| 45.1 | 43.1 | 45.1 | 44.9 | 44.5 | | latency($\mu s$) | 2918.1| 380.5 | 424.7 | 371.3 | 197.4| As you can see, eQSI-NMS achieves the lowest latency while maintaining a favorable trade-off with mAP. However, PSRR-MaxpoolNMS experiences a $1–2$% mAP accuracy loss in both the Faster R-CNN and YOLOv5 models. This is likely due to the following reasons: 1. Some hyperparameters need adjustment when using the MS COCO dataset, as MS COCO is more complex compared to PASCAL VOC, with a richer variety of categories and broader scenes. Therefore, the number of scales and ratios may need to be increased to suit the MS COCO dataset. In contrast, our proposed methods do not require additional parameters beyond those used in Original NMS, making them more applicable to general cases. 2. The PSRR-MaxpoolNMS paper does not mention how the input image size and the settings of $W$ and $H$ in PSRR-MaxpoolNMS are determined. In our implementation, we set this to $640 \times 640$ to accommodate all images in the MS COCO dataset. This might affect accuracy, though we believe the impact is minimal. This also indicates that our method offers better generalizability. In the case of Faster R-CNN, the latency performance of PSRR-MaxpoolNMS is not competitive. This is because PSRR-MaxpoolNMS requires 8 maxpooling operations, which, although not affecting the algorithm's complexity, introduces a large constant factor that hampers efficiency when the number of bounding boxes is small (e.g., the average number of bounding boxes in the three Faster R-CNN models is less than 300). However, it performs well when the number of bounding boxes is large (e.g., YOLOv5-S has an average of 2898 bounding boxes). This demonstrates that the speedup of PSRR-MaxpoolNMS is highly dependent on the degree of parallelism, whereas our method directly reduces computational overhead (see Figure 6 in Appendix D.3), making it hardware-agnostic and suitable for resource-constrained edge devices. In summary, the limitations of PSRR-MaxpoolNMS in improving efficiency while balancing accuracy are significant. In contrast, our method, which uses the same inputs and parameters as Original NMS, is a plug-and-play algorithm that can directly replace Original NMS. To demonstrate this, we implemented our method in the torchvision library and compared it with the highly parallel CUDA NMS [1], where our method exhibited significant superiority (see Table 7 in Appendix D.3). Thanks again for the time you invested in writing your comments. We hope this response can thoroughly address your concern. --- [1] TorchVision maintainers and contributors. TorchVision: PyTorch’s Computer Vision library, November 2016.

Reviewer pEVt2024-08-12

Official Response

Thank you for the detailed response addressing my concerns. I've increased my rating accordingly.

Reviewer snSe2024-08-12

Comments

Thanks for the detailed responses and additional experiments, which solve my concerns and questions.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC