CN113591734A - Target detection method based on improved NMS algorithm - Google Patents
Target detection method based on improved NMS algorithm Download PDFInfo
- Publication number
- CN113591734A CN113591734A CN202110888783.1A CN202110888783A CN113591734A CN 113591734 A CN113591734 A CN 113591734A CN 202110888783 A CN202110888783 A CN 202110888783A CN 113591734 A CN113591734 A CN 113591734A
- Authority
- CN
- China
- Prior art keywords
- candidate
- value
- frames
- detection
- prediction
- 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.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 53
- 238000000034 method Methods 0.000 claims abstract description 29
- 238000012216 screening Methods 0.000 claims abstract description 16
- 238000004364 calculation method Methods 0.000 claims abstract description 11
- 238000012886 linear function Methods 0.000 claims description 9
- 230000007547 defect Effects 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000013135 deep learning Methods 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
- 239000013598 vector Substances 0.000 description 1
Images
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
Abstract
Aiming at the problems that the calculation process is rough and has larger calculation defects in the data processing process of the NMS algorithm, the invention improves the confidence zeroing method and the candidate screening frame by the greedy method in the fourth data calculation of the traditional NMS algorithm, and discloses a target detection method based on the improved NMS algorithm, which reduces the calculation workload and improves the detection efficiency; the method comprises the following steps: step 1) setting a fixed threshold value Sc when screening all candidate frames based on an NMS algorithm; step 2) carrying out descending order arrangement on the candidate frame set B; step 3) adding and retaining the highest confidence value in the candidate box set B to the set D, and removing A from the set B; step 4) calculating A, B I OU values of the remaining candidate frames in the two candidate frame sets, and improving a greedy screening process by adopting an area comparison method and an overlap length comparison method; step 5) carrying out the data processing process on all the candidate frame sets; and 6) carrying out 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 the detection precision and accelerates the 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 multilayer neural network structure, image data are converted into feature vectors which can be identified by a computer, feature information contained in the data is automatically learned through extraction of data features by the computer, and more abstract data features are finally obtained, so that the defect of feature calibration of advanced pedestrians is overcome, the network learning capability and the detection accuracy are greatly improved, and meanwhile, the target detection algorithm has strong generalization capability and robustness. The traditional target detection algorithm cannot meet the actual requirement on detection precision and has weak feature expression capability, so that the requirements of production practice and economic development cannot be met, and the deep learning target detection algorithm has strong functions. Comparing the performances of eight typical target detection algorithms, comparing the advantages and the disadvantages of the algorithms, drawing a conclusion, selecting a YOLOv4 algorithm with better performance on the data set to improve a non-maximum suppression algorithm, comparing the differences of detection precision and detection time before and after the improvement, displaying the advantages of the improved algorithm, and finally developing the improved YOLOv4 algorithm into software so as to be better applied to production practice.
Disclosure of Invention
Aiming at the problem that a large number of calculation defects exist 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 a pre-detection frame set of all candidates output by deep network calculation can be represented by B, data processing such as screening is carried out by adopting the NMS algorithm, an obtained detection frame set can be represented by D, a confidence value set corresponding to the candidate frame set 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 when the candidate frames are screened, and Nt represents an overlapping threshold value set when IOU calculation):
step 1) setting a fixed threshold Sc when all candidate frames are screened, and setting the confidence value of the pre-check frame with the confidence value smaller than the screening threshold in the candidate frame set B as 0;
step 2) performing descending arrangement on the candidate frame set B by taking the confidence value of the candidate frames as a basis;
step 3) adding and retaining the highest confidence value in the candidate box 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 overlap threshold Nt, and setting the confidence value of the candidate frame which is greater than the overlap threshold in the calculation result of the candidate frame set as 0;
step 5) according to a set fixed screening threshold value, performing the data processing processes of 2), 3) and 4) on the candidate frame set to complete the screening work of all candidate frames;
and 6) carrying out target detection based on the method.
Further, the specific method of the step 4) is as follows:
and (3) adjusting the confidence degree by using a piecewise function, wherein the key of the confidence degree adjustment lies in the determination mode of each linear function slope, the size of the slope and the division of the range of the value range. Taken together, 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 decay rate increases with the distance between the IOU and the overlap threshold, and the absolute value of the slope of each section area of the linear function should also increase. 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:
when there is no overlapping area between the detection frames of the detection pictures or the area difference is large, the speed of the detection algorithm is seriously affected. Based on this, in order to improve the detection rate of the NMS algorithm, two improvements are accomplished with respect to greedy screening of candidate boxes in the NMS algorithm:
a) the distribution of the areas of the prediction boxes a and B in the NMS algorithm may directly conclude that the IOU value between the two prediction boxes is less than the overlap threshold. When the IOU value of the prediction box is calculated in the algorithm, the inclusion relation of the two prediction boxes needs to be judged; the inclusion relationship existing between different prediction boxes can be roughly divided into four cases.
When the dense target detection is carried out, a part of the prediction frames which do not meet the requirements can be filtered by using the condition 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) Adding a decision formula before the step 4 of the NMS algorithm: firstly, whether the two prediction frames have overlapped areas or not is judged, and the IOU value is calculated only for the prediction frames with the overlapped areas. For the position distribution that may occur between the two boxes A, B, four cases can be finally classified (a and B represent the area size of the two boxes, w and h represent the length and width of the overlapping area of the two boxes, respectively, and the dotted line part in the figure represents that the length and width of the overlapping area do not exist, i.e. the dotted line represents that the length is 0).
Whether an overlapped area exists between the detection frames is judged by using a method whether min { w, h } is 0, and when no overlapped area exists between the detection frames, whether the prediction frame B is removed can be directly judged without calculating an IOU value.
Drawings
FIG. 1 is a schematic diagram of a conventional NMS algorithm detection;
FIG. 2 is a diagram of a conventional NMS algorithm prediction box position relationship;
FIG. 3 is a diagram of a conventional NMS algorithm overlap area relationship;
FIG. 4 is a comparison graph of the results of the detection by the YOLOv4 algorithm and the improved YOLOv4 algorithm;
fig. 5 is a diagram illustrating a conventional NMS algorithm detection process.
Detailed Description
The invention "a target detection method based on NMS algorithm" is further described with reference to the accompanying drawings.
And (3) adjusting the confidence level by using a piecewise function, wherein a specific function formula is shown as the following formula:
si=si*ci
in the formula: c. CiThe attenuation coefficient is shown, and the detailed values are as follows:
the key of the confidence degree adjustment is the determination mode of each linear function slope in the above formula, the size of the slope and the division of the value range. Taken together, the value of Nt is chosen to be 0.3. After the value of Nt is determined, the function interval is divided into five segments, the decay rate increases with the distance between the IOU and the overlap threshold, and the absolute value of the slope of each segment region of the linear function should also increase. The attenuation coefficient value of each piecewise linear function is calculated as follows:
when there is no overlapping area between the detection frames of the detection pictures or the area difference is large, the speed of the detection algorithm is seriously affected. Based on this, in order to improve the detection rate of the NMS algorithm, two improvements are accomplished with respect to greedy screening of candidate boxes in the NMS algorithm:
a) the distribution of the areas of the prediction boxes a and B in the NMS algorithm may directly conclude that the IOU value between the two prediction boxes is less than the overlap threshold. When the IOU value of the prediction box is calculated in the algorithm, the inclusion relation of the two prediction boxes needs to be judged; the inclusion relationships that exist between different prediction boxes can be roughly divided into four cases.
When the dense target detection is carried out, a part of the prediction frames which do not meet the requirements can be filtered by using the condition 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) Adding a decision formula before the step 4 of the NMS algorithm: first, it is determined whether or not the two prediction frames have an overlapping region, and the IOU value is calculated only for the prediction frame having the overlapping region. For the position distribution that may occur between the two boxes A, B, four cases can be finally classified (a and B represent the area size of the two boxes, w and h represent the length and width of the overlapping area of the two boxes, respectively, and the dotted line part in the figure represents that the length and width of the overlapping area do not exist, i.e. the dotted line represents that the length is 0).
Whether the detection frames are overlapped or not is judged by using a method of judging whether min { w, h } is 0 or not, and when the detection frames are not overlapped, whether the prediction frame B is removed or not can be directly judged without calculating an IOU value. Target detection is achieved based on the algorithm.
Claims (3)
1. A target detection method based on an improved NMS algorithm comprises the following steps (wherein a pre-detection frame set of all candidates output by deep network computing can be represented by B, data processing such as screening is carried out by adopting the NMS algorithm, an obtained detection frame set can be represented by D, a confidence value set corresponding to the candidate frame set 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 when the candidate frames are screened, and Nt represents an overlapping threshold value set when IOU is calculated):
step 1) setting a fixed threshold Sc when all candidate frames are screened, and setting the confidence value of the pre-check frame with the confidence value smaller than the screening threshold in the candidate frame set B as 0;
step 2) performing descending arrangement on the candidate frame set B by taking the confidence value of the candidate frames as a basis;
step 3) adding and retaining the highest confidence value in the candidate box 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 overlap threshold Nt, and setting the confidence value of the candidate frame which is greater than the overlap threshold in the calculation result of the candidate frame set as 0;
step 5) according to a set fixed screening threshold value, performing the data processing processes of 2), 3) and 4) on the candidate frame set to complete the screening work of all candidate frames;
and 6) carrying out target detection based on the method.
2. The method as claimed in claim 1, wherein the specific method of step 4) is as follows:
and (3) adjusting the confidence level by using a piecewise function, wherein the specific function is as follows:
si=si*ci
in the formula: c. CiThe attenuation coefficient is shown, and the detailed values are as follows:
the key of the confidence degree adjustment is the determination mode of each linear function slope in the above formula, the size of the slope and the division of the value range. Taken together, the value of Nt is chosen to be 0.3. After the value of Nt is determined, the function interval is divided into five segments, the decay rate increases with the distance between the IOU and the overlap threshold, and the absolute value of the slope of each segment region of the linear function should also increase. The attenuation coefficient value of each piecewise linear function is obtained by calculation:
3. the method as claimed in claim 1, wherein the specific method of step 4) is as follows:
when there is no overlapping area between the detection frames of the detection pictures or the area difference is large, the speed of the detection algorithm is seriously affected. Based on this, in order to improve the detection rate of the NMS algorithm, two improvements are done with greedy screening of candidate boxes in the NMS algorithm:
a) the distribution of the areas of the prediction boxes a and B in the NMS algorithm may directly conclude that the IOU value between the two prediction boxes is less than the overlap threshold. When the IOU value of the prediction box is calculated in the algorithm, the inclusion relation of the two prediction boxes needs to be judged; the inclusion relationship existing between different prediction boxes can be roughly divided intoA and B are B, A and B are A four conditions:
when the dense target detection is carried out, a part of the prediction frames which do not meet the requirements can be filtered by using the condition 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) Adding a decision formula before the step 4 of the NMS algorithm: first, it is determined whether or not the two prediction frames have an overlapping region, and the IOU value is calculated only for the prediction frame having the overlapping region. For the position distribution that may occur between A, B two frames, four cases can be classified finally (a and B represent the area size of the two frames, w and h represent the length and width of the overlapping area of the two frames, respectively, and the dotted line represents the absence of the length and width of the overlapping area, i.e. the dotted line represents the length of 0):
whether the detection frames are overlapped or not is judged by using a method of judging whether min { w, h } is 0 or not, and when the detection frames are not overlapped, whether the prediction frame B is removed or not can be directly judged without calculating an IOU value.
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 true CN113591734A (en) | 2021-11-02 |
CN113591734B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115410060A (en) * | 2022-11-01 | 2022-11-29 | 山东省人工智能研究院 | Public safety video-oriented global perception small target intelligent detection method |
Citations (5)
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 |
US20130321673A1 (en) * | 2012-05-31 | 2013-12-05 | Apple Inc. | Systems and Methods for Determining Noise Statistics of Image Data |
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 | 北京航空航天大学 | Target 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 |
-
2021
- 2021-08-03 CN CN202110888783.1A patent/CN113591734B/en active Active
Patent Citations (5)
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 |
US20130321673A1 (en) * | 2012-05-31 | 2013-12-05 | Apple Inc. | Systems and Methods for Determining Noise Statistics of Image Data |
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 | 北京航空航天大学 | Target detection method based on point cloud |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115410060A (en) * | 2022-11-01 | 2022-11-29 | 山东省人工智能研究院 | Public safety video-oriented global perception small target intelligent detection method |
Also Published As
Publication number | Publication date |
---|---|
CN113591734B (en) | 2024-02-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107563313B (en) | Multi-target pedestrian detection and tracking method based on deep learning | |
US9947077B2 (en) | Video object tracking in traffic monitoring | |
US7366330B2 (en) | Method, apparatus, and program for detecting faces | |
CN103927762B (en) | Target vehicle automatic tracking method and device | |
KR100247969B1 (en) | Apparatus and method for massive pattern matching | |
US20200193225A1 (en) | System and method for detecting objects in a digital image, and system and method for rescoring object detections | |
CN106327488B (en) | Self-adaptive foreground detection method and detection device thereof | |
CN111027475A (en) | Real-time traffic signal lamp identification method based on vision | |
CN111160407A (en) | Deep learning target detection method and system | |
CN111382784B (en) | Moving target tracking method | |
CN113591734A (en) | Target detection method based on improved NMS algorithm | |
CN109784145B (en) | Target detection method based on depth map and storage medium | |
CN117115415B (en) | Image marking processing method and system based on big data analysis | |
CN111931572B (en) | Target detection method for remote sensing image | |
CN110472640B (en) | Target detection model prediction frame processing method and device | |
CN110866484B (en) | Driver face detection method, computer device and computer readable storage medium | |
CN117011346A (en) | Blower image registration algorithm | |
Sari et al. | Text extraction from historical document images by the combination of several thresholding techniques | |
Nechyba et al. | Pittpatt face detection and tracking for the clear 2007 evaluation | |
CN112163580B (en) | Small target detection algorithm based on attention mechanism | |
CN110580706A (en) | Method and device for extracting video background model | |
CN110488823B (en) | Novel intelligent line patrol trolley control method | |
CN114359378A (en) | Method for positioning inspection robot of belt conveyor | |
CN111368625B (en) | Pedestrian target detection method based on cascade optimization | |
JP5786838B2 (en) | Image region dividing apparatus, method, and program |
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 |