Optimized non-maximum suppression method
By introducing a dynamic threshold strategy related to diagonal distance and confidence and optimizing the non-maximum suppression method, the problem of insufficient spatial structure distinction ability of traditional methods is solved, more stable and efficient bounding box screening is achieved, and the performance and robustness of target detection are improved.
Patent Information
- Application Number
- CN202510579929.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-09-19
AI Technical Summary
Traditional non-maximum suppression methods ignore the potential distinguishing ability of bounding boxes in the spatial structure dimension in target detection, especially performing poorly in dense target scenes. The fixed IoU threshold is not adaptable enough, resulting in the false suppression of redundant candidate boxes, which weakens detection performance and robustness.
A dynamic threshold strategy related to the spatial distance decay rate and confidence based on diagonal distance is introduced to construct an adaptive suppression mechanism. The bounding boxes are screened through a competition mechanism in the continuous probability space, and differentiated suppression is performed in combination with confidence.
The adaptability and robustness of target detection are improved, the false suppression rate of redundant frames is significantly reduced, and the detection accuracy and stability are improved.
Smart Images

Figure CN120673023A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of target detection, and in particular relates to an optimized non-maximum suppression method. Background Art
[0002] Non-Maximum Suppression (NMS), a key post-processing step in object detection frameworks, is a greedy selection strategy based on the intersection over union (IoU) of bounding boxes. It aims to improve target localization accuracy by suppressing redundant candidate boxes. However, traditional NMS methods rely heavily on IoU as an overlap criterion, which has the following drawbacks:
[0003] 1. It ignores the potential distinguishing ability of bounding boxes in spatial structural dimensions (such as scale, position, and shape). 2. It performs poorly in dense target scenes (such as crowd detection). 3. The fixed IoU threshold is not adaptable enough when dealing with multi-scale and highly overlapping target distributions. 4. It is easy to cause the false suppression of valid candidate boxes, thereby weakening the overall detection performance and robustness.
[0004] To address these problems, the present invention proposes an optimized non-maximum suppression method ASA-NMS, which provides a more stable and robust bounding box screening solution by introducing a dynamic threshold strategy related to the spatial distance decay rate based on diagonal distance and confidence. Summary of the Invention
[0005] This paper explores the improvement and optimization of NMS from the perspective of spatial scale and dynamic threshold, proposes an optimized non-maximum suppression method, and provides a more stable and robust bounding box suppression scheme, thereby improving the detection performance of the model.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] This paper proposes an optimized non-maximum suppression method. Compared to the original NMS method, it introduces a spatial distance decay rate based on diagonal distance, transforming the original binary decision strategy into a competitive mechanism in a continuous probability space. This structurally breaks the limitations of the IoU paradigm and provides a more stable and robust bounding box screening solution. Furthermore, ASA-NMS incorporates a dynamic threshold strategy related to confidence, achieving differentiated suppression of duplicate bounding boxes and effectively improving the adaptive capabilities of detection.
[0008] The steps are as follows:
[0009] S1: The detection model generates predicted candidate bounding boxes and performs post-processing through non-maximum suppression;
[0010] S2: Select the bounding box b with the highest current confidence score from the candidate bounding box set m , and add it to the final retained prediction box set result;
[0011] S3: record the bounding box b with the highest score m The diagonal distance width is used as the reference scale for subsequent normalization calculations;
[0012] S4: Traverse the remaining bounding boxes b in the set in turn i , calculate b i with b m The diagonal distance d between the spaces diag , the distance attenuation probability p, and the confidence-weighted suppression score ASS, and finally decide whether to suppress through the dynamic threshold mechanism;
[0013] S5: If the bounding box b i If the weighted suppression score ASS of is higher than the current dynamic threshold thr, it is determined to be a redundant box and removed from the candidate set B. The above process will continue to iterate until all candidate boxes are processed.
[0014] Furthermore, the non-maximum suppression method in the above S1 is as follows:
[0015] S1: Using the distance between two points, first calculate the bounding box b with the highest confidence score for the current classification m and the remaining bounding box b i The diagonal distance between the two boxes is the sum of the distance between their upper left corners and the distance between their lower right corners:
[0016] d diag =||(L i -L m )||2+||(R i -R m )||2 (1)
[0017] Among them, L represents the coordinate of the upper left corner of the bounding box, R represents the coordinate of the lower right corner, and d diag represents the sum of the diagonal distances of two bounding boxes;
[0018] S2: The diagonal distance is then normalized by the diagonal length of the highest scoring bounding box to obtain the relative scale distance:
[0019]
[0020] In formula (2), through normalization, the absolute spatial distance is converted into a relative distance that is independent of the target scale, thereby realizing a scale-adaptive distance measurement mechanism. This method allows for greater positional deviations to be tolerated for large-scale targets, while effectively avoiding over-suppression for small-scale targets. To further characterize the spatial proximity relationship between predicted boxes and the possibility that they belong to the same target, an exponential function is introduced to map the normalized distance to the corresponding distance decay probability:
[0021] p(b m |b i )=exp(-d norm ) (3)
[0022] In formula (3), the distance decay probability p can be regarded as the candidate bounding box b i With the highest scoring bounding box b m The confidence correlation between the two objects belonging to the same target. When the normalized spatial distance between the two is close, it means that they are likely repeated detections of the same target, and the distance decay probability p is close to 1. In this case, the suppression strength of the current bounding box should be reduced. Conversely, if the two objects are far apart, the distance decay probability p approaches 0, indicating that they may belong to different targets, and the confidence decay strength should be increased.
[0023] S3: Combine the distance decay probability p with the confidence score s of the candidate bounding box itself i The adaptive suppression score ASS is constructed by fusion, which is as follows:
[0024] ASS i =s i ·p i (4)
[0025] The original intention of this fusion strategy is that the confidence of the bounding box reflects the model's confidence that the region belongs to a certain category of object, while the suppression probability describes the likelihood that it spatially belongs to the same object as the selected bounding box. By combining these two, it not only preserves the strength of semantic information but also introduces the ability to dynamically control spatial proximity.
[0026] S4: Adaptive risk-aware threshold method, extracts the classification confidence score of the current optimal bounding box to generate an adaptive threshold, the specific form is as follows:
[0027] thr=1-exp(-α·s m ) (4)
[0028] Among them, the risk coefficient of a candidate box is used to measure the risk of misjudgment that may result from performing a suppression operation on the candidate box, and the confidence level is regarded as a signal of the model's perception of the uncertainty of the current prediction result. When a candidate box has a high confidence level, it indicates that the model has a high degree of confirmation of the prediction result, and the probability of its adjacent redundant boxes being misjudged as targets is low. Therefore, in this case, it is appropriate to adopt a stricter suppression threshold to enhance the effect of duplicate box suppression and reduce the occurrence of false positives. Correspondingly, when the confidence level of a candidate box is low, it indicates that the model has a high degree of uncertainty about the prediction result, and its adjacent candidate boxes are more likely to contain true targets. In this case, to avoid false suppression of true targets, the suppression strategy should be appropriately relaxed, that is, a looser threshold should be adopted to effectively reduce the risk of false negatives.
[0029] Through the above-mentioned confidence-driven risk perception mechanism, dynamic adjustment of the suppression strategy is achieved, which not only improves the redundant frame filtering capability but also takes into account the accuracy and robustness of target detection.
[0030] The above technical solution can achieve the following beneficial effects:
[0031] The proposed method is simple and effective. As a novel non-IoU suppression strategy, ASA-NMS can be directly embedded into mainstream detection frameworks without modifying the detector architecture or retraining. Furthermore, its adaptive suppression threshold mechanism demonstrates great potential for risk control, providing an effective new paradigm for improving object detection robustness.
[0032] Spatial distance-aware similarity measurement mechanism: This mechanism introduces the bounding box diagonal distance instead of the traditional IoU metric. This is normalized using the diagonal length of the current optimal box to construct a scale-adaptive spatial distance attenuation probability, effectively improving the ability to distinguish objects of different scales.
[0033] Confidence-guided weighted suppression strategy: The spatial distance decay probability is multiplied by the candidate box confidence to form a weighted suppression score, which effectively finds the redundant boxes of the occluded target and reasonably distinguishes them from the bounding boxes of other targets, significantly reducing false suppression.
[0034] Confidence-based dynamic suppression mechanism: A dynamic threshold strategy related to confidence is introduced to adaptively adjust the suppression strength according to the confidence of the candidate box, making high-confidence boxes more likely to be retained when overlapping, enhancing the stability and flexibility of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is the ASA pseudocode flow chart.
[0036] Figure 2 This is a sample test result graph on the CrowdHuman dataset.
[0037] Figure 3 This is a sample test result diagram on the PASCAL VOC dataset.
[0038] Figure 4 It is a graph of the sensitivity results of hyperparameters α and γ.
[0039] Figure 5 It is a component of the non-maximum suppression method. DETAILED DESCRIPTION
[0040] The following is combined with Figure 1-4 The present invention will be further described:
[0041] Figure 1 and Figure 5 An optimized non-maximum suppression method is shown. The method uses the spatial distance decay rate based on diagonal distance to transform the original binary decision strategy into a competition mechanism in a continuous probability space to optimize the positioning of duplicate bounding boxes. The suppression method is as follows:
[0042] The distance between two points can be expressed by formula (1):
[0043]
[0044] The coordinates b of each predicted box i You can use the upper left corner L i (x1 i ,y1 i ) and the lower right corner R i (x2 i ,y2 i ) coordinate representation.
[0045] Propose any two bounding boxes b m and b i The diagonal distance between the two boxes is the sum of the distance between the upper left corners and the distance between the lower right corners. As shown in formula (2):
[0046] d diag =||(L i -L m )||2+||(R i -R m )||2 (2)
[0047] Among them, L represents the coordinate of the upper left corner of the bounding box, R represents the coordinate of the lower right corner, and d diag represents the sum of the diagonal distances of two bounding boxes;
[0048] The diagonal distance is then normalized by the diagonal length of the highest scoring bounding box to obtain the relative scale distance, as shown in formula (3):
[0049]
[0050] To further measure the spatial proximity between predicted boxes and the probability that they belong to the same target, we use an exponential function to map the normalized distance to the distance decay probability, as shown in formula (4):
[0051] p(b m |b i )=exp(-d norm ) (4)
[0052] On this basis, the distance decay probability p is further combined with the confidence score of the candidate bounding box itself to construct the adaptive suppression score (ASS), as shown in formula (5):
[0053] ASS i =s i ·p i (5)
[0054] We model the suppression strategy as a risk control process, thr according to the confidence s of the optimal candidate box of the current detection object m Generate an adaptive threshold as shown in formula (6):
[0055] thr=1-exp(-α·s m ) (6)
[0056] Figure 1 The specific method is as follows:
[0057] S1: The detection model generates predicted candidate bounding boxes and performs non-maximum suppression for post-processing;
[0058] S2: Select the bounding box b with the highest current confidence score from the candidate bounding box set m , and add it to the final retained prediction box set result;
[0059] S3: record the bounding box b with the highest score m The diagonal distance width is used as the reference scale for subsequent normalization calculations;
[0060] S4: Traverse the remaining bounding boxes b in the set in turn i , calculate b i with b m The diagonal distance d between the spaces diag , the distance attenuation probability p, and the confidence-weighted suppression score ASS, and finally decide whether to suppress through a dynamic threshold mechanism.
[0061] S5: If bi If the weighted suppression score ASS of is higher than the current dynamic threshold thr, it is determined to be a redundant box and removed from the candidate set B. The above process will continue to iterate until all candidate boxes are processed.
[0062] Dataset selection:
[0063] The CrowdHuman dataset is a benchmark dataset for evaluating the performance of pedestrian detection algorithms in crowd scenes. It provides annotations for full body, visible body, and head information. It consists of 24,370 images, with an average of 22.6 people per image, 15,000 training images, 4,370 validation images, and 5,000 test images. The PASCAL VOC2012 dataset is a public dataset for object detection and image segmentation tasks. It consists of 23,080 images in 20 categories, 5,717 training images, 5,823 validation images, and 11,540 test images. AP calculations are obtained using the COCO-style evaluation metric via the standard COCO API, using default settings, including a maximum of 100 detections per image.
[0064] Comparison of experimental results:
[0065] To verify the effectiveness and applicability of the adaptive spatially aware non-maximum suppression method proposed in this paper for object detection, a comparative experiment was conducted in two self-trained object detection models. Specifically, the traditional non-maximum suppression (NMS) module was replaced with the Soft-NMS algorithm, the Confluence algorithm, and the proposed ASA-NMS algorithm. While maintaining the same experimental settings, the effects of each alternative on object detection performance were compared and analyzed.
[0066] In this embodiment, Faster R-CNN and RetinaNet are selected as the basic object detector models. Faster R-CNN uses ResNet-101 as the backbone network and is trained on the CrowdHuman dataset, with the default NMS threshold set to 0.5; RetinaNet uses ResNet-50 as the backbone network and is trained on the PASCAL VOC 2012 dataset, with the default NMS threshold also set to 0.5.
[0067] In each of the two detector frameworks mentioned above, the ASA-NMS algorithm was integrated to replace the original NMS module. Systematic testing under different model architectures and datasets evaluated the performance of ASA-NMS on object detection performance metrics such as precision, recall, and miss rate.
[0068] Table 1 shows the performance of Faster RCNN+ASA-NMS and Faster RCNN+Confluence / Soft-NMS / NMS on the CrowdHuman dataset. Table 2 shows the performance of RetinaNet+ASA-NM and RetinaNet+Confluence / Soft-NMS / NMS on the PASCAL VOC dataset.
[0069] Figure 2 、 Figure 3 This figure shows a comparison between the detection model plus ASA-NMS and detection plus NMS. The dashed boxes in the figure represent objects missed by NMS. Because the objects are highly occluded, NMS can easily miss occluded objects by relying solely on IoU overlap. ASA-NMS, however, introduces a spatial distance decay mechanism that effectively integrates the geometric positional relationship and size similarity between candidate boxes, thereby improving object differentiation. The second row of images shows the detection results using ASA-NMS, where occluded objects can still be accurately detected.
[0070] Experimental results show that compared with the Soft-NMS and Confluence algorithms, the ASA-NMS algorithm described in the present invention exhibits better detection accuracy and stronger robustness in a variety of detection environments, thereby effectively verifying the performance improvement capability and wide applicability of the ASA-NMS algorithm in target detection tasks.
[0071] Table 1 Comparison results of the method of the present invention verified on the CrowdHuman dataset (the first place in each indicator is marked in bold)
[0072]
[0073] Table 2 Comparison results of the method of the present invention verified on the PASCAL VOC dataset (the first place in each indicator is marked in bold)
[0074]
[0075] At the same time, since the adaptive spatial perception non-maximum suppression method proposed in the present invention involves two hyperparameters, Figure 4 The specific impact of these two parameters on average precision (AP) is demonstrated. We first fixed α at 0.1 and adjusted γ to analyze their impact. We then conducted comparative experiments by fixing γ at 0.1 and adjusting α. The experimental results demonstrate that ASA-NMS can effectively improve detection performance with appropriate parameter configurations, demonstrating good robustness and scalability.
[0076] This paper proposes an adaptive spatially aware non-maximum suppression method that considers the spatial characteristics of bounding boxes when suppressing duplicate bounding boxes and transforms the suppression strategy into a competitive mechanism in continuous space. Furthermore, we introduce an adaptive risk-aware thresholding method that achieves differentiated suppression of duplicate bounding boxes, effectively improving the adaptive capabilities of detection.
[0077] The above are all preferred embodiments of the present invention. For ordinary technicians in this technical field, without departing from the principle of the present invention, various equivalent modifications to the present invention are within the scope of protection of the claims attached to this application.
Claims
1. An optimized non-maximum suppression method, characterized by: The inhibition method is as follows: S1: The detection model generates predicted candidate bounding boxes and performs post-processing through non-maximum suppression; S2: Select the bounding box b with the highest current confidence score from the candidate bounding box set m , and add it to the final retained prediction box set result; S3: record the bounding box b with the highest score m The diagonal distance width is used as the reference scale for subsequent normalization calculations; S4: Traverse the remaining bounding boxes b in the set in turn i , calculate b i with b m The diagonal distance d between the spaces diag , the distance attenuation probability p, and the confidence-weighted suppression score ASS, and finally decide whether to suppress through the dynamic threshold mechanism; S5: If the bounding box b i If the weighted suppression score ASS of is higher than the current dynamic threshold thr, it is determined to be a redundant box and removed from the candidate set B. The above process will continue to iterate until all candidate boxes are processed.
2. The optimized non-maximum suppression method according to claim 1, wherein: The non-maximum suppression method in S1 is to use the spatial distance decay rate based on the diagonal distance to transform the original binary decision strategy into a competition mechanism in the continuous probability space to optimize the positioning of repeated bounding boxes. The specific method is as follows: S1: Using the distance between two points, first calculate the bounding box b with the highest confidence score for the current classification m and the remaining bounding box b i The diagonal distance between the two boxes is calculated by adding the distance between the upper left corner and the distance between the lower right corners: d diag =||(L i -L m )||2+||(R i -R m )||2 (1) Among them, L represents the coordinate of the upper left corner of the bounding box, R represents the coordinate of the lower right corner, and d diag represents the sum of the diagonal distances of two bounding boxes; S2: The diagonal distance is then normalized by the diagonal length of the highest scoring bounding box to obtain the relative scale distance: In formula (2), the absolute spatial distance is converted into a relative distance that is independent of the target scale through normalization, thereby realizing a scale-adaptive distance measurement mechanism; S3: Further characterize the spatial proximity relationship between the predicted boxes and the possibility that they belong to the same target. An exponential function is introduced to map the normalized distance to the corresponding distance decay probability: p(b m |b i )=exp(-d norm ) (3) In formula (3), the distance decay probability p can be regarded as the bounding box b i With the highest scoring bounding box b m The confidence correlation of the two objects belonging to the same target; when the normalized spatial distance between the two objects is close and the distance decay probability p is close to 1, it is judged that the same target is detected repeatedly, and the suppression strength of the current bounding box is reduced; on the contrary, if the distance between the two objects is far and the distance decay probability p is close to 0, it is judged that they belong to different targets, and the confidence decay strength should be increased; S4: Combine the distance decay probability p with the confidence score s of the candidate bounding box itself i The adaptive suppression score ASS is constructed by fusion, which is as follows: ASS i =s i ·p i (4) 3. The optimized non-maximum suppression method according to claim 1, wherein: A smaller diagonal distance indicates that the two boxes are very close in position in the image and often belong to the same object; a larger diagonal distance indicates that the relative positions of the two boxes are far apart. Even if there may be a small overlap between the two boxes in the image, they may come from different objects.
4. An optimized non-maximum suppression method according to claim 1 or 2, characterized in that: The current dynamic threshold thr is based on the confidence s of the optimal candidate box of the current detection object m Generate adaptive thresholds; The value of thr is between 0-1, that is, the classification confidence scores of all bounding boxes are between 1-100%, the risk coefficient α measures the potential misjudgment risk caused by suppressing the candidate box, and the confidence s m It is regarded as a risk perception signal of the model for the current prediction result. When the candidate box has a higher confidence, it means that the model has a higher degree of confirmation of the object. At this time, the risk of suppressing its neighboring redundant boxes is lower. Therefore, a stricter suppression threshold can be used to reduce the generation of false positives. On the contrary, for candidate boxes with lower confidence, the uncertainty of the model is higher, and its neighboring boxes are more likely to contain real targets. At this time, a more relaxed suppression strategy should be adopted to reduce the risk of false negatives.