CN113591734B - Target detection method based on improved NMS algorithm - Google Patents
Target detection method based on improved NMS algorithm Download PDFInfo
- Publication number
- CN113591734B CN113591734B CN202110888783.1A CN202110888783A CN113591734B CN 113591734 B CN113591734 B CN 113591734B CN 202110888783 A CN202110888783 A CN 202110888783A CN 113591734 B CN113591734 B CN 113591734B
- Authority
- CN
- China
- Prior art keywords
- value
- frames
- candidate
- detection
- screening
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 57
- 238000000034 method Methods 0.000 claims abstract description 33
- 238000012216 screening Methods 0.000 claims abstract description 20
- 238000004364 calculation method Methods 0.000 claims abstract description 17
- 230000006870 function Effects 0.000 claims description 9
- 238000012886 linear function Methods 0.000 claims description 9
- 238000001914 filtration Methods 0.000 claims 1
- 230000007547 defect Effects 0.000 abstract description 3
- 238000013135 deep learning Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
- 239000013598 vector Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
- G06F18/2132—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on discrimination criteria, e.g. discriminant analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Image Analysis (AREA)
Abstract
Aiming at the problems that in the data processing process of an NMS algorithm, the calculation process is rough and has larger calculation defects, in the fourth data calculation of the traditional NMS algorithm, the confidence level zeroing method improvement and greedy method screening candidate frame improvement are carried out, and the target detection method based on the improved NMS algorithm is disclosed, so that the calculation workload is reduced, and the detection efficiency is improved; the method comprises the following steps: step 1) setting a fixed threshold Sc during screening of all candidate frames based on an NMS algorithm; step 2) arranging the candidate frame set B in a descending order; step 3) adding and reserving the highest confidence value in the candidate frame set B to the set D, and removing A from the set B; step 4) calculating I OU values of the remaining candidate frames in the A, B two candidate frame sets, and improving a greedy screening process by adopting an area comparison method and an overlapping part length comparison method; step 5) carrying out the data processing process on all the candidate frame sets; step 6) performing target detection based on the method.
Description
Technical Field
The invention relates to a target detection method based on an improved NMS algorithm, which improves detection precision and accelerates detection speed based on the improvement of the NMS algorithm.
Background
In recent years, with the exponential growth of image data and the rapid development of computer technology, the practical ability of deep learning has been widely developed. The target detection algorithm based on deep learning is characterized in that a large amount of data is input into a multi-layer neural network structure, image data are converted into feature vectors which can be identified by a computer, the computer extracts the data features, and automatically learns the feature information contained in the data to finally obtain more abstract data features, so that the defect that the advanced pedestrians are feature calibration is avoided, the network learning capability and the detection accuracy are greatly improved, and meanwhile, the method has stronger generalization capability and robustness. Compared with the traditional target detection algorithm, the deep learning target detection algorithm has strong functions because the detection accuracy can not meet the actual requirements, the characteristic expression capability is not strong, and the deep learning target detection algorithm can not meet the requirements of production practice and economic development, and can quickly calculate and process a large amount of data under the support of a computer hardware level, so that the deep learning target detection algorithm becomes the mainstream technology of target detection. Comparing the performance of eight typical target detection algorithms, comparing the advantages and disadvantages of the algorithms, and obtaining a conclusion, selecting a YOLOv4 algorithm with better performance on the data set to improve a non-maximum suppression algorithm, comparing the difference of detection precision and detection time before and after improvement, displaying the advantages of the improved algorithm, and developing the improved YOLOv4 algorithm into software so as to be better applied to production practice.
Disclosure of Invention
Aiming at the problem of larger calculation defects in the NMS algorithm process, a target detection method based on an improved NMS algorithm is provided, and the method comprises the following steps (wherein all candidate pre-detection frame sets output by deep network calculation can be represented by B, data processing such as screening is performed by adopting the NMS algorithm, the obtained detection frame sets can be represented by D, confidence value sets corresponding to the candidate frame sets can be represented by S, A represents a detection frame with the highest confidence value in all the candidate frame sets, sc represents a threshold value set during candidate frame screening, and Nt represents an overlapping threshold value set during IOU calculation):
step 1), setting a fixed threshold Sc when screening all candidate frames, and setting the confidence value of a pre-detection frame with the confidence value smaller than the screening threshold in the candidate frame set B to be 0;
step 2) arranging the candidate frame set B in a descending order based on the confidence value of the candidate frame;
step 3) adding and reserving the highest confidence value in the candidate frame set B to the set D, and removing A from the set B;
step 4) calculating A, B IOU values of the remaining candidate frames in the two candidate frame sets, setting an IOU screening overlapping threshold Nt, and setting a confidence coefficient value of the candidate frames larger than the overlapping threshold in the calculation result of the candidate frame set to be 0;
step 5) according to the fixed screening threshold value, all the data processing processes 2), 3) and 4) are carried out on the candidate frame set, and the screening work of all the candidate frames is completed;
step 6) performing target detection based on the method.
Further, the specific method of the step 4) is as follows:
the adjustment of the confidence level is completed by using a piecewise function, and the key of the confidence level adjustment is the determination mode of the slope of each linear function, the size of the slope and the division of a value interval range. Comprehensively, the value of Nt is chosen to be 0.3. After the value of Nt is determined, the function interval is divided into five sections, the attenuation rate increases along with the increase of the distance between the IOU and the overlapping threshold value, and the absolute value of the slope of each segmented area of the linear function also increases. The attenuation coefficient value of each piecewise linear function can be obtained through calculation.
Further, the specific method of the step 4) is as follows:
under the condition that no overlapping area exists between detection frames of the detection pictures or the condition that the area difference is relatively large, the speed of a detection algorithm can be seriously influenced. Based on this, to increase the detection rate of the NMS algorithm, the greedy method screening candidate boxes in the NMS algorithm completes two improvements:
a) The area distribution of the A prediction frame and the B prediction frame in the NMS algorithm can directly judge that the IOU value between the two prediction frames is smaller than the overlapping threshold value. Judging the inclusion relation of two prediction frames when calculating the IOU value of the prediction frames in the algorithm; the inclusion relationship existing between different prediction frames can be roughly divided into four cases.
When the dense target detection is carried out, a part of prediction frames which do not meet the requirements can be filtered out by using the conditions in the following formula, and then the prediction frames which cannot be judged are detected again by a method for calculating the IOU value.
b) The NMS algorithm adds a decision equation before the 4 th step: firstly, judging whether two prediction frames have overlapping areas or not, and calculating the IOU value only for the prediction frames with the overlapping areas. For the possible position distribution between the two frames A, B, the four cases can be categorized finally (a and B respectively represent the area sizes of the two frames, w and h are used to represent the length and width of the overlapping region of the two frames respectively, and the dotted line part in the figure represents that the length and width of the overlapping region are not present, i.e. the dotted line represents that the length is 0).
And judging whether an overlapped area exists between the detection frames by using a method of judging whether min { w, h } is 0, and directly judging whether the prediction frame B is rejected without IOU value calculation when no overlapped area exists between the detection frames.
Drawings
FIG. 1 is a schematic diagram of a conventional NMS algorithm detection;
FIG. 2 is a diagram showing the positional relationship of a prediction frame of a conventional NMS algorithm;
FIG. 3 is a graph of overlapping regions of a conventional NMS algorithm;
FIG. 4 is a graph comparing the detection results of the Yolov4 algorithm and the improved Yolov4 algorithm;
fig. 5 is a schematic diagram of a conventional NMS algorithm detection process.
Detailed Description
The invention "an object detection method based on NMS algorithm" is further described below with reference to the accompanying drawings.
The adjustment of the opposite credibility is completed by using a piecewise function, and a specific function formula is shown as follows:
s i =s i *c i
wherein: c i The attenuation coefficient is shown, and the detailed value is as follows:
the key of the confidence adjustment is the determination mode of the slope of each linear function in the above formula, the size of the slope and the division of the range of the value interval. Comprehensively, the value of Nt is chosen to be 0.3. After the value of Nt is determined, the function interval is divided into five sections, the attenuation rate increases along with the increase of the distance between the IOU and the overlapping threshold value, and the absolute value of the slope of each segmented area of the linear function also increases. The attenuation coefficient values of the respective piecewise linear functions obtained by calculation are shown in the following formula:
under the condition that no overlapping area exists between detection frames of the detection pictures or the condition that the area difference is relatively large, the speed of a detection algorithm can be seriously influenced. Based on this, to increase the detection rate of the NMS algorithm, the greedy method screening candidate boxes in the NMS algorithm completes two improvements:
a) The area distribution of the A prediction frame and the B prediction frame in the NMS algorithm can directly judge that the IOU value between the two prediction frames is smaller than the overlapping threshold value. Judging the inclusion relation of two prediction frames when calculating the IOU value of the prediction frames in the algorithm; the inclusion relationship existing between different prediction frames can be roughly divided into four cases.
When the dense target detection is carried out, a part of prediction frames which do not meet the requirements can be filtered out by using the conditions in the following formula, and then the prediction frames which cannot be judged are detected again by a method for calculating the IOU value.
b) The NMS algorithm adds a decision equation before the 4 th step: firstly, judging whether two prediction frames have overlapping areas or not, and calculating the IOU value only for the prediction frames with the overlapping areas. For the possible position distribution between the two frames A, B, the four cases can be categorized finally (a and B respectively represent the area sizes of the two frames, w and h are used to represent the length and width of the overlapping region of the two frames respectively, and the dotted line part in the figure represents that the length and width of the overlapping region are not present, i.e. the dotted line represents that the length is 0).
And judging whether an overlapped area exists between the detection frames by using a method of judging whether min { w, h } is 0, and directly judging whether the prediction frame B is rejected without IOU value calculation when no overlapped area exists between the detection frames. Target detection is achieved based on the algorithm.
Claims (2)
1. A target detection method based on an improved NMS algorithm, the method comprising the steps of: b is used for expressing all candidate pre-detection frame sets output by the depth network calculation, NMS algorithm is used for screening data processing, D is used for expressing the obtained detection frame sets, S is used for expressing confidence value sets corresponding to the candidate frame sets, A is used for expressing detection frames with highest confidence values in all the candidate frame sets, sc is used for expressing a threshold value set during candidate frame screening, and Nt is used for expressing an overlapping threshold value set during IOU calculation;
step 1), setting a fixed threshold Sc when screening all candidate frames, and setting the confidence value of a pre-detection frame with the confidence value smaller than the screening threshold in the candidate frame set B to be 0;
step 2) arranging the candidate frame set B in a descending order based on the confidence value of the candidate frame;
step 3) adding and reserving the highest confidence value in the candidate frame set B to the set D, and removing A from the set B;
step 4) calculating A, B IOU values of the remaining candidate frames in the two candidate frame sets, setting an IOU screening overlapping threshold Nt, and setting a confidence coefficient value of the candidate frames larger than the overlapping threshold in the calculation result of the candidate frame set to be 0; the adjustment of the opposite credibility is completed by using a piecewise function, and the specific functions are as follows:
s i =s i *c i
wherein: c i The attenuation coefficient is shown, and the detailed value is as follows:
the key of the confidence adjustment is the determination mode of the slope of each linear function in the above formula, the size of the slope and the division of the range of the value interval; comprehensively considering that the value of Nt is selected to be 0.3, after the value of Nt is determined, the function interval is divided into five sections, the attenuation rate is increased along with the increase of the distance between the IOU and the overlapping threshold value, the absolute value of the slope of each piecewise region of the linear function is also increased along with the increase of the absolute value of the slope, and the attenuation coefficient value of each piecewise linear function is obtained through calculation:
step 5) according to the fixed screening threshold value, all the data processing processes 2), 3) and 4) are carried out on the candidate frame set, and the screening work of all the candidate frames is completed;
step 6) performing target detection based on the method.
2. The method according to claim 1, wherein the specific method of the step 4) is as follows:
under the condition that no overlapping area exists between detection frames of the detection pictures or the condition that the area difference is relatively large, the speed of a detection algorithm can be seriously influenced; based on this, to increase the detection rate of the NMS algorithm, the greedy method screening candidate boxes in the NMS algorithm completes two improvements:
a) The area distribution of the A prediction frame and the B prediction frame in the NMS algorithm directly judges that the IOU value between the two prediction frames is smaller than the overlapping threshold value; judging the inclusion relation of two prediction frames when calculating the IOU value of the prediction frames in the algorithm; the inclusion relationship existing between different prediction frames is roughly divided intoFour cases of aζb= B, A ζb=a:
when the dense target detection is carried out, firstly filtering out a part of prediction frames which do not meet the requirements by using the conditions in the following formula, and then detecting the prediction frames which cannot be judged again by a method for calculating the IOU value;
b) The NMS algorithm adds a decision equation before the 4 th step: firstly, judging whether two prediction frames have overlapping areas, and calculating an IOU value only for the prediction frames with the overlapping areas; for the distribution of positions that can occur between the A, B two boxes, four cases are finally categorized: a and B respectively represent the area size of the two frames, w and h are used for respectively representing the length and the width of the overlapping area of the two frames, a dotted line part is used for representing the absence of the length and the width of the overlapping area, namely, the dotted line represents that the length is 0;
and judging whether an overlapped area exists between the detection frames by using a method of judging whether min { w, h } is 0, and directly judging whether the prediction frame B is rejected without IOU value calculation when no overlapped area exists between the detection frames.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110888783.1A CN113591734B (en) | 2021-08-03 | 2021-08-03 | Target detection method based on improved NMS algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110888783.1A CN113591734B (en) | 2021-08-03 | 2021-08-03 | Target detection method based on improved NMS algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113591734A CN113591734A (en) | 2021-11-02 |
CN113591734B true CN113591734B (en) | 2024-02-20 |
Family
ID=78254692
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110888783.1A Active CN113591734B (en) | 2021-08-03 | 2021-08-03 | Target detection method based on improved NMS algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113591734B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115410060B (en) * | 2022-11-01 | 2023-02-28 | 山东省人工智能研究院 | Public safety video-oriented global perception small target intelligent detection method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5787201A (en) * | 1996-04-09 | 1998-07-28 | The United States Of America As Represented By The Secretary Of The Navy | High order fractal feature extraction for classification of objects in images |
KR20200036079A (en) * | 2018-09-18 | 2020-04-07 | 전남대학교산학협력단 | System and Method for Detecting Deep Learning based Human Object using Adaptive Thresholding Method of Non Maximum Suppression |
CN112183330A (en) * | 2020-09-28 | 2021-01-05 | 北京航空航天大学 | Object detection method based on point cloud |
WO2021051601A1 (en) * | 2019-09-19 | 2021-03-25 | 平安科技(深圳)有限公司 | Method and system for selecting detection box using mask r-cnn, and electronic device and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8953882B2 (en) * | 2012-05-31 | 2015-02-10 | Apple Inc. | Systems and methods for determining noise statistics of image data |
-
2021
- 2021-08-03 CN CN202110888783.1A patent/CN113591734B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5787201A (en) * | 1996-04-09 | 1998-07-28 | The United States Of America As Represented By The Secretary Of The Navy | High order fractal feature extraction for classification of objects in images |
KR20200036079A (en) * | 2018-09-18 | 2020-04-07 | 전남대학교산학협력단 | System and Method for Detecting Deep Learning based Human Object using Adaptive Thresholding Method of Non Maximum Suppression |
WO2021051601A1 (en) * | 2019-09-19 | 2021-03-25 | 平安科技(深圳)有限公司 | Method and system for selecting detection box using mask r-cnn, and electronic device and storage medium |
CN112183330A (en) * | 2020-09-28 | 2021-01-05 | 北京航空航天大学 | Object detection method based on point cloud |
Also Published As
Publication number | Publication date |
---|---|
CN113591734A (en) | 2021-11-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114862862B (en) | Pump body cold shut defect identification method and system based on image processing | |
CN109859171B (en) | Automatic floor defect detection method based on computer vision and deep learning | |
US12073564B2 (en) | Method for automatic segmentation of fuzzy boundary image based on active contour and deep learning | |
WO2020107717A1 (en) | Visual saliency region detection method and apparatus | |
US20080136820A1 (en) | Progressive cut: interactive object segmentation | |
CN108961291A (en) | A kind of method of Image Edge-Detection, system and associated component | |
JP2002208007A (en) | Automatic detection of scanned document | |
JP3173834B2 (en) | Method and apparatus for segmenting a signal representing a digital image | |
CN111382784B (en) | Moving target tracking method | |
CN113591734B (en) | Target detection method based on improved NMS algorithm | |
CN110472640B (en) | Target detection model prediction frame processing method and device | |
CN110445726A (en) | A kind of adaptive network stream concept drift detection method based on comentropy | |
CN117292113A (en) | Concrete crack dynamic expansion real-time monitoring method based on deep learning | |
CN119006505B (en) | Automatic detection method and system for highway construction quality | |
CN109784145B (en) | Depth map-based target detection method and storage medium | |
CN113933312A (en) | Periodic rule real-time judgment method for surface defects | |
CN117036358B (en) | Method and system for detecting tool wear of numerical control machine tool | |
CN111368625B (en) | Pedestrian target detection method based on cascade optimization | |
CN118247764A (en) | Training of obstacle detection model and obstacle detection method and device | |
US7277600B2 (en) | Skew detection | |
CN114862786A (en) | Retinex image enhancement and Ostu threshold segmentation based isolated zone detection method and system | |
CN114387217A (en) | A method, system, device and storage medium for segmenting a circle-like overlapping target | |
JP5786838B2 (en) | Image region dividing apparatus, method, and program | |
JPH0217832B2 (en) | ||
CN117474897B (en) | Visual detection method for surface defects of charger |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |