An inter-class non-maximum suppression single model multi-scene classification target detection method, system, device and medium

By post-processing the YOLOv5 model output using an improved inter-class nonmaximum suppression algorithm, the problem of single-model multi-scene target detection is solved, the detection accuracy and applicability are improved, and the versatility of a single model in different scenarios is realized.

CN117765324BActive Publication Date: 2026-11-20XIDIAN UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311798658.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2026-11-20
Estimated Expiration
2043-12-26

AI Technical Summary

Technical Problem

Existing technologies require retraining the YOLO v5 model in different scenarios to adapt to specific target detection needs, resulting in long training times and limited model applicability. Furthermore, existing methods suffer from false positives and false negatives in multi-target detection.

Method used

A single-model multi-scene classification object detection method based on inter-class nonmaximum suppression is adopted. The output of the YOLOv5 model is post-processed by an improved inter-class NMS algorithm. By combining intra-class and inter-class NMS, the detection boxes with the highest confidence are selected and redundant information is merged to improve detection accuracy.

Benefits of technology

It achieves high-precision target detection in multiple scenarios using a single model, reduces redundant information, improves the accuracy and applicability of detection, and saves time in retraining the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure QLYQS_1
    Figure QLYQS_1
  • Figure QLYQS_4
    Figure QLYQS_4
  • Figure QLYQS_11
    Figure QLYQS_11
Patent Text Reader

Abstract

A single model multi-scene classification target detection method and system of inter-class non-maximum suppression, equipment and medium, the method comprises the following steps: step 1, post-processing YOLOv5 model output to generate initial detection frame; step 2, inter-class non-maximum suppression (NMS) is carried out to the initial detection frame generated in step 1; step 3, improved inter-class non-maximum suppression (NMS) is carried out to the detection frame after step 2 through inter-class non-maximum suppression (NMS); the system, equipment and medium are used to realize the method; the model output is post-processed through the improved inter-class NMS algorithm, the single model multi-scene target detection problem is solved, the general type of single model and the precision of multi-scene target detection are improved, and the development of target detection task is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image recognition technology, specifically relating to a single-model multi-scene classification target detection method, system, device, and medium with inter-class nonmaximum suppression. Background Technology

[0002] YOLO (You Only Look Once), a deep learning model for object detection, has achieved significant success in the field of computer vision due to its outstanding real-time performance. This model efficiently performs multi-object detection in real-time video by modeling object detection as a regression problem and simultaneously predicting the object's category and location through a single forward pass.

[0003] YOLO's unique design features include real-time performance, global information consideration, multi-scale feature utilization, and direct bounding box regression. Its global information processing method enables it to effectively handle the entire image and achieve good detection results for small targets. Simultaneously, by using multi-scale feature maps, the model can adapt to targets of varying sizes, enhancing its robustness. Furthermore, YOLO's bounding box regression strategy simplifies the entire detection process by directly predicting the bounding box coordinates of the target, rather than using candidate region extraction and regression.

[0004] Different versions of YOLO have continuously driven the development of the object detection field through innovations such as improved network structure and enhanced detection performance. In computer vision, YOLO is widely used for tasks such as object detection, pedestrian detection, traffic scene analysis, and medical image processing. YOLO also plays a crucial role in applications such as autonomous driving, intelligent monitoring, and industrial inspection.

[0005] In practical applications, object detection systems are designed to identify and detect specific categories of objects, depending on the specific needs of each scenario. This customized functionality is achieved by training the model using data from the corresponding category during the training phase.

[0006] In different application scenarios, to ensure that object detection models can accurately identify specific categories of objects, retraining is usually required. Taking YOLO v5 as an example, the training time for YOLO v5 n / s / m / l / x on a V100 GPU is 1 / 2 / 4 / 6 / 8 days, respectively. It's worth noting that training on a lower-performance GPU may result in even longer training times. Therefore, using a general-purpose, large-scale model for object detection in different scenarios while maintaining model accuracy is an urgent problem to be solved.

[0007] Existing technology 1: Post-processing the output of YOLO v5s according to the needs of specific scenarios. In this way, the model can be adapted to different scenarios without retraining, achieving the goal of using a general-purpose large model for object detection.

[0008] The post-processing algorithm is as follows:

[0009]

[0010] Where, B={b1,..,b N} is the set of detection boxes, b i Includes the coordinate information of the detection bounding box. L={l1,..,l N} is the set of bounding box categories, l i This represents the category information of the i-th detection box. C = {c1, ..., c...} M} is a pre-defined set of category information for a specific scenario. The algorithm's result is a bounding box containing only category C.

[0011] We can use a pre-defined set of category information to filter and retain only the target categories of interest in the current scene. This approach makes the model's output more aligned with the needs of specific scenarios, improving the accuracy and applicability of object detection.

[0012] Here, we use the officially released standard YOLOv5s model for testing, such as... Figure 1 The image shows the prediction results of a standard model containing 80 categories. It can be seen that there are false positives; two car targets were falsely identified as "handbag" and "cell phone," respectively.

[0013] We use an output post-processing algorithm for scene-specific object detection. Here, we only retain vehicle-related categories (trucks, cars, tricycles, etc.) to simulate vehicle violation detection scenarios. The prediction results are shown below. Figure 2 .

[0014] like Figure 2 As shown, when the detection scenario is set to vehicles, most vehicle targets in the scenario are correctly detected, but two targets are still missed. Therefore, although the existing technology 1 can meet the requirements of scenario-based detection, there are still cases of missed detection.

[0015] Patent application CN113177560A proposes a universal, lightweight deep learning vehicle detection method to address the problem that existing technologies cannot simultaneously achieve both accuracy and real-time performance under limited computing resources and storage space. However, this method uses the relatively low-performance YOLO v4 model, and the model is only applicable to vehicle detection scenarios and cannot be extended to other scenarios.

[0016] Patent application CN117079311A discloses a method, system, electronic device, and storage medium for pedestrian detection and attribute recognition. This model can simultaneously perform pedestrian detection and attribute recognition on images of pedestrians to be identified, improving the efficiency of pedestrian recognition. However, this method is prone to confusing pedestrians with other targets, resulting in numerous false detections. Summary of the Invention

[0017] To overcome the shortcomings of the prior art, the present invention aims to provide a single-model multi-scene classification object detection method, system, device, and medium based on inter-class non-maximum suppression (NMS). Building upon traditional NMS, it integrates the advantages of inter-class NMS and intra-class NMS. The final output is obtained by sorting the probabilities of possible classes within the bounding box and selecting the class with the highest probability or the top three most probabilities as the current detection box output. In this improvement, inter-class NMS is used to eliminate multiple boxes containing the same target, reducing redundant information. Simultaneously, intra-class NMS helps improve the accuracy between different target boxes within the same class. This fusion allows for a more comprehensive consideration of the relationships between target boxes, effectively filtering out the most representative and high-confidence target boxes, thereby improving the accuracy of object detection.

[0018] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0019] A single-model multi-scene classification object detection method with inter-class nonmaximum suppression includes the following steps:

[0020] Step 1: Post-process the YOLOv5 model output to generate initial detection boxes;

[0021] Step 2: Perform intra-class nonmaximum suppression (NMS) on the initial detection boxes generated in Step 1;

[0022] Step 3: Apply improved inter-class nonmaximum suppression (NMS) to the detection boxes after intra-class nonmaximum suppression (NMS) in Step 2.

[0023] The specific method for step 1 is as follows:

[0024] Step 1.1: Calculate the confidence score for each category of the detection box;

[0025] The output of a YOLOv5 model is a matrix, with the following dimensions:

[0026] m.shape = n * 85

[0027] Where n represents the number of detection boxes, 85 represents the confidence score of the detection boxes (Pr(Object)) and the coordinates of the four vertices of the detection boxes (x, y, y). begin xend , y begin , y end ) as well as the confidence of 80 categories (Pr(Class i |Object)); therefore, the probability of each category in the target frame is: Pr(Class i |Object)*Pr(Object) = Pr(Class i );

[0028] Step 1.2, performing a preliminary screening on the detection frames, and removing the detection frames with confidence less than a threshold;

[0029] In the post-processing stage of the output of the YOLOv5 model, performing a preliminary screening on the detection frames, and removing the detection frames with confidence less than the threshold (Pr(Object)<Box Confidence), where Pr(Object) is the confidence of the detection frame, and BoxConfidence is the detection frame confidence threshold;

[0030] The remaining M detection frames will be expanded into 80 candidate frames, and each candidate frame respectively stores the probability values of 80 categories (Pr(Class i )), therefore, 80×M candidate frames are generated after the preliminary screening, where Pr(Class i ) stores the probability value of each category, which can be calculated by the formula: Pr(Class i ) = Pr(Class i |Object)*Pr(Object);

[0031] Step 1.3, performing a secondary screening on the remaining candidate frames after the preliminary screening in step 1.2, and removing the candidate frames with probability value less than the threshold (Pr(Class i )<Class Confidence), that is, removing the categories with relatively small probabilities.

[0032] The specific method of step 2 is as follows:

[0033] Processing the coordinate information of the initial detection frames generated in step 1 according to the categories contained therein, and the coordinate conversion formula is as follows:

[0034]

[0035] where, (x begin , x end , y begin , y end ) represents the coordinate information of the detection frame, and C i represents the category information contained in the detection frame, and the clustering processing of the detection frames is realized by adjusting the distance between the detection frames of different categories.

[0036] The specific steps of the improved inter-class nonmaximum suppression (NMS) described in step 3 are as follows:

[0037] 3.1 Selecting the highest-scoring detection box: Sort the detection boxes after intra-class non-maximum suppression (NMS) in step 2 in descending order of confidence, select the detection box with the highest confidence, regard it as the current best detection result, i.e. the best detection box, and add it to the final result list;

[0038] 3.2 Calculating Overlapping Regions: Traverse the unprocessed detection boxes and evaluate their overlap by calculating the Intersection over Union (IOU) with the current best detection box. The IOU calculation formula is:

[0039]

[0040] Among them, B max =(x max ,y max ,w max ,h max B is the optimal detection box. other =(x other ,y other ,w other ,h other () represents the detection box to be filtered;

[0041] 3.3 Remove overlapping detection boxes: If the intersection-union ratio (IOU) between two detection boxes exceeds a predetermined threshold, the current detection box is considered redundant and should be removed. The probability and category information of the detection box are saved. Conversely, if the IOU is lower than the threshold, the detection box is retained.

[0042] 3.4 Repeat steps 3.2 and 3.3: iteratively select the highest-scoring detection box and remove overlapping detection boxes until all detection boxes have been processed.

[0043] In step 1.2, Box Confidence is set to 0.2 to 0.3, and in step 1.3, Class Confidence is set to 0.05 to 0.2.

[0044] The BoxConfidence value is preferably set to 0.25, and the Class Confidence value is preferably set to 0.10.

[0045] This invention also provides a single-model multi-scene classification object detection method with inter-class nonmaximum suppression, including:

[0046] Initial detection box generation module: Used to post-process the output of the YOLOv5 model and generate initial detection boxes;

[0047] Intra-class Nonmaximum Suppression (NMS) Processing Module: Used to perform intra-class nonmaximum suppression (NMS) on the generated initial detection boxes;

[0048] Improved inter-class nonmaximum suppression (NMS) processing module: Used to perform improved inter-class nonmaximum suppression (NMS) on detection boxes that have undergone intra-class nonmaximum suppression (NMS).

[0049] This invention also provides a single-model multi-scene classification object detection device with inter-class nonmaximum suppression, comprising:

[0050] Memory: A computer program that stores the above-mentioned single-model multi-scene classification object detection method with inter-class nonmaximum suppression, and is a computer-readable device;

[0051] Processor: Used to implement the single-model multi-scene classification object detection method with inter-class nonmaximum suppression when executing the computer program.

[0052] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the single-model multi-scene classification object detection method with inter-class nonmaximum suppression.

[0053] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0054] 1. This invention provides a single-model multi-scene classification object detection method based on inter-class non-maximum suppression (NMS). Through an improved NMS algorithm, the method retains the class information of detection boxes rejected by the NMS algorithm and merges them into the detection box with the highest confidence. Therefore, it can achieve the effect of displaying multiple classes for a single detection box. This method can visualize the class information of the current detection box and defaults to setting the class with the highest probability as the representative class of this detection box, which can greatly improve the accuracy of object detection.

[0055] 2. This invention provides a single-model multi-scene classification object detection method based on inter-class nonmaximum suppression. By modifying the post-processing part of the YOLOv5 model, the categories of object detection are limited. This enables the reuse of a single model across multiple scenes, significantly saving the time required to retrain a new model.

[0056] 3. This invention provides a single-model multi-scene classification object detection method based on inter-class nonmaximum suppression. This method is a well-packaged module that does not require model retraining. It can be used simply by replacing the original NMS, offering the advantage of plug-and-play functionality.

[0057] In summary, this invention solves the problem of single-model multi-scene target detection by post-processing the model output through an improved inter-class NMS algorithm, thereby improving the versatility of the single model and the accuracy of multi-scene target detection, and promoting the development of target detection tasks. Attached Figure Description

[0058] Figure 1 This refers to the target detection results for all categories included in existing technology 1.

[0059] Figure 2 Target detection in vehicle scenes is performed using existing technology 1.

[0060] Figure 3 This is the target detection map after NMS within the class of this invention.

[0061] Figure 4 The flowchart of the improved NMS algorithm of this invention is shown.

[0062] Figure 5 This invention improves the detection results of the NMS algorithm.

[0063] Figure 6 This invention provides a visualization of multi-class probabilities.

[0064] Figure 7 The final detection result of the improved NMS algorithm of this invention.

[0065] Figure 8 This invention includes target detection results for all categories.

[0066] Figure 9 For a scenario of using existing technology 1 to monitor pedestrian flow.

[0067] Figure 10 This invention improves the NMS algorithm for multi-class target detection.

[0068] Figure 11 This invention relates to the improved NMS algorithm for target detection. Detailed Implementation

[0069] The technical solution adopted by the present invention will be described in detail below with reference to the accompanying drawings.

[0070] This embodiment uses the officially released standard YOLOv5s model for description and analysis.

[0071] A single-model multi-scene classification object detection method with inter-class nonmaximum suppression includes the following steps:

[0072] Step 1: Post-process the YOLOv5s model output to generate initial detection boxes;

[0073] Step 1.1, calculating the confidence of each category of the detection box;

[0074] The output of the YOLOv5s model is a matrix, and the dimensions of the matrix are:

[0075] m.shape = n*85

[0076] where n represents the number of detection boxes, and 85 represents the confidence of the detection box (Pr(Object)), the coordinates of the four vertices of the detection box (x begin , x end , y begin , y end ) as well as the confidence of 80 categories (Pr(Class i |Object)); therefore, the probability of each category in the target box is: Pr(Class i |Object)*Pr(Object) = Pr(Class i );

[0077] Step 1.2, performing primary screening on the detection boxes, and removing detection boxes with confidence less than a threshold;

[0078] In the post-processing stage after the output of the YOLOv5s model, it is first necessary to perform primary screening on the detection boxes, and remove detection boxes with confidence less than the threshold (Pr(Object)<Box Confidence), where Pr(Object) is the confidence of the detection box, and BoxConfidence is the confidence threshold of the detection box; this step is to filter out detection boxes with relatively low confidence.

[0079] The remaining M detection boxes will be expanded into 80 candidate boxes, and each candidate box stores the probability values of 80 categories (Pr(Class i )), therefore, 80×M candidate boxes are generated after primary screening, where Pr(Class i ) stores the probability value of each category, which can be calculated by the formula: Pr(Class i ) = Pr(Class i |Object)*Pr(Object);

[0080] Step 1.3, performing secondary screening on the remaining candidate boxes after the primary screening in step 1.2, and removing candidate boxes with probability values less than the threshold (Pr(Class i )<Class Confidence), that is, removing categories with relatively low probability;

[0081] Finally, the retained candidate boxes enter non-maximum suppression (NMS) for final screening.

[0082] In step 1.2, Box Confidence is set to 0.2 to 0.3, and in step 1.3, Class Confidence is set to 0.05 to 0.2.

[0083] The Box Confidence is preferably set to 0.25, and the Class Confidence is preferably set to 0.10. Experiments have shown that the best detection results can be achieved when Box Confidence and Class Confidence are set to 0.25 and 0.10, respectively.

[0084] Step 2: Perform intra-class nonmaximum suppression (NMS) on the initial detection boxes generated in Step 1;

[0085] The purpose of this step is to ensure that only the highest probability information for each class is retained within each detection box. This helps prevent different probability information for the same class from being output during the final sorting.

[0086] The main principle of intra-class NMS is to process the coordinate information of detection boxes representing different categories (e.g., detection box Box1 represents category C1, and detection box Box2 represents category C2) based on the categories contained in the initial detection boxes generated in step 1. The coordinate transformation formula is as follows:

[0087]

[0088] Among them, (x begin x end y begin y end ) represents the coordinate information of the detection box, C i This represents the category information contained in the detection boxes. Clustering of detection boxes is achieved by adjusting the distance between different categories of detection boxes. The purpose of this step is to ensure that there is a large distance between detection boxes of different categories to avoid excessive overlap.

[0089] Step 3, as follows Figure 3 As shown, after intra-class nonmaximum suppression (NMS), a target may generate multiple detection boxes. These boxes are close in coordinate position but represent different class information. An improved inter-class nonmaximum suppression (NMS) is applied to the detection boxes after intra-class NMS in step 2.

[0090] Therefore, to ensure that only one detection box is generated for the same target, we need to perform further inter-class nonmaximum suppression. Traditional inter-class NMS is similar to intra-class NMS, but it does not perform coordinate transformation, i.e.:

[0091]

[0092] The output of NMS includes three parts: detection boxes, the class of the detection boxes, and confidence scores. In this step, improved inter-class nonmaximum suppression (NMS) is used to integrate detection boxes around the same target to produce a visualization of the probability of the current target's possible class. This helps to refine and present comprehensive detection information for the same target, further improving the accuracy and clarity of the detection results.

[0093] like Figure 4 As shown, the specific steps of the improved inter-class nonmaximum suppression (NMS) described in step 3 are as follows:

[0094] 3.1 Selecting the highest-scoring detection box: Sort the detection boxes after intra-class non-maximum suppression (NMS) in step 2 in descending order of confidence, select the detection box with the highest confidence, regard it as the current best detection result, i.e. the best detection box, and add it to the final result list;

[0095] 3.2 Calculating Overlapping Regions: Traverse the unprocessed detection boxes and evaluate their overlap by calculating the Intersection over Union (IOU) with the current best detection box. The IOU calculation formula is:

[0096]

[0097] Among them, B max =(x max ,y max ,w max ,h max B is the optimal detection box. other =(x other ,y other ,w other ,h other () represents the detection box to be filtered;

[0098] 3.3 Remove overlapping detection boxes: If the intersection-union ratio (IOU) between two detection boxes exceeds a predetermined threshold, the current detection box is considered redundant and should be removed. The probability and category information of the detection box are saved. Conversely, if the IOU is lower than the threshold, the detection box is retained.

[0099] 3.4 Repeat steps 3.2 and 3.3: iteratively select the highest-scoring detection box and remove overlapping detection boxes until all detection boxes have been processed.

[0100] Experimental Analysis

[0101] The final output of the improved NMS algorithm used in this application is a set of detection boxes in the image and a set of class and probability values ​​for each detection box.

[0102] The test was conducted using the officially released standard YOLOv5s model, and the improved NMS algorithm was used for object detection. The output shows the possible categories in the detection box and their probability values. Figure 5 The image shows the prediction results of a standard model that includes 80 categories.

[0103] It can be observed that each detection box contains information from multiple categories, and is arranged in ascending order of probability values.

[0104] In the prior art 1, according to Figure 1 It can be seen that boxes 7 and 12 were misidentified as a handbag and a cellphone, respectively. Figure 2 In our initial optimized algorithm, since only vehicle-related categories were retained, boxes 7 and 12 were not detected (because boxes 7 and 12 were considered as handbag and cell phone, respectively, both of which are non-vehicle categories).

[0105] like Figure 6 As shown, this invention visualizes the category information and corresponding probability values ​​of each detection box. After processing with the improved NMS algorithm, the visualization results show that the probability order of the three categories in box 7 is: handbag > suitcase > car, and the probability order of the three categories in box 12 is: cell phone > car > truck.

[0106] Therefore, in a vehicle scenario, the maximum probability value is taken as the output of the current detection box, i.e., box 7. Figure 7 The category output for box 11 is "car", and for box 12... Figure 7 The category output for box 9 in the image is "car". See the final result. Figure 7 ;

[0107] When applying this to a people flow monitoring scenario, we only need to retain the "person" category and test it using the officially released standard YOLOv5s model, which includes 80 categories. The test results are shown below. Figure 8 .

[0108] like Figure 8 As shown, it can be seen that using the standard YOLOv5s model... Figure 8 Target detection can result in false positives: the "person" category in the blue box is mistakenly detected as the "bicycle" category. Therefore, if existing technology 1 is used, retaining only the "person" category in a pedestrian flow monitoring scenario will lead to missed detections, as shown in [link to technology]. Figure 9 .

[0109] like Figure 9As shown, the original category of the blue box should be person, but in the use of existing technology 1, since the scenario is limited to traffic monitoring, the detection box of the bicycle category is filtered out, resulting in a missed detection problem.

[0110] This invention uses an improved NMS algorithm to test the same image. When set to multi-category display, the target detection results are shown below. Figure 10 .

[0111] according to Figure 10 As can be seen, box 21 is the false positive detection box, and the class probability distribution within the detection box is as follows:

[0112] P(motorcycle) = 0.27

[0113] P(person) = 0.22

[0114] Therefore, when using the improved NMS algorithm, motorcycle category filtering can be used to achieve scene-specific object detection. The final results are shown below. Figure 11 .

[0115] In the original algorithm, box 6 was detected as a motorcycle, but after processing by this algorithm, it was correctly detected as a person. Therefore, the improved NMS algorithm also improves the accuracy of object detection at the post-processing level.

[0116] To reduce the time overhead of retraining the model, this invention employs a strategy of multi-class training on a general object detection model, followed by adjustments to the inference process to focus only on specific object classes, thereby improving the model's flexibility. The advantage of this strategy is that the general model only needs to be trained once, and then fine-tuned to adapt to the needs of different scenarios, thus saving significant retraining time. It satisfies the multi-class requirements of general scenarios while allowing for targeted adjustments in specific application scenarios.

[0117] This invention also provides a single-model multi-scene classification object detection method with inter-class nonmaximum suppression, including:

[0118] Initial detection box generation module: used to perform post-processing on the YOLOv5s model output in step 1 to generate initial detection boxes;

[0119] Intra-class Non-maximum Suppression (NMS) Processing Module: Used to perform intra-class non-maximum suppression (NMS) on the generated initial detection boxes in step 2;

[0120] Improved inter-class nonmaximum suppression (NMS) processing module: used to implement improved inter-class nonmaximum suppression (NMS) on the detection boxes after intra-class nonmaximum suppression (NMS) in step 3.

[0121] This invention also provides a single-model multi-scene classification object detection device with inter-class nonmaximum suppression, comprising:

[0122] Memory: A computer program that stores the above-mentioned single-model multi-scene classification object detection method with inter-class nonmaximum suppression, and is a computer-readable device;

[0123] Processor: Used to implement the single-model multi-scene classification object detection method with inter-class nonmaximum suppression when executing the computer program.

[0124] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the single-model multi-scene classification object detection method with inter-class nonmaximum suppression.

Claims

1. A single-model multi-scene classification object detection method with inter-class nonmaximum suppression, characterized in that: Includes the following steps: Step 1: Post-process the YOLOv5 model output to generate initial detection boxes; Step 2: Perform intra-class nonmaximum suppression (NMS) on the initial detection boxes generated in Step 1; Step 3: Apply improved inter-class nonmaximum suppression (NMS) to the detection boxes after intra-class NMS in Step 2. The specific steps of the improved inter-class nonmaximum suppression (NMS) described in step 3 are as follows: 3.1 Selecting the highest-scoring detection box: Sort the detection boxes after intra-class non-maximum suppression (NMS) in step 2 in descending order of confidence, select the detection box with the highest confidence, regard it as the current best detection result, i.e. the best detection box, and add it to the final result list; 3.2 Calculate the overlapping region: Traverse the unprocessed detection boxes and calculate their intersection-union ratio (IU / U) with the current best detection box. IOU To assess the degree of overlap between them, the intersection-union ratio (IU) is used. IOU The calculation formula is: in, ) This is the optimal detection box. ) The detection box to be filtered; 3.3 Remove overlapping detection boxes: If the intersection-union ratio between two detection boxes is... IOU If the threshold is exceeded, the current detection box is considered redundant and should be removed. The probability and category information of this detection box are saved and merged into the detection box with the highest confidence. Conversely, if the cross-validation ratio (CFU) is not exceeded, the detection box is considered redundant and should be removed. IOU If the value is below the threshold, the detection box is retained. 3.4 Repeat steps 3.2 and 3.3: iteratively select the highest-scoring detection box and remove overlapping detection boxes until all detection boxes have been processed.

2. The single-model multi-scene classification target detection method with inter-class nonmaximum suppression according to claim 1, characterized in that: The specific method for step 1 is as follows: Step 1.1: Calculate the confidence score for each category of the detection box; The output of a YOLOv5 model is a matrix, with the following dimensions: in, Represents the number of detection boxes. Represents the confidence level of the detection box. The coordinates of the four vertices of the detection box ( ) as well as Confidence levels for each category Therefore, the probability of each category in the target box is: ; Step 1.2: Perform initial screening of the detection boxes and remove detection boxes with confidence scores below the threshold. In the post-processing stage of the YOLOv5 model output, the detection boxes are initially filtered to remove those with confidence scores below a threshold, as shown below: Box Confidence, BoxConfidence represents the confidence level of the bounding box, and BoxConfidence is the confidence threshold for the bounding box. The remaining Each detection box will be expanded into There are 10 candidate boxes, and each candidate box stores 100 candidate boxes. Probability values ​​of each category Therefore, after initial screening, the following are generated. There are candidate boxes, among which... It can be calculated using the formula: ; Step 1.3 involves a second filtering of the remaining candidate boxes after the initial filtering in Step 1.2, removing candidate boxes with probability values ​​less than a threshold, denoted as... Class Confidence That is, remove categories with lower probabilities.

3. The single-model multi-scene classification target detection method with inter-class nonmaximum suppression according to claim 1, characterized in that: The specific method for step 2 is as follows: The coordinate information of the initial detection box generated in step 1 is processed according to the categories contained therein. The coordinate transformation formula is as follows: in, Represents the coordinate information of the detection box. This represents the category information contained in the detection boxes. Clustering of detection boxes is achieved by adjusting the distance between different categories of detection boxes.

4. The single-model multi-scene classification target detection method with inter-class nonmaximum suppression according to claim 2, characterized in that: In step 1.2 Box Confidence set to 0.2~0.3, in step 1.3 Class Confidence Set it to 0.05~0.

2.

5. The single-model multi-scene classification target detection method with inter-class nonmaximum suppression according to claim 4, characterized in that: The Box Confidence Set to 0.25, Class Confidence Set to 0.

10.

6. A single-model multi-scene classification object detection system with inter-class nonmaximum suppression, used to implement the method of claim 1, characterized in that: include: Initial detection box generation module: Used to post-process the output of the YOLOv5 model and generate initial detection boxes; Intra-class Non-maximum Suppression (NMS) processing module: Used to perform intra-class non-maximum suppression (NMS) on the generated initial detection boxes; Improved inter-class nonmaximum suppression (NMS) processing module: Used to perform improved inter-class nonmaximum suppression (NMS) on detection boxes after intra-class nonmaximum suppression (NMS).

7. A single-model multi-scene classification target detection device with inter-class nonmaximum suppression, characterized in that: include: Memory: A computer program for a single-model multi-scene classification object detection method with inter-class nonmaximum suppression as described in any one of claims 1-5, and is a computer-readable device; Processor: Used to implement the single-model multi-scene classification object detection method with inter-class nonmaximum suppression as described in any one of claims 1-5 when executing the computer program.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that, when executed by a processor, can implement the single-model multi-scene classification object detection method with inter-class nonmaximum suppression as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Universal lightweight deep learning vehicle detection method

    CN113177560A

  • Pedestrian detection and attribute recognition method and system, electronic equipment and storage medium

    CN117079311A

  • A real-time scene small face detection method based on deep learning

    CN109886083A

  • Method for detecting smoke and fire around power transmission line based on improved YOLOv4

    CN114626439A