CN112419263B - A multi-category non-maximum suppression method and system based on inter-class coverage ratio - Google Patents
A multi-category non-maximum suppression method and system based on inter-class coverage ratio Download PDFInfo
- Publication number
- CN112419263B CN112419263B CN202011312543.9A CN202011312543A CN112419263B CN 112419263 B CN112419263 B CN 112419263B CN 202011312543 A CN202011312543 A CN 202011312543A CN 112419263 B CN112419263 B CN 112419263B
- Authority
- CN
- China
- Prior art keywords
- frame
- prediction
- reference frame
- category
- inter
- 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
- 238000000034 method Methods 0.000 title claims abstract description 97
- 230000001629 suppression Effects 0.000 title claims description 61
- 238000012216 screening Methods 0.000 claims abstract description 14
- 238000004364 calculation method Methods 0.000 claims description 14
- 230000000717 retained effect Effects 0.000 claims description 10
- 230000001174 ascending effect Effects 0.000 claims description 3
- 238000001914 filtration Methods 0.000 claims 1
- 230000007547 defect Effects 0.000 abstract description 55
- 230000005764 inhibitory process Effects 0.000 abstract 1
- 238000001514 detection method Methods 0.000 description 40
- 238000010586 diagram Methods 0.000 description 33
- 238000004422 calculation algorithm Methods 0.000 description 8
- PCHJSUWPFVWCPO-UHFFFAOYSA-N gold Chemical compound [Au] PCHJSUWPFVWCPO-UHFFFAOYSA-N 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000013527 convolutional neural network Methods 0.000 description 6
- 238000003860 storage Methods 0.000 description 6
- 238000012360 testing method Methods 0.000 description 6
- 238000004590 computer program Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 5
- 238000010187 selection method Methods 0.000 description 3
- 238000009826 distribution Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000013136 deep learning model Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000012212 insulator Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- -1 textured surfaces Substances 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/0006—Industrial image inspection using a design-rule based approach
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Geometry (AREA)
- Quality & Reliability (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
Description
技术领域technical field
本发明涉及机器视觉的技术领域,尤其涉及一种基于类间覆盖比的多类别非极大抑制方法及系统。The present invention relates to the technical field of machine vision, in particular to a method and system for non-maximum suppression of multi-classes based on inter-class coverage ratio.
背景技术Background technique
缺陷检测利用机器视觉设备获取图像来判断采集图像中是否存在缺陷,同时实现输出检测缺陷的位置和类别,传统的基于机器视觉的表面缺陷检测方法,往往采用常规图像处理算法或人工设计特征加分类器方式;近些年来,随着深度学习技术的快速发展,缺陷检测算法也从基于人工特征的传统算法转向了基于深度神经网络的检测技术,以卷积神经网络(Convolutional Neural Networks,CNN)为代表的深度学习模型也在诸多产品的缺陷检测中成功应用。Defect detection uses machine vision equipment to acquire images to judge whether there are defects in the collected images, and at the same time realize the output of the location and category of detected defects. Traditional surface defect detection methods based on machine vision often use conventional image processing algorithms or manual design features plus classification In recent years, with the rapid development of deep learning technology, the defect detection algorithm has also shifted from the traditional algorithm based on artificial features to the detection technology based on deep neural network, with Convolutional Neural Networks (CNN) as the The representative deep learning model has also been successfully applied in the defect detection of many products.
基于CNN的缺陷检测方法与当前主流的基于CNN的目标检测方法有诸多类似之处,以Faster R-CNN网络做目标检测或缺陷检测为例,均通过卷积网络提取特征图,将特征图送入区域提取网络(Region Proposal Network,RPN)以生成大量可能含有待检目标或缺陷的预测框,经过分类与回归后保留2000个左右的预测框,再通过某些算法去除冗余预测框。The CNN-based defect detection method has many similarities with the current mainstream CNN-based target detection method. Taking the Faster R-CNN network as an example for target detection or defect detection, feature maps are extracted through convolutional networks, and the feature maps are sent to Import the Region Proposal Network (RPN) to generate a large number of prediction frames that may contain targets or defects to be checked. After classification and regression, about 2000 prediction frames are retained, and then redundant prediction frames are removed by some algorithms.
然而基于CNN的目标检测方法不能直接应用于产品的缺陷检测,因为目标检测中,一个大尺寸的目标中可能包含一个或若干个小尺寸的目标,但在缺陷检测中,一个大尺寸缺陷的内部不包含其他小尺寸的缺陷,也即缺陷类别不相容;此外,若干同类别缺陷聚集在一起时应将其识别为一个整体。However, CNN-based target detection methods cannot be directly applied to product defect detection, because in target detection, a large-sized target may contain one or several small-sized targets, but in defect detection, the interior of a large-sized defect Defects of other small sizes are not included, that is, the defect categories are incompatible; in addition, when several defects of the same category are gathered together, they should be identified as a whole.
发明内容Contents of the invention
本部分的目的在于概述本发明的实施例的一些方面以及简要介绍一些较佳实施例。在本部分以及本申请的说明书摘要和发明名称中可能会做些简化或省略以避免使本部分、说明书摘要和发明名称的目的模糊,而这种简化或省略不能用于限制本发明的范围。The purpose of this section is to outline some aspects of embodiments of the invention and briefly describe some preferred embodiments. Some simplifications or omissions may be made in this section, as well as in the abstract and titles of this application, to avoid obscuring the purpose of this section, the abstract and titles, and such simplifications or omissions should not be used to limit the scope of the invention.
鉴于上述现有存在的问题,提出了本发明。In view of the above existing problems, the present invention is proposed.
因此,本发明提供了一种基于类间覆盖比的多类别非极大抑制方法,能够准确反映面积相差大的预测框之间的重叠程度,同时能够在检测过程中,筛除不同类别预测框及合并相同类别预测框,解决了现有技术中预测框筛选不准确以及适用范围有限的问题。Therefore, the present invention provides a multi-category non-maximum suppression method based on the inter-class coverage ratio, which can accurately reflect the degree of overlap between prediction frames with large area differences, and can screen out different types of prediction frames during the detection process. And merging prediction frames of the same category solves the problems of inaccurate screening of prediction frames and limited scope of application in the prior art.
为解决上述技术问题,本发明提供如下技术方案:包括,设定类别置信度阈值,并删除预测框集合中所有类别置信度小于所述阈值的预测框;通过计算所述预测框之间的重叠度筛选预测框;通过计算基准框和对照框的重叠区域在所述基准框中所占的比例判断所述基准框和对照框之间的包含关系;若所述比例小于设定比例阈值,则判定所述对照框不包含所述基准框,并将所述基准框从所述预测框集合中去除,将所述基准框添加至空集合;否则,判定所述对照框包含所述基准框,并在所述对照框中选定面积最小框,利用类间择优选择策略筛选所述基准框和最小框;判断所述预测框集合是否为空,若所述预测框集合不为空,则继续筛除剩余的预测框;否则,输出所述空集合。In order to solve the above-mentioned technical problems, the present invention provides the following technical solutions: including, setting a category confidence threshold, and deleting all prediction boxes in the prediction box set whose category confidence is less than the threshold; by calculating the overlap between the prediction boxes degree screening prediction frame; by calculating the ratio of the overlapping area of the reference frame and the comparison frame in the reference frame to determine the containment relationship between the reference frame and the comparison frame; if the ratio is less than the set ratio threshold, then Determining that the reference frame does not contain the reference frame, removing the reference frame from the predicted frame set, adding the reference frame to an empty set; otherwise, determining that the reference frame contains the reference frame, And select the frame with the smallest area in the comparison frame, and use the inter-class selection strategy to screen the reference frame and the smallest frame; judge whether the set of predicted frames is empty, if the set of predicted frames is not empty, continue Filter out the remaining predicted boxes; otherwise, output the empty set.
作为本发明所述的基于类间覆盖比的多类别非极大抑制方法的一种优选方案,其中:所述计算重叠度包括,将所述预测框集合B中的预测框根据所述类别置信度降序排序;所述重叠度如下式:As a preferred solution of the multi-category non-maximum suppression method based on the inter-class coverage ratio in the present invention, wherein: the calculation of the degree of overlap includes, the predicted boxes in the predicted box set B according to the category confidence Sort in descending order; the degree of overlap is as follows:
其中,COPBoM为所述基准框M与对照框Bo的重叠区域在对照框中所占比例,SMBo为基准框M与对照框Bo重叠区域面积,SBo为对照框面积,所述基准框M为所述类别置信度最大的预测框,所述对照框Bo为其余预测框。Wherein, COP BoM is the proportion of the overlapping area of the reference frame M and the reference frame Bo in the reference frame, S MBo is the overlapping area of the reference frame M and the reference frame Bo, S Bo is the area of the reference frame, and the reference frame M is the prediction frame with the highest confidence of the category, and the control frame Bo is the remaining prediction frames.
作为本发明所述的基于类间覆盖比的多类别非极大抑制方法的一种优选方案,其中:所述筛选预测框包括,若所述COPBoM大于重叠阈值,则将所述基准框M和所述对照框Bo从所述预测框集合中去除,并将所述基准框M添加到所述空集合D;否则,将所述基准框M从所述预测框集合B中去除,同时将所述基准框M添加到所述空集合D。As a preferred solution of the multi-category non-maximum suppression method based on the inter-class coverage ratio in the present invention, wherein: the screening prediction frame includes, if the COP BoM is greater than the overlapping threshold, then the reference frame M and the comparison frame Bo are removed from the prediction frame set, and the reference frame M is added to the empty set D; otherwise, the reference frame M is removed from the prediction frame set B, and the The reference frame M is added to the empty set D.
作为本发明所述的基于类间覆盖比的多类别非极大抑制方法的一种优选方案,其中:所述筛选预测框还包括,判断所述预测框集合B是否为空,若不为空,则继续筛选所述预测框;否则,输出所述空集合D中的预测框。As a preferred solution of the multi-category non-maximum suppression method based on the inter-class coverage ratio in the present invention, wherein: the screening prediction frame also includes, judging whether the prediction frame set B is empty, if not empty , then continue to screen the prediction boxes; otherwise, output the prediction boxes in the empty set D.
作为本发明所述的基于类间覆盖比的多类别非极大抑制方法的一种优选方案,其中:所述重叠阈值包括,所述重叠阈值等于0.8。As a preferred solution of the multi-category non-maximum suppression method based on the inter-class coverage ratio in the present invention, wherein: the overlapping threshold includes, and the overlapping threshold is equal to 0.8.
作为本发明所述的基于类间覆盖比的多类别非极大抑制方法的一种优选方案,其中:所述计算比例包括,将所述预测框集合B中预测框依据预测框面积升序排序;按照下式计算所述基准框和对照框的重叠区域在所述基准框中所占的比例COPMBo:As a preferred solution of the multi-category non-maximum suppression method based on the inter-class coverage ratio in the present invention, wherein: the calculation ratio includes sorting the prediction frames in the prediction frame set B in ascending order according to the area of the prediction frames; Calculate the ratio COP MBo of the overlapping area of the reference frame and the comparison frame in the reference frame according to the following formula:
其中,SM为基准框面积,面积最小的预测框标记为基准框M1;其余预测框标记为对照框Bo1;Among them, S M is the area of the reference frame, and the prediction frame with the smallest area is marked as the reference frame M1; the remaining prediction frames are marked as the comparison frame Bo1;
作为本发明所述的基于类间覆盖比的多类别非极大抑制方法的一种优选方案,其中:所述类间择优选择策略包括,判断所述基准框M1与最小框N的类别是否相同,若所述类别不同,则保留类别置信度高的预测框,去除类别置信度低的预测框;若所述类别相同,则计算两个预测框的类别置信度差值。As a preferred solution of the multi-category non-maximum suppression method based on the inter-class coverage ratio in the present invention, wherein: the inter-class selection strategy includes judging whether the categories of the reference frame M1 and the minimum frame N are the same , if the categories are different, keep the prediction box with high category confidence, and remove the prediction box with low category confidence; if the categories are the same, calculate the difference between the category confidence of the two prediction boxes.
作为本发明所述的基于类间覆盖比的多类别非极大抑制方法的一种优选方案,其中:所述类别置信度差值包括,若所述差值大于设定差值阈值,则保留类别置信度较高的预测框,并去除另一个预测框;否则,保留面积较大的预测框和所述类别置信度值较高的预测框。As a preferred solution of the multi-category non-maximum suppression method based on the inter-class coverage ratio in the present invention, wherein: the category confidence difference includes, if the difference is greater than the set difference threshold, keep The prediction box with a higher category confidence is removed, and the other prediction box is removed; otherwise, the prediction box with a larger area and the prediction box with a higher confidence value for the category are retained.
作为本发明所述的基于类间覆盖比的多类别非极大抑制系统的一种优选方案,其中:包括,输入模块,用于向系统输入预测框集合和空集合;粗选模块,与所述输入模块连接,其用于筛除类别置信度非常低的冗余框;Score-NMS模块,与所述粗选模块连接,其用于筛除重叠度较高的预测框;Area-NMS模块,与所述Score-NMS模块连接,其用于对所述Score-NMS模块筛除留下的预测框做进一步筛除。As a preferred solution of the multi-category non-maximum suppression system based on the inter-class coverage ratio of the present invention, it includes: an input module, which is used to input a prediction frame set and an empty set to the system; a rough selection module, and the The input module is connected, and it is used to screen out redundant frames with very low class confidence; the Score-NMS module is connected to the rough selection module, and it is used to screen out the prediction frames with a high degree of overlap; the Area-NMS module , connected to the Score-NMS module, which is used to further filter out the prediction frames left by the Score-NMS module.
本发明的有益效果:本发明提出了COP参数,能够准确衡量不同面积预测框之间的重叠程度;通过运用类间择优选择策略提升了缺陷定位准确度;另外,本发明可适用于多种类别缺陷的检测,同时适用于半导体、高铁线路紧固件、输电铁塔绝缘子、纹理表面、金属表面等多种物体的外观缺陷检测。Beneficial effects of the present invention: the present invention proposes COP parameters, which can accurately measure the degree of overlap between prediction frames of different areas; the accuracy of defect location is improved by using the optimal selection strategy between classes; in addition, the present invention is applicable to various categories The detection of defects is also applicable to the detection of appearance defects of various objects such as semiconductors, high-speed rail line fasteners, transmission tower insulators, textured surfaces, and metal surfaces.
附图说明Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。其中:In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without any creative effort. in:
图1为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的流程示意图;Fig. 1 is a schematic flow chart of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图2为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的所述COPBoM计算方法示意图;2 is a schematic diagram of the COP BoM calculation method of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图3为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的所述COPMBo计算方法示意图;3 is a schematic diagram of the COP MBo calculation method of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图4为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的预测框包含关系示意图;Fig. 4 is a schematic diagram of the prediction frame inclusion relationship of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图5为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的类间择优选择方法流程示意图;Fig. 5 is a schematic flow chart of a method for class selection based on a multi-class non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图6为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的类间择优选择实施前缺陷检测示意图;Fig. 6 is a schematic diagram of defect detection before implementation of inter-class preference in a multi-class non-maximum suppression method based on inter-class coverage ratio described in the first embodiment of the present invention;
图7为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的第一次类间择优选择完成后缺陷检测示意图;Fig. 7 is a schematic diagram of defect detection after the first inter-class optimal selection of a multi-class non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图8为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的第二次类间择优选择完成后缺陷检测示意图;Fig. 8 is a schematic diagram of defect detection after the second inter-class selection of a multi-class non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图9为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的第三次类间择优选择完成后缺陷检测示意图;9 is a schematic diagram of defect detection after the third inter-class selection of a multi-class non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图10为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的含有Foreign_M缺陷的样本示意图;Fig. 10 is a schematic diagram of samples containing Foreign_M defects of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图11为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的含有Gold_P缺陷的样本示意图;Fig. 11 is a schematic diagram of samples containing Gold_P defects of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图12为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的含有Raw_M缺陷的样本示意图;Fig. 12 is a schematic diagram of samples containing Raw_M defects of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图13为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的当前的多类别NMS方法对Foreign_M缺陷样本的检测结果示意图;13 is a schematic diagram of the detection results of Foreign_M defect samples by the current multi-class NMS method based on the inter-class coverage ratio multi-class non-maximum suppression method described in the first embodiment of the present invention;
图14为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的当前的多类别NMS方法对Gold_P缺陷样本的检测结果示意图;14 is a schematic diagram of the detection results of Gold_P defect samples by the current multi-category NMS method based on the inter-class coverage ratio multi-category non-maximum suppression method described in the first embodiment of the present invention;
图15为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的当前的多类别NMS方法对Raw_M缺陷样本的检测结果示意图;15 is a schematic diagram of the detection results of Raw_M defect samples by the current multi-class NMS method based on the inter-class coverage ratio multi-class non-maximum suppression method described in the first embodiment of the present invention;
图16为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的本方法对Foreign_M缺陷样本的检测结果示意图;Fig. 16 is a schematic diagram of the detection results of Foreign_M defect samples by this method of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图17为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的本方法对Gold_P缺陷样本的检测结果示意图;Fig. 17 is a schematic diagram of the detection results of Gold_P defect samples by this method of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图18为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的对Raw_M缺陷样本的检测结果示意图;Fig. 18 is a schematic diagram of the detection results of Raw_M defect samples of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图19为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的IoU计算方法示意图;19 is a schematic diagram of an IoU calculation method of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图20为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的采用IoU衡量重叠度检测Gold_P的检测结果示意图;Fig. 20 is a schematic diagram of the detection result of Gold_P using IoU to measure the overlapping degree of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图21为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的采用COP衡量重叠度检测Gold_P的检测结果示意图;Fig. 21 is a schematic diagram of the detection result of Gold_P measured by COP in a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图22为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的当前的多类别NMS方法对Incomplete_B的检测结果示意图;Fig. 22 is a schematic diagram of the detection results of Incomplete_B by the current multi-class NMS method of a multi-class non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图23为本发明第一个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的本方法对Incomplete_B的检测结果示意图;Fig. 23 is a schematic diagram of the detection result of Incomplete_B by this method of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the first embodiment of the present invention;
图24为本发明第二个实施例所述的一种计算重叠度COPBoM的方法的流程示意图;Fig. 24 is a schematic flowchart of a method for calculating the degree of overlap COP BoM according to the second embodiment of the present invention;
图25为本发明第二个实施例所述的一种计算重叠度COPBoM的方法的COPBoM计算方法示意图;Fig. 25 is a schematic diagram of a COP BoM calculation method of a method for calculating the overlap degree COP BoM described in the second embodiment of the present invention;
图26为本发明第三个实施例所述的一种基于类间覆盖比的多类别非极大抑制系统的模块结构分布示意图;26 is a schematic diagram of the module structure distribution of a multi-class non-maximum suppression system based on the inter-class coverage ratio described in the third embodiment of the present invention;
图27为本发明第三个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的网络拓扑结构示意图;FIG. 27 is a schematic diagram of the network topology of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the third embodiment of the present invention;
图28为本发明第三个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的Score-NMS模块300算法流程示意图;FIG. 28 is a schematic flowchart of the Score-
图29为本发明第三个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的Area-NMS模块400算法流程示意图;FIG. 29 is a schematic flowchart of the Area-
图30为本发明第三个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的输入的预测框示意图;Fig. 30 is a schematic diagram of the input prediction frame of a multi-category non-maximum suppression method based on the inter-class coverage ratio described in the third embodiment of the present invention;
图31为本发明第三个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的粗选模块200完成预测框筛选后的结果示意图;FIG. 31 is a schematic diagram of the result after the
图32为本发明第三个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的Score-NMS模块300完成预测框筛选后的结果示意图;FIG. 32 is a schematic diagram of the results of the Score-
图33为本发明第三个实施例所述的一种基于类间覆盖比的多类别非极大抑制方法的Area-NMS模块400完成预测框筛选后的结果示意图;FIG. 33 is a schematic diagram of the results of the Area-
图34为本发明第四个实施例所述的一种多类别非极大抑制系统的模块结构分布示意图;Fig. 34 is a schematic diagram of the module structure distribution of a multi-category non-maximum suppression system described in the fourth embodiment of the present invention;
图35为本发明第四个实施例所述的一种多类别非极大抑制系统的网络拓扑结构示意图。Fig. 35 is a schematic diagram of the network topology of a multi-category non-maximum suppression system according to the fourth embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合说明书附图对本发明的具体实施方式做详细的说明,显然所描述的实施例是本发明的一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明的保护的范围。In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation modes of the present invention will be described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Example. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative efforts shall fall within the protection scope of the present invention.
在下面的描述中阐述了很多具体细节以便于充分理解本发明,但是本发明还可以采用其他不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本发明内涵的情况下做类似推广,因此本发明不受下面公开的具体实施例的限制。In the following description, a lot of specific details are set forth in order to fully understand the present invention, but the present invention can also be implemented in other ways different from those described here, and those skilled in the art can do it without departing from the meaning of the present invention. By analogy, the present invention is therefore not limited to the specific examples disclosed below.
其次,此处所称的“一个实施例”或“实施例”是指可包含于本发明至少一个实现方式中的特定特征、结构或特性。在本说明书中不同地方出现的“在一个实施例中”并非均指同一个实施例,也不是单独的或选择性的与其他实施例互相排斥的实施例。Second, "one embodiment" or "an embodiment" referred to herein refers to a specific feature, structure or characteristic that may be included in at least one implementation of the present invention. "In one embodiment" appearing in different places in this specification does not all refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments.
本发明结合示意图进行详细描述,在详述本发明实施例时,为便于说明,表示器件结构的剖面图会不依一般比例作局部放大,而且所述示意图只是示例,其在此不应限制本发明保护的范围。此外,在实际制作中应包含长度、宽度及深度的三维空间尺寸。The present invention is described in detail in conjunction with schematic diagrams. When describing the embodiments of the present invention in detail, for the convenience of explanation, the cross-sectional view showing the device structure will not be partially enlarged according to the general scale, and the schematic diagram is only an example, which should not limit the present invention. scope of protection. In addition, the three-dimensional space dimensions of length, width and depth should be included in actual production.
同时在本发明的描述中,需要说明的是,术语中的“上、下、内和外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一、第二或第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。At the same time, in the description of the present invention, it should be noted that the orientation or positional relationship indicated by "upper, lower, inner and outer" in the terms is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention. The invention and the simplified description do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and thus should not be construed as limiting the present invention. In addition, the terms "first, second or third" are used for descriptive purposes only, and should not be construed as indicating or implying relative importance.
本发明中除非另有明确的规定和限定,术语“安装、相连、连接”应做广义理解,例如:可以是固定连接、可拆卸连接或一体式连接;同样可以是机械连接、电连接或直接连接,也可以通过中间媒介间接相连,也可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。Unless otherwise specified and limited in the present invention, the term "installation, connection, connection" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integrated connection; it can also be a mechanical connection, an electrical connection or a direct connection. A connection can also be an indirect connection through an intermediary, or it can be an internal communication between two elements. Those of ordinary skill in the art can understand the specific meanings of the above terms in the present invention in specific situations.
实施例1Example 1
参照图1~图23,为本发明的第一个实施例,该实施例提供了一种基于类间覆盖比的多类别非极大抑制方法,包括:With reference to Fig. 1~Fig. 23, be the first embodiment of the present invention, this embodiment provides a kind of multi-category non-maximum suppression method based on inter-class coverage ratio, including:
S1:设定类别置信度阈值,并删除预测框集合中所有类别置信度小于阈值的预测框。S1: Set the category confidence threshold, and delete all prediction boxes in the prediction box set whose category confidence is less than the threshold.
S2:通过计算预测框之间的重叠度筛选预测框。S2: Filter the prediction boxes by calculating the overlap between the prediction boxes.
具体的,筛选预测框的步骤如下:Specifically, the steps of screening the prediction box are as follows:
(1)假设输入的预测框集合为B,空集合为D;(1) Assume that the input prediction box set is B, and the empty set is D;
(2)将集合B中的预测框依据类别置信度进行降序排序;(2) Sort the prediction frames in the set B in descending order according to the category confidence;
(3)将类别置信度最大的预测框标记为基准框,记为M;其余预测框标记为对照框,记为Bo;定义基准框与对照框的重叠区域在对照框中所占比例为COPBoM,即重叠度,如图2所示;(3) Mark the prediction frame with the highest category confidence as the reference frame, denoted as M; the remaining prediction frames are marked as the control frame, denoted as Bo; define the proportion of the overlapping area between the reference frame and the reference frame in the reference frame as COP BoM , that is, degree of overlap, as shown in Figure 2;
具体的,按下式计算重叠度COPBoM:Specifically, the overlap degree COP BoM is calculated as follows:
其中,SMBo为基准框M与对照框Bo重叠区域面积,SBo为对照框面积,COP(COverPercent)为两个预测框重叠区域在指定预测框中所占比例;Among them, S MBo is the overlapping area of the reference frame M and the control frame Bo, S Bo is the area of the control frame, and COP (COverPercent) is the proportion of the overlapping area of the two prediction frames in the specified prediction frame;
(4)设定重叠阈值为0.8,根据COPBoM与设定阈值的关系,判断基准框M与对照框Bo是否存在重叠关系;若COPBoM大于阈值,则表明基准框M与对照框Bo相互重叠,将基准框M和对照框Bo都从集合B中去除同时添加M到集合D中;若COPBoM小于阈值,则表明无重叠关系,将基准框M从集合B中去除的同时添加M到集合D中;(4) Set the overlapping threshold to 0.8. According to the relationship between the COP BoM and the set threshold, judge whether there is an overlapping relationship between the reference frame M and the comparison frame Bo; if the COP BoM is greater than the threshold, it indicates that the reference frame M and the comparison frame Bo overlap each other , remove both the reference frame M and the control frame Bo from the set B and add M to the set D; if the COP BoM is less than the threshold, it indicates that there is no overlapping relationship, remove the reference frame M from the set B and add M to the set D;
(5)判断集合B是否为空;若不为空,则集合B中的预测框按步骤(2)~(4)进行循环筛选,直至集合B为空时停止循环;若为空,则输出集合D中的预测框。(5) Determine whether the set B is empty; if it is not empty, the prediction box in the set B will be cyclically screened according to steps (2) to (4), until the set B is empty and stop the loop; if it is empty, then output Predicted boxes in set D.
S3:通过计算基准框和对照框的重叠区域在基准框中所占的比例判断基准框和对照框之间的包含关系。S3: Determine the containment relationship between the reference frame and the reference frame by calculating the proportion of the overlapping area of the reference frame and the comparison frame in the reference frame.
具体的,判断基准框和对照框之间的包含关系的步骤如下:Specifically, the steps for judging the containment relationship between the reference frame and the comparison frame are as follows:
(1)将集合B中的预测框依据预测框面积进行升序排序;(1) Sort the prediction frames in the set B in ascending order according to the area of the prediction frames;
(2)将面积最小的预测框标记为基准框M1;其余预测框标记为对照框Bo1;定义基准框和对照框的重叠区域在基准框中所占的比例为COPMBo;(2) the prediction frame with the minimum area is marked as reference frame M1; All the other prediction frames are marked as reference frame Bo1; the ratio of the overlapping area defining reference frame and reference frame in reference frame is COP MBo ;
具体的,按照下式计算COPMBo:Specifically, the COP MBo is calculated according to the following formula:
其中,SM为基准框面积,SMBo为基准框M1与对照框Bo1重叠区域面积;Among them, S M is the area of the reference frame, and S MBo is the overlapping area of the reference frame M1 and the control frame Bo1;
(3)设定比例阈值,根据COPMBo与阈值的关系,判断基准框M1与对照框Bo1之间是否存在包含关系;若基准框与对照框的COPMBo大于设定阈值,说明重叠区域在基准框中所占比例较大,则判定对照框包含基准框,如图4所示;若基准框与对照框的COPMBo小于设定阈值,则判定对照框不包含基准框。(3) Set the ratio threshold, and judge whether there is an inclusion relationship between the reference frame M1 and the comparison frame Bo1 according to the relationship between the COP MBo and the threshold; if the COP MBo of the reference frame and the comparison frame is greater than the set threshold, it means that the overlapping area is within If the proportion of the frame is larger, it is determined that the reference frame contains the reference frame, as shown in Figure 4; if the COP MBo of the reference frame and the reference frame is less than the set threshold, it is determined that the reference frame does not contain the reference frame.
S4:若对照框不包含基准框,则将基准框M1从预测框集合B中去除,并将基准框M1添加至空集合D。S4: If the reference frame does not contain the reference frame, remove the reference frame M1 from the prediction frame set B, and add the reference frame M1 to the empty set D.
S5:若对照框Bo1包含基准框M1,则在对照框Bo1中选定面积最小框N,利用类间择优选择策略筛选基准框M1和最小框N。S5: If the comparison frame Bo1 contains the reference frame M1, select the smallest area frame N in the comparison frame Bo1, and use the inter-class selection strategy to screen the reference frame M1 and the smallest frame N.
其中需要说明的是,类间择优选择策略分为不同类别预测框之间的择优选择和相同类别预测框之间的择优选择。It should be noted that the optimal selection strategy between classes is divided into the optimal selection between prediction boxes of different categories and the optimal selection between prediction boxes of the same category.
具体的,判断基准框M1与最小框N的类别是否相同,参照图5;Specifically, determine whether the categories of the reference frame M1 and the smallest frame N are the same, refer to FIG. 5 ;
(1)若类别不同,则保留类别置信度高的预测框,去除类别置信度低的预测框;(1) If the categories are different, keep the prediction frame with high confidence in the category and remove the prediction frame with low confidence in the category;
(2)若类别相同,计算两个预测框的类别置信度差值。(2) If the categories are the same, calculate the category confidence difference between the two prediction boxes.
①如果差值大于设定的差值阈值,则保留拥有较大类别置信度的预测框,去除另一个预测框;① If the difference is greater than the set difference threshold, keep the prediction frame with a larger category confidence and remove the other prediction frame;
②如果差值小于设定阈值,则将两个预测框进行合并,即保留面积较大的预测框的同时保留较大的类别置信度值。② If the difference is less than the set threshold, the two prediction frames are merged, that is, the prediction frame with a larger area is retained while a larger category confidence value is retained.
需要说明的是,本实施例共完成三次类间择优选择,图6为类间择优选择实施前的缺陷检测图,图中保留有四个类别相同(均为“Foreign_M”)的预测框(编号为1-4),预测框及其类别置信度依次为:1:0.94、2:0.60、3:0.58、4:0.44。It should be noted that, in this embodiment, a total of three inter-category selections have been completed. Figure 6 is a defect detection diagram before the implementation of inter-category selection. In the figure, there are four prediction boxes (No. is 1-4), the prediction frame and its category confidence are as follows: 1:0.94, 2:0.60, 3:0.58, 4:0.44.
在第一次类间择优选择中标记面积最小预测框1为基准框,标记预测框2为对照框,通过计算可以判定对照框较基准框面积大,基准框较对照框类别置信度大,同时基准框和对照框的类别置信度差值小于设定阈值;所以将两个预测框进行合并,即保留预测框2同时将预测框1的类别置信度值0.94赋给预测框2,去除预测框1。In the first inter-class selection, the predicted
如图7,第一次类间择优选择完成后,保留的预测框及其类别置信度依次为:2:0.94、3:0.58、4:0.44;As shown in Figure 7, after the first inter-class selection is completed, the reserved prediction frame and its category confidence are as follows: 2:0.94, 3:0.58, 4:0.44;
在第二次类间择优选择中预测框2、3的类别置信度差值同样小于设定阈值,所以保留预测框3同时保留类别置信度值0.94,去除预测框2,如图8所示;In the second inter-class selection, the category confidence difference between
在第三次类间择优选择中预测框3、4的类别置信度差值大于设定阈值,所以直接保留预测框3,去除预测框2,如图9所示;In the third inter-class selection, the category confidence difference between the
较佳的是,通过类间择优选择提升了缺陷定位准确度。Preferably, the accuracy of defect location is improved through class selection.
S6:判断预测框集合B是否为空,若预测框集合不为空,则继续筛除剩余的预测框;否则,输出空集合。S6: Determine whether the prediction frame set B is empty, if the prediction frame set is not empty, continue to screen out the remaining prediction frames; otherwise, output an empty set.
若预测框集合B不为空,则集合B中的预测框按步骤S3~S5进行循环,直至预测框集合B为空时停止循环;若为空,则输出集合D中的预测框。If the prediction frame set B is not empty, then the prediction frames in the set B are cycled according to steps S3-S5, and the cycle is stopped when the prediction frame set B is empty; if it is empty, the prediction frames in the set D are output.
为了对本方法中采用的技术效果加以验证说明,本实施例选择当前多类别NMS方法和采用本方法进行对比测试,以科学论证的手段对比试验结果,以验证本方法所具有的真实效果。In order to verify and explain the technical effect adopted in this method, this embodiment chooses the current multi-category NMS method and adopts this method to conduct a comparative test, and compares the test results by means of scientific demonstration to verify the real effect of this method.
当前的多类别NMS方法对冗余去除不够充分,缺陷定位不够准确;The current multi-category NMS method is not sufficient for redundancy removal, and the defect location is not accurate enough;
为验证本方法相对当前的多类别NMS(Non-Maximum Suppression,非极大值抑制)方法具有较高的衡量重叠程度准确率和缺陷定位准确度,本实施例中采用当前的多类别NMS方法和本方法分别在实际缺陷样本中进行训练与测试对比。In order to verify that this method has a higher degree of overlap measurement accuracy and defect location accuracy than the current multi-category NMS (Non-Maximum Suppression, non-maximum suppression) method, the present embodiment adopts the current multi-category NMS method and This method performs training and testing comparisons in actual defect samples.
数据集共包含2200个缺陷样本,8个类别缺陷,其中训练集包含2000个样本,测试集包含200个样本,其中三个缺陷样本分别如图10、图11、图12所示,其中图10为样本1,含有Foreign_M缺陷;图11为样本2,含有Gold_P缺陷;图12为样本3,含有Raw_M缺陷;当前的多类别NMS方法在三个缺陷样本中的检测结果分别如图13、图14、图15所示,本方法在三个缺陷样本的检测结果如图16、图17、和图18所示。The data set contains a total of 2200 defect samples and 8 categories of defects, of which the training set contains 2000 samples, and the test set contains 200 samples. Three of the defect samples are shown in Figure 10, Figure 11, and Figure 12, respectively. It is
(1)参照图13,可见当前多类别NMS算法缺陷检测后保留4个预测框,预测框之间相互重叠,冗余去除不够充分,缺陷定位不够准确;而经过本方法的检测后,如图16所示,保留了一个预测框,说明缺陷类别置信度高,缺陷定位更加准确,其他的样本皆有此效果。(1) Referring to Figure 13, it can be seen that the current multi-category NMS algorithm retains 4 prediction frames after defect detection, and the prediction frames overlap each other, the redundancy removal is not sufficient, and the defect location is not accurate enough; after the detection of this method, as shown in Fig. As shown in Figure 16, a prediction box is retained, indicating that the confidence of the defect category is high, and the defect location is more accurate, and other samples have this effect.
(2)为验证本方法能准确衡量不同面积预测框之间的重叠程度,以当前的多类别NMS方法和本方法在“Gold_P”缺陷样本中的检测结果为例,分别采用前的多类别NMS方法的IoU(Intersection over Union,两个预测框的交集面积与并集面积的比值)参数计算方法和本方法的COP参数计算方法来衡量预测框的重叠程度;图20为当前的多类别NMS方法的检测结果,其中预测框1、2的坐标分别为:(2) In order to verify that this method can accurately measure the degree of overlap between prediction frames of different areas, taking the current multi-category NMS method and the detection results of this method in the "Gold_P" defect sample as examples, the previous multi-category NMS The method's IoU (Intersection over Union, the ratio of the intersection area of two prediction frames to the union area) parameter calculation method and the COP parameter calculation method of this method are used to measure the degree of overlap of the prediction frames; Figure 20 shows the current multi-category NMS method The detection results of , where the coordinates of predicted
经计算可得预测框1、2的各自面积和交集面积:After calculation, the respective areas and intersection areas of prediction frames 1 and 2 can be obtained:
①通过当前的多类别NMS方法中的IoU参数的计算方法(如图19)可以得到预测框1、2的IoU:① The IoU of prediction frames 1 and 2 can be obtained through the calculation method of IoU parameters in the current multi-category NMS method (as shown in Figure 19):
可以发现,当前预测框1、2的IoU小于设定阈值(通常为0.7左右),此时预测框1、2实际相互重叠,然而IoU却未能准确衡量重叠程度,导致冗余框去除不完全。It can be found that the IoU of the current prediction frames 1 and 2 is less than the set threshold (usually around 0.7), and the prediction frames 1 and 2 actually overlap each other at this time, but the IoU cannot accurately measure the degree of overlap, resulting in incomplete removal of redundant frames .
②通过本方法中的COP参数的计算方法可以得到预测框1、2的COP:② The COP of prediction frames 1 and 2 can be obtained by calculating the COP parameter in this method:
可以发现,本方法中的COP参数计算方法得到的预测框1、2的COP可以准确衡量重叠程度,经本方法处理后的结果如图21所示。It can be found that the COPs of prediction frames 1 and 2 obtained by the COP parameter calculation method in this method can accurately measure the degree of overlap, and the result after processing by this method is shown in Figure 21.
(3)以当前多类别NMS算法和本发明技术方案在“Incomplete_B”缺陷样本中的检测结果为例;如图22,用当前的多类别NMS方法检测缺陷样本后会在同一个缺陷位置保留两个不同类别的预测框,即Incomplete_B:0.96和Gold_P:0.11,然而这并不符合缺陷检测中缺陷类别不相容的需要。(3) Take the detection results of the current multi-category NMS algorithm and the technical solution of the present invention in the "Incomplete_B" defect sample as an example; as shown in Figure 22, after using the current multi-category NMS method to detect defect samples, two prediction boxes of different categories, that is, Incomplete_B: 0.96 and Gold_P: 0.11, however, this does not meet the need for defect category incompatibility in defect detection.
而本发明构建的类别不相容的非极大抑制方案可以使得检测后仅保留一个类别预测框,即Incomplete_B:0.96,如图23。However, the class-incompatible non-maximum suppression scheme constructed by the present invention can keep only one class prediction frame after detection, that is, Incomplete_B: 0.96, as shown in FIG. 23 .
实施例2Example 2
参照图24~图25,为本发明的第2个实施例,与实施例1不同的是,本实施例提出了一种计算重叠度COPBoM的方法,包括:Referring to Fig. 24 to Fig. 25, it is the second embodiment of the present invention. The difference from
S1:以类别置信度最大的预测框为基准框,除类别置信度最大预测框之外的其他预测框为对照框。S1: The predicted frame with the highest category confidence is used as the reference frame, and the other predicted frames except the predicted frame with the highest category confidence are used as control frames.
S2:计算基准框与对照框的重叠区域在基准框中所占比例,即为COPBoM。S2: Calculate the proportion of the overlapping area between the reference frame and the reference frame in the reference frame, which is the COP BoM .
计算公式如下:Calculated as follows:
实施例3Example 3
参照图26~图33,为本发明的第3个实施例,与实施例1和2不同的是,本实施例提出了一种基于类间覆盖比的多类别非极大抑制系统,包括:Referring to Fig. 26 to Fig. 33, it is the third embodiment of the present invention. Different from
输入模块100,用于向系统输入预测框集合和空集合。The
粗选模块200,与输入模块100连接,其用于筛除类别置信度非常低的冗余框。The
Score-NMS模块300,与粗选模块200连接,其用于接收粗选模块200传来的预测框集合和空集合以及用于筛除重叠度较高的预测框;具体的,参照28,Score-NMS模块300基于类别置信度(Score)的非极大抑制,以类别置信度为标准,通过计算COP衡量预测框之间的重叠程度,对重叠度较高(不小于0.8)的预测框进行筛除。The Score-
Area-NMS模块400,与Score-NMS模块300连接,其用于对Score-NMS模块300筛除留下的预测框做进一步筛除;具体的,参照图29,Area-NMS模块400基于面积(area)的非极大抑制,以预测框面积为标准,通过计算COP判断预测框之间是否存在包含关系,较佳的是,对相互包含的预测框通过类间择优选择方法进行择优选择,使得保留的预测框定位更好、类别置信度更高。The Area-
为了对本系统中采用的技术效果加以验证说明,本实施例分别对粗选模块200、Score-NMS模块300以及Area-NMS模块400进行测试,以科学论证的手段对比试验结果,以验证本系统所具有的真实效果。In order to verify and explain the technical effects adopted in this system, this embodiment tests the
如图30,共输入1000个预测框,其位置坐标及类别置信度如下。As shown in Figure 30, a total of 1000 prediction boxes are input, and their position coordinates and category confidence are as follows.
①1000个预测框的位置坐标为:①The position coordinates of 1000 prediction frames are:
②1000个预测框的类别置信度为:②The category confidence of 1000 prediction boxes is:
(1)粗选模块200通过设定类别置信度阈值,如本实施例中设置为0.05,筛除类别置信度低于0.05的预测框,筛除后保留87个预测框,如图31,87个预测框的位置坐标及类别置信度如下。(1) The
①87个预测框的位置坐标为:① The position coordinates of the 87 prediction frames are:
②87个预测框的类别置信度为:②The category confidence of the 87 prediction boxes is:
(2)通过Score-NMS模块300筛除重叠程度较大的预测框,通过设定COPBoM阈值,如本实施例中设置为0.8,不断迭代计算类别置信度最大预测框与其余预测框的COPBoM,去除COPBoM值大于0.8的相应预测框,最后保留4个预测框,如图32。(2) Use the Score-
(3)再通过Area-NMS模块中的类间择优选择方法合并存在包含关系的预测框,如图33,最后保留的预测框有较高的类别置信度(0.94)和较好的缺陷定位。(3) Merge the predicted frames with containment relationship through the inter-class selection method in the Area-NMS module, as shown in Figure 33, the last predicted frame has a higher category confidence (0.94) and better defect location.
实施例4Example 4
参照图34~图35,为本发明的第4个实施例,区别于实施例3,本实施例提出了一种多类别非极大抑制系统,包括:Referring to Figures 34 to 35, it is the fourth embodiment of the present invention, which is different from
输入模块100,用于向系统输入预测框集合和空集合。The
粗选模块200,与输入模块100连接,其用于筛除类别置信度非常低的冗余框。The
Area-NMS模块300,与粗选模块200连接,其用于接收粗选模块200传来的预测框集合和空集合以及用于筛除存在包含关系的预测框;具体的,Area-NMS模块400基于面积(area)的非极大抑制,以预测框面积为标准,通过计算COP判断预测框之间是否存在包含关系,较佳的是,对相互包含的预测框通过类间择优选择方法进行择优选择,使得保留的预测框定位更好、类别置信度更高。The Area-
Score-NMS模块400,与Area-NMS模块300连接,其用于接收Area-NMS模块300传来的预测框集合和空集合以及用于筛除重叠度较高的预测框;具体的,Score-NMS模块400基于类别置信度(Score)的非极大抑制,以类别置信度为标准,通过计算COP衡量预测框之间的重叠程度,对重叠度较高(不小于0.8)的预测框进行筛除。The Score-
应当认识到,本发明的实施例可以由计算机硬件、硬件和软件的组合、或者通过存储在非暂时性计算机可读存储器中的计算机指令来实现或实施。所述方法可以使用标准编程技术-包括配置有计算机程序的非暂时性计算机可读存储介质在计算机程序中实现,其中如此配置的存储介质使得计算机以特定和预定义的方式操作——根据在具体实施例中描述的方法和附图。每个程序可以以高级过程或面向对象的编程语言来实现以与计算机系统通信。然而,若需要,该程序可以以汇编或机器语言实现。在任何情况下,该语言可以是编译或解释的语言。此外,为此目的该程序能够在编程的专用集成电路上运行。It should be appreciated that embodiments of the invention may be realized or implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The methods can be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, where the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the specific Methods and Figures described in the Examples. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, the programs can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on an application specific integrated circuit programmed for this purpose.
此外,可按任何合适的顺序来执行本文描述的过程的操作,除非本文另外指示或以其他方式明显地与上下文矛盾。本文描述的过程(或变型和/或其组合)可在配置有可执行指令的一个或多个计算机系统的控制下执行,并且可作为共同地在一个或多个处理器上执行的代码(例如,可执行指令、一个或多个计算机程序或一个或多个应用)、由硬件或其组合来实现。所述计算机程序包括可由一个或多个处理器执行的多个指令。In addition, operations of processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and/or combinations thereof) can be performed under the control of one or more computer systems configured with executable instructions, and as code that collectively executes on one or more processors (e.g. , executable instructions, one or more computer programs or one or more applications), hardware or a combination thereof. The computer program comprises a plurality of instructions executable by one or more processors.
进一步,所述方法可以在可操作地连接至合适的任何类型的计算平台中实现,包括但不限于个人电脑、迷你计算机、主框架、工作站、网络或分布式计算环境、单独的或集成的计算机平台、或者与带电粒子工具或其它成像装置通信等等。本发明的各方面可以以存储在非暂时性存储介质或设备上的机器可读代码来实现,无论是可移动的还是集成至计算平台,如硬盘、光学读取和/或写入存储介质、RAM、ROM等,使得其可由可编程计算机读取,当存储介质或设备由计算机读取时可用于配置和操作计算机以执行在此所描述的过程。此外,机器可读代码,或其部分可以通过有线或无线网络传输。当此类媒体包括结合微处理器或其他数据处理器实现上文所述步骤的指令或程序时,本文所述的发明包括这些和其他不同类型的非暂时性计算机可读存储介质。当根据本发明所述的方法和技术编程时,本发明还包括计算机本身。计算机程序能够应用于输入数据以执行本文所述的功能,从而转换输入数据以生成存储至非易失性存储器的输出数据。输出信息还可以应用于一个或多个输出设备如显示器。在本发明优选的实施例中,转换的数据表示物理和有形的对象,包括显示器上产生的物理和有形对象的特定视觉描绘。Further, the method can be implemented in any type of computing platform operably connected to a suitable one, including but not limited to personal computer, minicomputer, main frame, workstation, network or distributed computing environment, stand-alone or integrated computer platform, or communicate with charged particle tools or other imaging devices, etc. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optically read and/or written storage medium, RAM, ROM, etc., such that they are readable by a programmable computer, when the storage medium or device is read by the computer, can be used to configure and operate the computer to perform the processes described herein. Additionally, the machine-readable code, or portions thereof, may be transmitted over a wired or wireless network. The invention described herein includes these and other various types of non-transitory computer-readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein. Computer programs can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored to non-volatile memory. Output information may also be applied to one or more output devices such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects produced on a display.
如在本申请所使用的,术语“组件”、“模块”、“系统”等等旨在指代计算机相关实体,该计算机相关实体可以是硬件、固件、硬件和软件的结合、软件或者运行中的软件。例如,组件可以是,但不限于是:在处理器上运行的处理、处理器、对象、可执行文件、执行中的线程、程序和/或计算机。作为示例,在计算设备上运行的应用和该计算设备都可以是组件。一个或多个组件可以存在于执行中的过程和/或线程中,并且组件可以位于一个计算机中以及/或者分布在两个或更多个计算机之间。此外,这些组件能够从在其上具有各种数据结构的各种计算机可读介质中执行。这些组件可以通过诸如根据具有一个或多个数据分组(例如,来自一个组件的数据,该组件与本地系统、分布式系统中的另一个组件进行交互和/或以信号的方式通过诸如互联网之类的网络与其它系统进行交互)的信号,以本地和/或远程过程的方式进行通信。As used in this application, the terms "component," "module," "system" and the like are intended to refer to a computer-related entity, which may be hardware, firmware, a combination of hardware and software, software, or an operating system. software. For example, a component may be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer. As an example, both an application running on a computing device and the computing device can be components. One or more components can reside within a process and/or thread of execution and a component can be localized on one computer and/or distributed between two or more computers. In addition, these components can execute from various computer readable media having various data structures thereon. These components can be communicated through, for example, according to having one or more packets of data (e.g., data from a component that interacts with another component in a local system, a distributed system, and/or in the form of network to interact with other systems) to communicate with local and/or remote processes.
应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或者等同替换,而不脱离本发明技术方案的精神和范围,其均应涵盖在本发明的权利要求范围当中。It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention without limitation, although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be carried out Modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present invention shall be covered by the claims of the present invention.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011312543.9A CN112419263B (en) | 2020-11-20 | 2020-11-20 | A multi-category non-maximum suppression method and system based on inter-class coverage ratio |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011312543.9A CN112419263B (en) | 2020-11-20 | 2020-11-20 | A multi-category non-maximum suppression method and system based on inter-class coverage ratio |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112419263A CN112419263A (en) | 2021-02-26 |
CN112419263B true CN112419263B (en) | 2023-04-14 |
Family
ID=74778447
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011312543.9A Active CN112419263B (en) | 2020-11-20 | 2020-11-20 | A multi-category non-maximum suppression method and system based on inter-class coverage ratio |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112419263B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113281707B (en) * | 2021-05-26 | 2022-10-21 | 上海电力大学 | A sound source localization method based on windowed LASSO under strong noise |
CN113869307A (en) * | 2021-09-16 | 2021-12-31 | 中国农业科学院农业资源与农业区划研究所 | A cross-category fruit dataset automatic labeling system and method |
CN114581885A (en) * | 2022-03-04 | 2022-06-03 | 北京小马慧行科技有限公司 | Method, device and computer readable storage medium for identifying noise point below guideboard |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108268869B (en) * | 2018-02-13 | 2021-11-16 | 北京旷视科技有限公司 | Target detection method, device and system |
CN108875577A (en) * | 2018-05-11 | 2018-11-23 | 深圳市易成自动驾驶技术有限公司 | Object detection method, device and computer readable storage medium |
CN108960174A (en) * | 2018-07-12 | 2018-12-07 | 广东工业大学 | A kind of object detection results optimization method and device |
CN109101897A (en) * | 2018-07-20 | 2018-12-28 | 中国科学院自动化研究所 | Object detection method, system and the relevant device of underwater robot |
CN109359577B (en) * | 2018-10-08 | 2021-06-29 | 福州大学 | A system for detecting people in complex backgrounds based on machine learning |
CN111368600B (en) * | 2018-12-26 | 2023-10-31 | 北京眼神智能科技有限公司 | Remote sensing image target detection and recognition methods, devices, readable storage media and equipment |
CN110414417B (en) * | 2019-07-25 | 2022-08-12 | 电子科技大学 | A traffic sign recognition method based on multi-level fusion and multi-scale prediction |
CN111310759B (en) * | 2020-02-13 | 2024-03-01 | 中科智云科技有限公司 | Target detection inhibition optimization method and device for dual-mode cooperation |
CN111738263A (en) * | 2020-08-24 | 2020-10-02 | 北京易真学思教育科技有限公司 | Target detection method and device, electronic equipment and storage medium |
-
2020
- 2020-11-20 CN CN202011312543.9A patent/CN112419263B/en active Active
Non-Patent Citations (1)
Title |
---|
基于组合式目标检测框架的低漏报率缺陷识别方法;罗鹏等;《高电压技术》;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN112419263A (en) | 2021-02-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112419263B (en) | A multi-category non-maximum suppression method and system based on inter-class coverage ratio | |
US20230419472A1 (en) | Defect detection method, device and system | |
KR102171491B1 (en) | Method for sorting products using deep learning | |
CN111814850B (en) | Defect detection model training method, defect detection method and related device | |
TWI571946B (en) | Iterative defect filtering process | |
CN106682697A (en) | End-to-end object detection method based on convolutional neural network | |
CN113159216B (en) | Positive sample expansion method for surface defect detection | |
JP2016114592A (en) | Information processing device, information processing method, and program | |
JP2016115331A (en) | Identifier generator, identifier generation method, quality determination apparatus, quality determination method and program | |
CN118967672B (en) | Industrial defect detection method, system, device and storage medium | |
CN107578021A (en) | Pedestrian detection method, apparatus and system based on deep learning network | |
CN110895716A (en) | Inspection apparatus and machine learning method | |
CN113077430B (en) | Laser Chip Defect Detection and Classification Method and System Based on SSD Algorithm | |
CN116229299A (en) | Unmanned aerial vehicle-based building or structure damage assessment method, terminal and medium | |
CN111428655A (en) | A scalp detection method based on deep learning | |
JP2021143884A (en) | Inspection device, inspection method, program, learning device, learning method, and trained dataset | |
CN112800870B (en) | A non-maximum suppression method and system based on inter-layer coverage ratio | |
CN113343918A (en) | Power equipment identification method, system, medium and electronic equipment | |
CN105654109A (en) | Classifying method, inspection method, and inspection apparatus | |
CN111753666A (en) | Fault detection method, detection system and storage medium for small and medium targets in transmission lines | |
TW202020802A (en) | Information processing method and computer program | |
CN109102486B (en) | Surface defect detection method and device based on machine learning | |
CN113538351A (en) | External insulation equipment defect degree evaluation method fusing multi-parameter electric signals | |
CN118089546A (en) | Method and system for monitoring medicine stability through image analysis | |
CN114596244A (en) | Infrared image identification method and system based on visual processing and multi-feature fusion |
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 |