CN114842275B - Circuit board defect judging method, training method, device, equipment and storage medium - Google Patents
Circuit board defect judging method, training method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN114842275B CN114842275B CN202210788263.8A CN202210788263A CN114842275B CN 114842275 B CN114842275 B CN 114842275B CN 202210788263 A CN202210788263 A CN 202210788263A CN 114842275 B CN114842275 B CN 114842275B
- Authority
- CN
- China
- Prior art keywords
- information
- defect
- target
- circuit board
- semantic
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- 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
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Multimedia (AREA)
- Medical Informatics (AREA)
- Databases & Information Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Biomedical Technology (AREA)
- Mathematical Physics (AREA)
- General Engineering & Computer Science (AREA)
- Molecular Biology (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
Description
技术领域technical field
本申请涉及表面缺陷判别领域,尤其涉及电路板缺陷判别方法、训练方法、装置、设备及存储介质。The present application relates to the field of surface defect discrimination, in particular to a circuit board defect discrimination method, training method, device, equipment and storage medium.
背景技术Background technique
电路板是重要的电子部件,是电子元器件的支撑体,是电子元器件电器连接的载体。电路板的板本身是否存在缺陷将直接影响使用该电路板的设备性能,所以对于电路板的缺陷判别显得尤为必要。电路板缺陷种类较多,包含露铜、板污、线路刮伤、阻焊过薄、防焊偏移、文字模糊等十几种缺陷,不同的缺陷形状、大小、颜色、位置均不一样,而现有缺陷判别方法无法对缺陷进行缺陷等级有效判别。The circuit board is an important electronic component, a support for electronic components, and a carrier for electrical connections of electronic components. Whether the circuit board itself has defects will directly affect the performance of the equipment using the circuit board, so it is particularly necessary to identify the defects of the circuit board. There are many types of circuit board defects, including more than a dozen defects such as exposed copper, board contamination, line scratches, thin solder mask, offset solder mask, and blurred text. Different defects have different shapes, sizes, colors, and positions. However, the existing defect identification methods cannot effectively determine the defect level of defects.
发明内容Contents of the invention
本申请的主要目的是提供电路板缺陷判别方法、训练方法、装置、设备及存储介质,旨在解决现有缺陷判别方法无法对缺陷进行缺陷等级有效判别的技术问题。The main purpose of this application is to provide a circuit board defect discrimination method, training method, device, equipment and storage medium, aiming to solve the technical problem that the existing defect discrimination method cannot effectively determine the defect level of the defect.
为解决上述技术问题,本申请提出了:一种电路板缺陷判别方法,包括以下步骤:In order to solve the above-mentioned technical problems, the present application proposes: a circuit board defect discrimination method, comprising the following steps:
获取待判别电路板的目标图像;Obtain the target image of the circuit board to be discriminated;
将所述目标图像输入已训练的目标判别模型,获得所述目标图像的缺陷判别信息;inputting the target image into a trained target discrimination model to obtain defect discrimination information of the target image;
其中,所述目标判别模型由电路板样本图像集训练获得;所述电路板样本图像集中包括若干样本图像以及若干所述样本图像对应的标签信息,所述标签信息基于对若干所述样本图像的语义描述信息获得,所述标签信息包括:缺陷种类信息和缺陷等级信息。Wherein, the target discrimination model is obtained by training a circuit board sample image set; the circuit board sample image set includes several sample images and label information corresponding to several sample images, and the label information is based on several sample images Semantic description information is obtained, and the label information includes: defect type information and defect level information.
为了使目标判别模型在后续实际应用中能对电路板缺陷进行有效自动判别,作为本申请一些可选实施方式,在所述将所述目标图像输入已训练的目标判别模型,获得所述目标图像的缺陷判别信息之前,还包括:In order to enable the target discriminant model to effectively and automatically identify circuit board defects in subsequent practical applications, as some optional implementation modes of the present application, the target image is input into the trained target discriminant model to obtain the target image Before the defect discrimination information, it also includes:
获取若干样本图像;Obtain several sample images;
分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集;Semantically annotating the defect information of several sample images respectively to obtain the circuit board sample image set;
基于所述电路板样本图像集,对初始目标判别模型进行训练,获得所述目标判别模型。Based on the circuit board sample image set, an initial target discrimination model is trained to obtain the target discrimination model.
为了提高语义标注内容与缺陷的实际信息更为贴近,并从若干所述样本图像中提取通用性语义标注内容,从而提高判别等级效率;作为本申请一些可选实施方式,所述分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集,包括:In order to improve the semantic annotation content and the actual information of the defect closer, and extract the general semantic annotation content from several sample images, thereby improving the efficiency of the discrimination level; as some optional implementation methods of this application, the described The defect information of the sample image is semantically annotated to obtain the circuit board sample image set, including:
基于历史数据,对若干所述样本图像及其对应的若干语义解释进行语义判别,获得语义判别结果;Based on historical data, perform semantic discrimination on several sample images and corresponding semantic interpretations, and obtain semantic discrimination results;
基于所述语义判别结果,获得所述语义判别结果对应的目标语义解释;Obtaining a target semantic interpretation corresponding to the semantic discrimination result based on the semantic discrimination result;
基于所述目标语义解释,分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集。Based on the target semantic interpretation, the defect information of several sample images is respectively semantically annotated to obtain the circuit board sample image set.
本申请针对电路板缺陷这一实际应用场景,基于电路板历史数据,对若干所述样本图像及其对应的若干语义解释进行语义判别,获得并基于所述语义判别结果,获得了目标语义解释,并基于所述目标语义解释,获得了通用性的缺陷种类信息,即作为本申请一些可选实施方式,所述缺陷种类信息包括余铜、破盘和凹坑中的至少一种。In this application, aiming at the actual application scenario of circuit board defects, based on the historical data of the circuit board, semantic discrimination is performed on several sample images and corresponding semantic interpretations, and the target semantic interpretation is obtained based on the semantic discrimination results. And based on the semantic interpretation of the target, general defect type information is obtained, that is, as some optional implementation manners of the present application, the defect type information includes at least one of remaining copper, broken disk and pit.
为了使所述目标识别模型对目标缺陷进行自动判别,本申请针对上述缺陷种类,分别赋予了不同的目标语义解释,即赋予所述目标识别模型量化标准规则;作为本申请一些可选实施方式,当所述样本图像中的缺陷种类信息为余铜信息时,所述目标语义解释为线路间隙宽度的解释。In order to enable the target recognition model to automatically discriminate target defects, this application assigns different target semantic interpretations to the above defect types, that is, assigns quantitative standard rules to the target recognition model; as some optional implementation modes of this application, When the defect type information in the sample image is remaining copper information, the target semantic interpretation is the interpretation of line gap width.
为了使所述目标识别模型对目标缺陷进行自动判别,本申请针对上述缺陷种类,分别赋予了不同的目标语义解释,即赋予所述目标识别模型量化标准规则;作为本申请一些可选实施方式,当所述样本图像中的缺陷种类信息为破盘信息时,所述目标语义解释为线路宽度的解释。In order to enable the target recognition model to automatically discriminate target defects, this application assigns different target semantic interpretations to the above defect types, that is, assigns quantitative standard rules to the target recognition model; as some optional implementation modes of this application, When the defect type information in the sample image is broken disk information, the target semantic interpretation is line width interpretation.
为了使所述目标识别模型对目标缺陷进行自动判别,本申请针对上述缺陷种类,分别赋予了不同的目标语义解释,即赋予所述目标识别模型量化标准规则;作为本申请一些可选实施方式,当所述样本图像中的缺陷种类信息为凹坑信息时,所述目标语义解释为线路密度的解释或线路宽度的解释。In order to enable the target recognition model to automatically discriminate target defects, this application assigns different target semantic interpretations to the above defect types, that is, assigns quantitative standard rules to the target recognition model; as some optional implementation modes of this application, When the defect type information in the sample image is pit information, the target semantic interpretation is an interpretation of line density or line width.
为了提高语义标注内容与缺陷的实际信息更为贴近,并从若干所述样本图像中提取通用性语义标注内容,从而提高判别等级效率;作为本申请一些可选实施方式,所述标签信息还包括:缺陷位置信息。In order to improve the semantic annotation content and the actual information of the defect closer, and extract the general semantic annotation content from several sample images, thereby improving the efficiency of discrimination levels; as some optional implementation methods of this application, the label information also includes : Defect location information.
为了使所述目标判别模型具有自动判别缺陷等级的能力,本申请在进行语义标注时,在包括了缺陷的种类信息和缺陷的位置信息的同时,作为本申请一些可选实施方式,所述缺陷等级信息包括:允收信息和报废信息。In order to enable the target discrimination model to have the ability to automatically identify defect levels, this application includes defect type information and defect location information when performing semantic labeling, and as some optional implementation modes of this application, the defect Level information includes: acceptance information and scrap information.
为了提高所述目标判别模型自动判别缺陷等级的效率和准确性,作为本申请一些可选实施方式,所述将所述目标图像输入已训练的目标判别模型,获得所述目标图像的缺陷判别信息,包括:In order to improve the efficiency and accuracy of automatically discriminating defect levels by the target discrimination model, as some optional implementations of the present application, the target image is input into the trained target discrimination model to obtain defect discrimination information of the target image ,include:
将所述目标图像输入已训练的目标判别模型,获得所述目标图像的缺陷信息;inputting the target image into a trained target discrimination model to obtain defect information of the target image;
基于所述目标图像的缺陷信息,与预设的判别标准对比,获得所述缺陷的判别信息。Based on the defect information of the target image, it is compared with a preset discrimination standard to obtain discrimination information of the defect.
为解决上述技术问题,本申请还提出了:一种电路板缺陷判别模型训练方法,包括以下步骤:In order to solve the above-mentioned technical problems, the present application also proposes: a circuit board defect discrimination model training method, comprising the following steps:
获取若干样本图像;Obtain several sample images;
分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集;其中,所述电路板样本图像集中包括若干所述样本图像以及若干所述样本图像对应的标签信息,所述标签信息包括:缺陷种类信息和缺陷等级信息;Semantically annotating defect information of several sample images respectively to obtain the circuit board sample image set; wherein, the circuit board sample image set includes several sample images and label information corresponding to several sample images, The label information includes: defect type information and defect level information;
基于所述电路板样本图像集,对初始目标判别模型进行训练,获得所述目标判别模型。Based on the circuit board sample image set, an initial target discrimination model is trained to obtain the target discrimination model.
通过上述训练方法获得的电路板缺陷判别模型由于通过规则学习,即分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集;其中,所述电路板样本图像集中包括若干所述样本图像以及若干所述样本图像对应的标签信息,所述标签信息包括:缺陷种类信息和缺陷等级信息;基于所述电路板样本图像集,对初始目标判别模型进行训练,获得所述目标判别模型,因此在实际应用中,能自动对所述电路板缺陷进行缺陷等级判别。The circuit board defect discrimination model obtained by the above training method is learned by rules, that is, the defect information of several sample images is semantically labeled to obtain the circuit board sample image set; wherein, the circuit board sample image set Including several sample images and label information corresponding to several sample images, the label information includes: defect type information and defect level information; based on the circuit board sample image set, the initial target discrimination model is trained to obtain the Therefore, in practical applications, it can automatically perform defect level discrimination on the circuit board defects.
为了提高语义标注内容与缺陷的实际信息更为贴近,并从若干所述样本图像中提取通用性语义标注内容,从而提高判别等级效率;作为本申请一些可选实施方式,所述分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集,包括:In order to improve the semantic annotation content and the actual information of the defect closer, and extract the general semantic annotation content from several sample images, thereby improving the efficiency of the discrimination level; as some optional implementation methods of this application, the described The defect information of the sample image is semantically annotated to obtain the circuit board sample image set, including:
基于历史数据,对若干所述样本图像及其对应的若干语义解释进行语义判别,获得语义判别结果;Based on historical data, perform semantic discrimination on several sample images and corresponding semantic interpretations, and obtain semantic discrimination results;
基于所述语义判别结果,获得所述语义判别结果对应的目标语义解释;Obtaining a target semantic interpretation corresponding to the semantic discrimination result based on the semantic discrimination result;
基于所述目标语义解释,分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集。Based on the target semantic interpretation, the defect information of several sample images is respectively semantically annotated to obtain the circuit board sample image set.
作为本申请一些可选实施方式,所述电路板表面缺陷判别模型为Faster RCNN算法模型。在该实施方式中,Faster RCNN算法模型的性能优越,实现了精度较高的物体判别性能。Faster RCNN通过两阶网络与RPN,实现判别相比起其他一阶网络,两阶更为精准,尤其是针对高精度、多尺度以及小物体问题上,两阶网络优势更为明显。Faster RCNN在多个数据集及物体任务上效果都很好,对于个人的数据集,往往Fine-tune(微调)后就能达到较好的效果。Faster RCNN的整个算法框架中可以进行优化的点很多,提供了广阔的算法优化空间。因此采用所述Faster RCNN算法模型作为所述电路板表面缺陷判别模型,能提高所述判别模型对目标缺陷的判别速度以及准确率。As some optional implementations of the present application, the circuit board surface defect discrimination model is a Faster RCNN algorithm model. In this embodiment, the performance of the Faster RCNN algorithm model is superior, and a high-precision object discrimination performance is realized. Faster RCNN uses a two-stage network and RPN to achieve discrimination. Compared with other first-order networks, the two-stage network is more accurate, especially for high-precision, multi-scale, and small object problems. The advantages of the two-stage network are more obvious. Faster RCNN works well on multiple data sets and object tasks. For personal data sets, it can often achieve better results after Fine-tune. There are many points that can be optimized in the entire algorithm framework of Faster RCNN, providing a broad space for algorithm optimization. Therefore, adopting the Faster RCNN algorithm model as the circuit board surface defect discrimination model can improve the discrimination speed and accuracy of the discrimination model for target defects.
为解决上述技术问题,本申请还提出了:一种电路板缺陷判别装置,包括:In order to solve the above technical problems, this application also proposes: a circuit board defect discrimination device, comprising:
第一获取模块,用于获取待判别电路板的目标图像;The first acquisition module is used to acquire the target image of the circuit board to be identified;
第二获取模块,用于将所述目标图像输入已训练的目标判别模型,获得所述目标图像的缺陷判别信息;其中,所述目标判别模型由电路板样本图像集训练获得;所述电路板样本图像集中包括若干样本图像以及若干所述样本图像对应的标签信息,所述标签信息基于对若干所述样本图像的语义描述信息获得,所述标签信息包括:缺陷种类信息和缺陷等级信息。The second acquisition module is used to input the target image into the trained target discrimination model to obtain the defect discrimination information of the target image; wherein, the target discrimination model is obtained by training the circuit board sample image set; the circuit board The sample image set includes several sample images and label information corresponding to the sample images, the label information is obtained based on the semantic description information of the several sample images, and the label information includes: defect type information and defect level information.
为解决上述技术问题,本申请还提出了:一种电子设备,该电子设备包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器执行所述计算机程序,实现如上所述的方法。In order to solve the above technical problems, this application also proposes: an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the above-mentioned method.
为解决上述技术问题,本申请还提出了:一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,处理器执行所述计算机程序,实现如上所述的方法。In order to solve the above technical problems, the present application also proposes: a computer-readable storage medium, on which a computer program is stored, and a processor executes the computer program to implement the above-mentioned method.
电路板缺陷种类较多,包含露铜、板污、线路刮伤、阻焊过薄、防焊偏移、文字模糊等十几种缺陷,不同的缺陷形状、大小、颜色、位置均不一样,而现有缺陷判别方法无法对缺陷进行缺陷等级有效判别,仅能根据缺陷面积或缺陷数量等因素进行人工判别缺陷等级的操作,这种人工判别缺陷等级的方式由于缺少量化标准而导致主观因素较大,且判别缺陷等级的效率较低。与现有技术相比,本申请采用电路板样本图像训练获得目标判别模型,所述电路板样本图像包括若干样本图像以及若干所述样本图像对应的标签信息,所述标签信息基于对若干所述样本图像的语义描述信息获得,所述标签信息包括:缺陷种类信息和缺陷等级信息;由于在所述样本图像上添加了不同的缺陷种类标签信息和缺陷等级标签信息,以使得所述目标判别模型在训练过程中,能对不同的缺陷进行辨别并对所述缺陷的等级进行自动鉴别;因此在实际对待判别电路板的缺陷进行判别等级操作时,将待判别电路板的目标图像输入至所述目标判别模型中即可获得自动判别等级结果信息,从而提高了对电路板缺陷位置进行判别等级的效率。There are many types of circuit board defects, including more than a dozen defects such as exposed copper, board contamination, line scratches, thin solder mask, offset solder mask, and blurred text. Different defects have different shapes, sizes, colors, and positions. However, the existing defect identification methods cannot effectively determine the defect level of defects, and can only manually determine the defect level based on factors such as defect area or defect number. This manual method of determining defect level is relatively subjective due to the lack of quantitative standards. Large, and the efficiency of discriminating the defect level is low. Compared with the prior art, this application adopts circuit board sample image training to obtain a target discrimination model, and the circuit board sample image includes several sample images and label information corresponding to several sample images, and the label information is based on several The semantic description information of the sample image is obtained, and the label information includes: defect type information and defect level information; since different defect type label information and defect level label information are added to the sample image, so that the target discrimination model During the training process, different defects can be identified and the level of the defect can be automatically identified; therefore, when the level of defects of the circuit board to be identified is actually determined, the target image of the circuit board to be identified is input into the The automatic discrimination grade result information can be obtained in the target discrimination model, thereby improving the efficiency of the discrimination grade of the defect position of the circuit board.
附图说明Description of drawings
图1为本申请实施例涉及的硬件运行环境的电子设备结构示意图;FIG. 1 is a schematic structural diagram of an electronic device in a hardware operating environment involved in an embodiment of the present application;
图2为本申请实施例所述电路板缺陷判别方法的流程示意图;Fig. 2 is a schematic flow chart of the circuit board defect discrimination method described in the embodiment of the present application;
图3为本申请实施例所述获得缺陷的判别信息的流程示意图;FIG. 3 is a schematic flow diagram of obtaining defect discrimination information according to an embodiment of the present application;
图4为本申请实施例所述获得目标判别模型的流程示意图;FIG. 4 is a schematic flow diagram of obtaining a target discrimination model according to an embodiment of the present application;
图5为本申请实施例所述电路板缺陷为余铜的判别结果示意图;Fig. 5 is a schematic diagram of the discrimination result of residual copper as the circuit board defect described in the embodiment of the present application;
图6为本申请实施例所述电路板缺陷为破盘的判别结果示意图;Fig. 6 is a schematic diagram of the discrimination result of the circuit board defect described in the embodiment of the present application as a broken disk;
图7为本申请实施例所述电路板缺陷为凹坑的判别结果示意图;Fig. 7 is a schematic diagram of the discriminant result of the circuit board defect described in the embodiment of the present application as a pit;
图8为本申请实施例所述电路板缺陷判别模型训练方法的流程示意图;8 is a schematic flow diagram of the circuit board defect discrimination model training method described in the embodiment of the present application;
图9为本申请实施例所述获得电路板样本图像集的流程示意图;9 is a schematic flow diagram of obtaining a circuit board sample image set according to an embodiment of the present application;
图10为本申请实施例所述电路板缺陷判别装置的功能模块示意图。FIG. 10 is a schematic diagram of functional modules of the circuit board defect discrimination device according to the embodiment of the present application.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.
在现有技术中,判别电路板缺陷通常是使用自动光学检测(Automated OpticalInspection,简称AOI)机,AOI基于光学原理来对焊接生产中遇到的常见缺陷进行检测。在生产过程中,AOI运用高速高精度视觉处理技术自动检测PCB板上各种不同贴装错误及焊接缺陷。PCB板的范围可从细间距高密度板到低密度大尺寸板,并可提供在线检测方案,以提高生产效率及焊接质量。通过使用AOI作为减少缺陷的工具,在装配工艺过程的早期查找和消除错误,以实现良好的过程控制。早期发现缺陷将避免将有缺陷的电路板送到随后的装配阶段,AOI将减少修理成本将避免报废不可修理的电路板。In the prior art, automatic optical inspection (Automated Optical Inspection, referred to as AOI) machine is usually used to identify circuit board defects. AOI detects common defects encountered in welding production based on optical principles. In the production process, AOI uses high-speed and high-precision visual processing technology to automatically detect various mounting errors and welding defects on the PCB. The range of PCB boards can range from fine-pitch high-density boards to low-density large-size boards, and online inspection solutions can be provided to improve production efficiency and welding quality. Find and eliminate errors early in the assembly process for good process control by using AOI as a defect reduction tool. Early detection of defects will avoid sending defective boards to subsequent assembly stages, and AOI will reduce repair costs and will avoid scrapping non-repairable boards.
当采用AOI自动检测时,机器通过摄像头自动扫描PCB电路板,采集图像,用测试的焊点与数据库中的合格的参数进行比较,经过图像处理,检查出PCB电路板上缺陷,并通过显示器或自动标志把缺陷显示/标示出来,在通过检测人员目视定位缺陷并进行分类,但由于人工目视定位缺陷存在不稳定性,不同的检测人员的检测标准难以统一,且在检测人员的长时间工作的疲劳状态下同样可能导致目测分类结果不准确,最终导致检测的结果不符合需求。且电路板是重要的电子部件,是电子元器件的支撑体,是电子元器件电器连接的载体。电路板板本身是否存在缺陷将直接影响使用该电路板的设备性能,所以对于电路板的缺陷判别显得尤为必要。电路板缺陷种类较多,包含露铜、板污、线路刮伤、阻焊过薄、防焊偏移、文字模糊等十几种缺陷,不同的缺陷形状、大小、颜色、位置均不一样,而现有缺陷判别方法无法对缺陷进行缺陷等级有效判别。When using AOI automatic detection, the machine automatically scans the PCB circuit board through the camera, collects images, compares the tested solder joints with the qualified parameters in the database, and checks out the defects on the PCB circuit board through image processing, and passes the display or The automatic mark displays/marks the defects, and the inspectors visually locate the defects and classify them. However, due to the instability of manual visual positioning of defects, it is difficult to unify the inspection standards of different inspectors, and the inspectors have been working for a long time. The fatigue state of work may also lead to inaccurate visual classification results, which eventually lead to detection results that do not meet the requirements. And the circuit board is an important electronic component, a support for electronic components, and a carrier for electrical connections of electronic components. Whether there is a defect in the circuit board itself will directly affect the performance of the equipment using the circuit board, so it is particularly necessary to identify the defect of the circuit board. There are many types of circuit board defects, including more than a dozen defects such as exposed copper, board contamination, line scratches, thin solder mask, offset solder mask, and blurred text. Different defects have different shapes, sizes, colors, and positions. However, the existing defect identification methods cannot effectively determine the defect level of defects.
参照图1,图1为本申请的实施例涉及的硬件运行环境的电子设备结构示意图。Referring to FIG. 1 , FIG. 1 is a schematic structural diagram of an electronic device of a hardware operating environment involved in an embodiment of the present application.
如图1所示,该电子设备可以包括:处理器1001,例如中央处理器(CentralProcessing Unit,CPU),通信总线1002、用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如无线保真(WIreless-FIdelity,WI-FI)接口)。存储器1005可以是高速的随机存取存储器(RandomAccess Memory,RAM)存储器,也可以是稳定的非易失性存储器(Non-Volatile Memory,NVM),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1 , the electronic device may include: a
本领域技术人员可以理解,图1中示出的结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 1 does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine some components, or arrange different components.
如图1所示,作为一种存储介质的存储器1005中可以包括操作系统、数据存储模块、网络通信模块、用户接口模块以及电子程序。As shown in FIG. 1 ,
在图1所示的电子设备中,网络接口1004主要用于与网络服务器进行数据通信;用户接口1003主要用于与用户进行数据交互;本申请电子设备中的处理器1001、存储器1005可以设置在电子设备中,所述电子设备通过处理器1001调用存储器1005中存储的电路板缺陷判别装置,并执行本申请实施例提供的电路板缺陷判别方法。In the electronic device shown in Figure 1, the
如图2所示,本申请实施例提供了:一种电路板缺陷判别方法,包括以下步骤:As shown in Figure 2, the embodiment of the present application provides: a circuit board defect discrimination method, comprising the following steps:
S10、获取待判别电路板的目标图像;S10. Acquiring the target image of the circuit board to be identified;
在具体的应用中,待判别电路板是指需要判别是否具有缺陷的电路板,目标图像是指待判别电路板的图像,可通过人工拍照或AOI获得,在实际应用中,所述待判别电路板的目标图像还可以是经过计算机视觉算法处理后获得的。所述计算机视觉算法是用摄影机和电脑代替人眼对目标进行识别、跟踪和测量等机器视觉,并进一步做图形处理,使电脑处理成为更适合人眼观察或传送给仪器判别的图像。In a specific application, the circuit board to be judged refers to the circuit board that needs to be judged whether it has defects, and the target image refers to the image of the circuit board to be judged, which can be obtained by manual photography or AOI. In practical applications, the circuit board to be judged The target image of the board can also be obtained after being processed by a computer vision algorithm. The computer vision algorithm uses cameras and computers instead of human eyes to perform machine vision such as recognition, tracking and measurement of targets, and further performs graphics processing to make computer processing images that are more suitable for human eyes to observe or to be sent to instruments for identification.
S20、将所述目标图像输入已训练的目标判别模型,获得所述目标图像的缺陷判别信息;其中,所述目标判别模型由电路板样本图像集训练获得;所述电路板样本图像集中包括若干样本图像以及若干所述样本图像对应的标签信息,所述标签信息基于对若干所述样本图像的语义描述信息获得,所述标签信息包括:缺陷种类信息和缺陷等级信息。在具体的应用中,样本图像同样是采用AOI机台扫描获得的、专用于训练初始模型的图像,样本图像中会含有多种常见的缺陷。S20. Input the target image into the trained target discrimination model to obtain defect discrimination information of the target image; wherein, the target discrimination model is obtained by training the circuit board sample image set; the circuit board sample image set includes several A sample image and tag information corresponding to several sample images, the tag information is obtained based on the semantic description information of several sample images, and the tag information includes: defect type information and defect level information. In a specific application, the sample image is also scanned by an AOI machine and is specially used for training the initial model, and the sample image may contain many common defects.
为了提高所述目标判别模型自动判别缺陷等级的效率和准确性,如图3所示,作为本申请一些可选实施方式,所述将所述目标图像输入已训练的目标判别模型,获得所述目标图像的缺陷判别信息,包括:In order to improve the efficiency and accuracy of the automatic discrimination of the defect level by the target discrimination model, as shown in FIG. Defect discrimination information of the target image, including:
S201、将所述目标图像输入已训练的目标判别模型,获得所述目标图像的缺陷信息。S201. Input the target image into a trained target discrimination model to obtain defect information of the target image.
其中,所述目标判别模型由电路板样本图像集训练获得;所述电路板样本图像集中包括若干样本图像以及若干所述样本图像对应的标签信息,所述标签信息基于对若干所述样本图像的语义描述信息获得,所述标签信息包括:缺陷种类信息和缺陷等级信息。在具体的应用中,样本图像同样是采用AOI机台扫描获得的、专用于训练初始模型的图像,样本图像中会含有多种常见的缺陷。其中,所述目标图像的缺陷信息包括:缺陷种类信息、缺陷位置信息和缺陷等级信息。Wherein, the target discrimination model is obtained by training a circuit board sample image set; the circuit board sample image set includes several sample images and label information corresponding to several sample images, and the label information is based on several sample images Semantic description information is obtained, and the label information includes: defect type information and defect level information. In a specific application, the sample image is also scanned by an AOI machine and is specially used for training the initial model, and the sample image may contain many common defects. Wherein, the defect information of the target image includes: defect type information, defect position information and defect level information.
S202、基于所述目标图像的缺陷信息,与预设的判别标准对比,获得所述缺陷的判别信息。所述预设的判别标准是指,针对电路板常见的几种缺陷,分别设置的判别标准,如:当所述样本图像中的缺陷种类信息为余铜信息时,若余铜造成线路剩余间隙宽度不足1/2,则报废,若剩余间隙宽度超过1/2,则允收。当所述样本图像中的缺陷种类信息为破盘信息时,若破盘造成线路板上钻孔位置超过铜面区域,则报废,若未超过铜面区域,则允收。当所述样本图像中的缺陷种类信息为凹坑信息时,若凹坑造成铜面区域出现大量聚集凹坑,或线路区凹坑造成线路宽度低于1/2,则报废,若不满足以上条件,则允收。S202. Based on the defect information of the target image, compare it with a preset discrimination standard to obtain discrimination information of the defect. The preset discrimination standard refers to the discrimination standard set separately for several common defects of the circuit board, such as: when the defect type information in the sample image is the remaining copper information, if the remaining copper causes the remaining gap of the circuit If the width is less than 1/2, it will be scrapped, and if the remaining gap width exceeds 1/2, it will be accepted. When the defect type information in the sample image is broken disk information, if the broken disk causes the drilling position on the circuit board to exceed the copper surface area, then it will be rejected, and if it does not exceed the copper surface area, then it will be accepted. When the defect type information in the sample image is pit information, if the pits cause a large number of aggregated pits in the copper surface area, or the pits in the line area cause the line width to be less than 1/2, then it will be scrapped. If the above conditions are not met Conditions are accepted.
为了使目标判别模型在后续实际应用中能对电路板缺陷进行有效自动判别,如图4所示,作为本申请一些可选实施方式,在所述将所述目标图像输入已训练的目标判别模型,获得所述目标图像的缺陷判别信息之前,还包括:In order to enable the target discriminant model to effectively and automatically identify circuit board defects in subsequent practical applications, as shown in Figure 4, as some optional implementation modes of the present application, inputting the target image into the trained target discriminant model , before obtaining the defect discrimination information of the target image, further includes:
S01、获取若干样本图像。S01. Acquire several sample images.
其中,所述样本图像是采用AOI机台扫描获得的、专用于训练初始模型的图像,样本图像中会含有多种常见的缺陷。Wherein, the sample image is an image obtained by scanning with an AOI machine and specially used for training the initial model, and the sample image may contain various common defects.
S02、分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集。S02. Semantically label defect information of several sample images respectively to obtain the circuit board sample image set.
在上述步骤中,所述电路板样本图像集主要是:基于历史数据,对若干所述样本图像及其对应的若干语义解释进行语义判别,获得语义判别结果;基于所述语义判别结果,获得所述语义判别结果对应的目标语义解释;基于所述目标语义解释,分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集。上述步骤主要是为了提高语义标注内容与缺陷的实际信息更为贴近,并从若干所述样本图像中提取通用性语义标注内容,从而提高判别等级效率。其中,所述电路板样本图像集中包括若干所述样本图像以及若干所述样本图像对应的标签信息,所述标签信息包括:缺陷种类信息和缺陷等级信息。在具体的应用中,通过人工或机器对样本图像对缺陷信息进行标注。In the above steps, the circuit board sample image set is mainly: based on historical data, carry out semantic discrimination on several sample images and corresponding semantic interpretations to obtain semantic discrimination results; based on the semantic discrimination results, obtain all The target semantic interpretation corresponding to the semantic discrimination result; based on the target semantic interpretation, semantically annotate the defect information of several sample images to obtain the circuit board sample image set. The above steps are mainly to improve the closeness between the semantic annotation content and the actual defect information, and to extract the general semantic annotation content from several sample images, thereby improving the efficiency of the discrimination level. Wherein, the circuit board sample image set includes several sample images and label information corresponding to the several sample images, and the label information includes: defect type information and defect level information. In a specific application, the defect information is marked on the sample image manually or by a machine.
S03、基于所述电路板样本图像集,对初始目标判别模型进行训练,获得所述目标判别模型。S03. Based on the circuit board sample image set, train an initial target discrimination model to obtain the target discrimination model.
所述初始目标判别模型是指Faster RCNN算法模型。在该实施方式中,FasterRCNN算法模型的性能优越,实现了精度较高的物体判别性能。Faster RCNN通过两阶网络与RPN,实现判别相比起其他一阶网络,两阶更为精准,尤其是针对高精度、多尺度以及小物体问题上,两阶网络优势更为明显。Faster RCNN在多个数据集及物体任务上效果都很好,对于个人的数据集,往往Fine-tune(微调)后就能达到较好的效果。Faster RCNN的整个算法框架中可以进行优化的点很多,提供了广阔的算法优化空间。因此采用所述Faster RCNN算法模型作为所述电路板表面缺陷判别模型,能提高所述判别模型对目标缺陷的判别速度以及准确率。The initial target discrimination model refers to the Faster RCNN algorithm model. In this embodiment, the performance of the FasterRCNN algorithm model is superior, and a high-precision object discrimination performance is realized. Faster RCNN uses a two-stage network and RPN to achieve discrimination. Compared with other first-order networks, the two-stage network is more accurate, especially for high-precision, multi-scale, and small object problems. The advantages of the two-stage network are more obvious. Faster RCNN works well on multiple data sets and object tasks. For personal data sets, it can often achieve better results after Fine-tune. There are many points that can be optimized in the entire algorithm framework of Faster RCNN, providing a broad space for algorithm optimization. Therefore, adopting the Faster RCNN algorithm model as the circuit board surface defect discrimination model can improve the discrimination speed and accuracy of the discrimination model for target defects.
本申请针对电路板缺陷这一实际应用场景,基于电路板历史数据,对若干所述样本图像及其对应的若干语义解释进行语义判别,获得并基于所述语义判别结果,获得了目标语义解释,并基于所述目标语义解释,获得了通用性的缺陷种类信息,即作为本申请一些可选实施方式,所述缺陷种类信息包括余铜、破盘和凹坑中的至少一种。为了提高语义标注内容与缺陷的实际信息更为贴近,并从若干所述样本图像中提取通用性语义标注内容,从而提高判别等级效率;作为本申请一些可选实施方式,所述标签信息还包括:缺陷位置信息。为了使所述目标判别模型具有自动判别缺陷等级的能力,本申请在进行语义标注时,在包括了缺陷的种类信息和缺陷的位置信息的同时,作为本申请一些可选实施方式,所述缺陷等级信息包括:允收信息和报废信息。In this application, aiming at the actual application scenario of circuit board defects, based on the historical data of the circuit board, semantic discrimination is performed on several sample images and corresponding semantic interpretations, and the target semantic interpretation is obtained based on the semantic discrimination results. And based on the semantic interpretation of the target, general defect type information is obtained, that is, as some optional implementation manners of the present application, the defect type information includes at least one of remaining copper, broken disk and pit. In order to improve the semantic annotation content and the actual information of the defect closer, and extract the general semantic annotation content from several sample images, thereby improving the efficiency of discrimination levels; as some optional implementation methods of this application, the label information also includes : Defect location information. In order to enable the target discrimination model to have the ability to automatically identify defect levels, this application includes defect type information and defect location information when performing semantic labeling, and as some optional implementation modes of this application, the defect Level information includes: acceptance information and scrap information.
为了使所述目标识别模型对目标缺陷进行自动判别,本申请针对上述缺陷种类,分别赋予了不同的目标语义解释,即赋予所述目标识别模型量化标准规则,梳理缺陷等级判断与背景语义之间的业务逻辑关系;如:In order to enable the target recognition model to automatically identify target defects, this application has given different target semantic interpretations for the above-mentioned defect types, that is, given the target recognition model quantitative standard rules, and sorted out the relationship between defect level judgment and background semantics. The business logic relationship; such as:
1)如图5所示,当所述样本图像中的缺陷种类信息为余铜信息时,所述目标语义解释为线路间隙宽度的解释,即余铜造成线路剩余间隙宽度不足1/2,则报废,若剩余间隙宽度超过1/2,则允收。图5为缺陷为余铜的电路板判别结果图像,图中黑色为基材区域,黄色为铜面区域,由于余铜需要卡控造成间隙的宽度,因此相较于现有判别结果的蓝框区域,本申请判别结果的红框区域重点突出缺陷与间隙宽度的对比,该图对应的标签为余铜-NG。1) As shown in Figure 5, when the defect type information in the sample image is residual copper information, the target semantic interpretation is the interpretation of the line gap width, that is, the residual copper causes the residual gap width of the line to be less than 1/2, then Scrap, if the remaining gap width exceeds 1/2, it will be accepted. Figure 5 is an image of the identification result of a circuit board whose defect is residual copper. In the figure, the black area is the base material area, and the yellow area is the copper surface area. Since the remaining copper needs to be clamped to control the width of the gap, compared with the blue frame of the existing identification results Area, the red frame area of the discrimination results of this application highlights the comparison between the defect and the gap width, and the label corresponding to this figure is Cu-NG.
2)如图6所示,当所述样本图像中的缺陷种类信息为破盘信息时,所述目标语义解释为线路宽度的解释,即破盘造成线路板上钻孔位置超过铜面区域,则报废,若未超过铜面区域,则允收。图6为缺陷为破盘的电路板判别结果图像,由于破盘需要卡控钻孔位置是否超出焊盘区域,因此相较于传统判别绿框的标注区域,本申请所标注的红框更加重点突出孔边缘特征,该图对应的标签为破盘-OK。2) As shown in Figure 6, when the defect type information in the sample image is broken disk information, the target semantic interpretation is the interpretation of line width, that is, the broken disk causes the drilling position on the circuit board to exceed the copper surface area, If it does not exceed the area of the copper surface, it will be accepted. Figure 6 is an image of the identification result of a circuit board whose defect is a broken disk. Since the broken disk needs to be clamped to control whether the drilling position exceeds the pad area, the red box marked in this application is more important than the traditionally identified green box marked area. Highlight the edge features of the hole, and the corresponding label in this figure is Broken Disk-OK.
3)如图7所示,当所述样本图像中的缺陷种类信息为凹坑信息时,所述目标语义解释为线路密度的解释或线路宽度的解释,即凹坑造成铜面区域出现大量聚集凹坑,或线路区凹坑造成线路宽度低于1/2,则报废,若不满足以上条件,则允收。图7为缺陷为凹坑的电路板判别结果图像,由于凹坑需要针对聚集性进行标注,因此本申请所述判别结果图中对每一个可独立凹坑都进行了标注,并进行线宽和聚集性进行了判断,相较于红框的标注,本申请所示的绿框通过重点突出实际缺陷面积/标框面积,提高了更高的信噪比,更高的信噪比的样本能更有利于模型的训练收敛。3) As shown in Figure 7, when the defect type information in the sample image is pit information, the target semantic interpretation is the interpretation of line density or line width, that is, the pits cause a large amount of aggregation in the copper surface area If the pits, or pits in the line area cause the width of the line to be less than 1/2, it will be scrapped, and if the above conditions are not met, it will be accepted. Figure 7 is an image of the discrimination result of a circuit board whose defects are pits. Since the pits need to be marked for aggregation, each independent pit is marked in the discrimination result diagram described in this application, and the line width and The aggregation was judged. Compared with the red frame, the green frame shown in this application highlights the actual defect area/marked frame area, which improves the higher signal-to-noise ratio, and the samples with higher signal-to-noise ratio can It is more conducive to the training convergence of the model.
电路板缺陷种类较多,包含露铜、板污、线路刮伤、阻焊过薄、防焊偏移、文字模糊等十几种缺陷,不同的缺陷形状、大小、颜色、位置均不一样,而现有缺陷判别方法无法对缺陷进行缺陷等级有效判别,仅能根据缺陷面积或缺陷数量等因素进行人工判别缺陷等级的操作,这种人工判别缺陷等级的方式由于缺少量化标准而导致主观因素较大,且判别缺陷等级的效率较低。与现有技术相比,本申请采用电路板样本图像训练获得目标判别模型,所述电路板样本图像包括若干样本图像以及若干所述样本图像对应的标签信息,所述标签信息基于对若干所述样本图像的语义描述信息获得,所述标签信息包括:缺陷种类信息和缺陷等级信息;由于在所述样本图像上添加了不同的缺陷种类标签信息和缺陷等级标签信息,以使得所述目标判别模型在训练过程中,能对不同的缺陷进行辨别并对所述缺陷的等级进行自动鉴别;因此在实际对待判别电路板的缺陷进行判别等级操作时,将待判别电路板的目标图像输入至所述目标判别模型中即可获得自动判别等级结果信息,从而提高了对电路板缺陷位置进行判别等级的效率。There are many types of circuit board defects, including more than a dozen defects such as exposed copper, board contamination, line scratches, thin solder mask, offset solder mask, and blurred text. Different defects have different shapes, sizes, colors, and positions. However, the existing defect identification methods cannot effectively determine the defect level of defects, and can only manually determine the defect level based on factors such as defect area or defect number. This manual method of determining defect level is relatively subjective due to the lack of quantitative standards. Large, and the efficiency of discriminating the defect level is low. Compared with the prior art, this application adopts circuit board sample image training to obtain a target discrimination model, and the circuit board sample image includes several sample images and label information corresponding to several sample images, and the label information is based on several The semantic description information of the sample image is obtained, and the label information includes: defect type information and defect level information; since different defect type label information and defect level label information are added to the sample image, so that the target discrimination model During the training process, different defects can be identified and the level of the defect can be automatically identified; therefore, when the level of defects of the circuit board to be identified is actually determined, the target image of the circuit board to be identified is input into the The automatic discrimination grade result information can be obtained in the target discrimination model, thereby improving the efficiency of the discrimination grade of the defect position of the circuit board.
为解决上述技术问题,本申请还提出了:如图8所示,一种电路板缺陷判别模型训练方法,包括以下步骤:In order to solve the above technical problems, this application also proposes: as shown in Figure 8, a circuit board defect discrimination model training method, comprising the following steps:
SS1、获取若干样本图像。SS1. Acquiring several sample images.
在具体的应用中,样本图像同样是采用AOI机台扫描获得的、专用于训练初始模型的图像,样本图像中会含有多种常见的缺陷。In a specific application, the sample image is also scanned by an AOI machine and is specially used for training the initial model, and the sample image may contain many common defects.
SS2、分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集。SS2. Semantically label defect information of several sample images respectively, so as to obtain the circuit board sample image set.
在上述步骤中,所述电路板样本图像集主要是:基于历史数据,对若干所述样本图像及其对应的若干语义解释进行语义判别,获得语义判别结果;基于所述语义判别结果,获得所述语义判别结果对应的目标语义解释;基于所述目标语义解释,分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集。上述步骤主要是为了提高语义标注内容与缺陷的实际信息更为贴近,并从若干所述样本图像中提取通用性语义标注内容,从而提高判别等级效率。其中,所述电路板样本图像集中包括若干所述样本图像以及若干所述样本图像对应的标签信息,所述标签信息包括:缺陷种类信息和缺陷等级信息。在具体的应用中,通过人工或机器对样本图像对缺陷信息进行标注。In the above steps, the circuit board sample image set is mainly: based on historical data, carry out semantic discrimination on several sample images and corresponding semantic interpretations to obtain semantic discrimination results; based on the semantic discrimination results, obtain all The target semantic interpretation corresponding to the semantic discrimination result; based on the target semantic interpretation, semantically annotate the defect information of several sample images to obtain the circuit board sample image set. The above steps are mainly to improve the closeness between the semantic annotation content and the actual defect information, and to extract the general semantic annotation content from several sample images, thereby improving the efficiency of the discrimination level. Wherein, the circuit board sample image set includes several sample images and label information corresponding to the several sample images, and the label information includes: defect type information and defect level information. In a specific application, the defect information is marked on the sample image manually or by a machine.
为了提高语义标注内容与缺陷的实际信息更为贴近,并从若干所述样本图像中提取通用性语义标注内容,从而提高判别等级效率;如图9所示,作为本申请一些可选实施方式,所述分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集,包括:In order to improve the semantic annotation content and the actual information of the defect closer, and extract the general semantic annotation content from several sample images, thereby improving the efficiency of the discrimination level; as shown in Figure 9, as some optional implementation methods of this application, The semantic labeling of defect information of several sample images respectively to obtain the circuit board sample image set includes:
SS21、基于历史数据,对若干所述样本图像及其对应的若干语义解释进行语义判别,获得语义判别结果。SS21. Based on historical data, perform semantic discrimination on several sample images and corresponding semantic interpretations, and obtain semantic discrimination results.
其中,所述历史数据是指基于若干样本图像中的缺陷信息,获得的语义判别结果信息数据;该步骤的目的在于,基于对历史数据的统计,获得所述样本图像及其对应的语义解释与语义判别结果之间的映射关系,从而获得判别率更高的语义解释,对电路板样本图像集进行标注,以在后续训练目标判别模型过程中,更利于所述目标判别模型学习所述样本图像及其对应的语义解释与语义判别结果之间的映射关系,从而提高所述目标判别模型在实际应用中对电路板缺陷具有更高的判别率。Wherein, the historical data refers to the semantic discrimination result information data obtained based on the defect information in several sample images; the purpose of this step is to obtain the sample images and their corresponding semantic interpretation and The mapping relationship between the semantic discrimination results, so as to obtain a semantic interpretation with a higher discrimination rate, and mark the circuit board sample image set, so that in the subsequent training process of the target discrimination model, it is more conducive for the target discrimination model to learn the sample image And the mapping relationship between the corresponding semantic interpretation and the semantic discrimination result, so as to improve the discrimination rate of the target discrimination model for circuit board defects in practical applications.
SS22、基于所述语义判别结果,获得所述语义判别结果对应的目标语义解释。SS22. Based on the semantic discrimination result, obtain a target semantic interpretation corresponding to the semantic discrimination result.
如上所述,基于正确的语义判别结果,获得正确语义判别结果所对应的目标语义解释,即获得识别率更高的语义解释作为目标语义解释,对电路板样本图像集进行标注,以在后续训练目标判别模型过程中,更利于所述目标判别模型学习所述样本图像及其对应的语义解释与语义判别结果之间的映射关系,从而提高所述目标判别模型在实际应用中对电路板缺陷具有更高的判别率。As mentioned above, based on the correct semantic discrimination result, the target semantic interpretation corresponding to the correct semantic discrimination result is obtained, that is, the semantic interpretation with a higher recognition rate is obtained as the target semantic interpretation, and the circuit board sample image set is annotated for subsequent training. In the target discrimination model process, it is more beneficial for the target discrimination model to learn the mapping relationship between the sample image and its corresponding semantic interpretation and the semantic discrimination result, thereby improving the effectiveness of the target discrimination model for circuit board defects in practical applications. Higher discrimination rate.
SS23、基于所述目标语义解释,分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集。SS23. Based on the target semantic interpretation, perform semantic annotation on defect information of several sample images respectively, so as to obtain the circuit board sample image set.
如上所述,基于所述目标语义解释,即识别率更高的语义解释作为目标语义解释,对电路板样本图像集进行标注,获得所述电路板样本图像集;以在后续训练目标判别模型过程中,更利于所述目标判别模型学习所述样本图像及其对应的语义解释与语义判别结果之间的映射关系,从而提高所述目标判别模型在实际应用中对电路板缺陷具有更高的判别率。As mentioned above, based on the target semantic interpretation, that is, the semantic interpretation with a higher recognition rate is used as the target semantic interpretation, and the circuit board sample image set is marked to obtain the circuit board sample image set; in order to train the target discriminant model in the subsequent process , which is more conducive to the target discrimination model learning the mapping relationship between the sample image and its corresponding semantic interpretation and semantic discrimination results, thereby improving the target discrimination model to have a higher discrimination of circuit board defects in practical applications Rate.
SS3、基于所述电路板样本图像集,对初始目标判别模型进行训练,获得所述目标判别模型。SS3. Based on the circuit board sample image set, train an initial target discrimination model to obtain the target discrimination model.
在具体的应用中,获得标注后的样本图像集后,需要通过初始模型对标注的位置、类别和等级进行学习,得到训练后的判别模型,采用的判别模型包括RCNN算法模型、FastRCNN算法模型以及Faster RCNN算法模型算法中的一种。In a specific application, after obtaining the marked sample image set, it is necessary to learn the marked position, category and level through the initial model to obtain the trained discriminant model. The discriminant models used include RCNN algorithm model, FastRCNN algorithm model and One of the Faster RCNN algorithm model algorithms.
作为本申请一些可选实施方式,所述电路板表面缺陷判别模型为Faster RCNN算法模型。在该实施方式中,Faster RCNN算法模型的性能优越,实现了精度较高的物体判别性能。Faster RCNN通过两阶网络与RPN,实现判别相比起其他一阶网络,两阶更为精准,尤其是针对高精度、多尺度以及小物体问题上,两阶网络优势更为明显。Faster RCNN在多个数据集及物体任务上效果都很好,对于个人的数据集,往往Fine-tune(微调)后就能达到较好的效果。Faster RCNN的整个算法框架中可以进行优化的点很多,提供了广阔的算法优化空间。因此采用所述Faster RCNN算法模型作为所述电路板表面缺陷判别模型,能提高所述判别模型对目标缺陷的判别速度以及准确率。As some optional implementations of the present application, the circuit board surface defect discrimination model is a Faster RCNN algorithm model. In this embodiment, the performance of the Faster RCNN algorithm model is superior, and a high-precision object discrimination performance is realized. Faster RCNN uses a two-stage network and RPN to achieve discrimination. Compared with other first-order networks, the two-stage network is more accurate, especially for high-precision, multi-scale, and small object problems. The advantages of the two-stage network are more obvious. Faster RCNN works well on multiple data sets and object tasks. For personal data sets, it can often achieve better results after Fine-tune. There are many points that can be optimized in the entire algorithm framework of Faster RCNN, providing a broad space for algorithm optimization. Therefore, adopting the Faster RCNN algorithm model as the circuit board surface defect discrimination model can improve the discrimination speed and accuracy of the discrimination model for target defects.
通过上述训练方法获得的电路板缺陷判别模型由于通过规则学习,即分别对若干所述样本图像的缺陷信息进行语义标注,以获得所述电路板样本图像集;其中,所述电路板样本图像集中包括若干所述样本图像以及若干所述样本图像对应的标签信息,所述标签信息包括:缺陷种类信息和缺陷等级信息;基于所述电路板样本图像集,对初始目标判别模型进行训练,获得所述目标判别模型,因此在实际应用中,能自动对所述电路板缺陷进行缺陷等级判别。The circuit board defect discrimination model obtained by the above training method is learned by rules, that is, the defect information of several sample images is semantically labeled to obtain the circuit board sample image set; wherein, the circuit board sample image set Including several sample images and label information corresponding to several sample images, the label information includes: defect type information and defect level information; based on the circuit board sample image set, the initial target discrimination model is trained to obtain the Therefore, in practical applications, it can automatically perform defect level discrimination on the circuit board defects.
基于同样的发明思路,如图10所示,本申请还提供了:一种电路板缺陷判别装置,包括:Based on the same inventive concept, as shown in Figure 10, the present application also provides: a circuit board defect discrimination device, comprising:
第一获取模块,用于获取待判别电路板的目标图像;The first acquisition module is used to acquire the target image of the circuit board to be identified;
第二获取模块,用于将所述目标图像输入已训练的目标判别模型,获得所述目标图像的缺陷判别信息;其中,所述目标判别模型由电路板样本图像集训练获得;所述电路板样本图像集中包括若干样本图像以及若干所述样本图像对应的标签信息,所述标签信息基于对若干所述样本图像的语义描述信息获得,所述标签信息包括:缺陷种类信息和缺陷等级信息。The second acquisition module is used to input the target image into the trained target discrimination model to obtain the defect discrimination information of the target image; wherein, the target discrimination model is obtained by training the circuit board sample image set; the circuit board The sample image set includes several sample images and label information corresponding to the sample images, the label information is obtained based on the semantic description information of the several sample images, and the label information includes: defect type information and defect level information.
需要说明的是,本实施例中电路板缺陷判别装置中各模块是与前述实施例中的电路板缺陷判别方法中的各步骤一一对应,因此,本实施例的具体实施方式可参照前述电路板缺陷判别方法的实施方式,这里不再赘述。It should be noted that each module in the circuit board defect identification device in this embodiment corresponds to each step in the circuit board defect identification method in the foregoing embodiment, therefore, the specific implementation of this embodiment can refer to the foregoing circuit The implementation of the board defect discrimination method will not be repeated here.
此外,在一种实施例中,本申请的实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,处理器执行所述计算机程序,实现如上所述的方法。In addition, in an embodiment, the embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored, and a processor executes the computer program to implement the above-mentioned Methods.
在一些实施例中,计算机可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、闪存、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备。计算机可以是包括智能终端和服务器在内的各种计算设备。In some embodiments, the computer-readable storage medium can be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; Various equipment. Computers can be various computing devices including smart terminals and servers.
在一些实施例中,可执行指令可以采用程序、软件、软件模块、脚本或代码的形式,按任意形式的编程语言(包括编译或解释语言,或者声明性或过程性语言)来编写,并且其可按任意形式部署,包括被部署为独立的程序或者被部署为模块、组件、子例程或者适合在计算环境中使用的其它单元。In some embodiments, executable instructions may take the form of programs, software, software modules, scripts, or code written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and its Can be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
作为示例,可执行指令可以但不一定对应于文件系统中的文件,可以可被存储在保存其它程序或数据的文件的一部分,例如,存储在超文本标记语言(HTML,Hyper TextMarkup Language)文档中的一个或多个脚本中,存储在专用于所讨论的程序的单个文件中,或者,存储在多个协同文件(例如,存储一个或多个模块、子程序或代码部分的文件)中。As an example, executable instructions may, but do not necessarily correspond to files in a file system, may be stored as part of files that hold other programs or data, for example, in a Hyper Text Markup Language (HTML) document in one or more scripts of the program in question, in a single file dedicated to the program in question, or in multiple cooperating files (for example, files that store one or more modules, subroutines, or sections of code).
作为示例,可执行指令可被部署为在一个计算设备上执行,或者在位于一个地点的多个计算设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算设备上执行。As an example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or alternatively, on multiple computing devices distributed across multiple sites and interconnected by a communication network. to execute.
需要说明的是,在本文中,术语“包括”、“包含”或者其他任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, in this document, the terms "comprising", "comprising" or any other variant are intended to cover a non-exclusive inclusion such that a process, method, article or system comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or system. Without further limitations, an element defined by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article or system comprising that element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如只读存储器/随机存取存储器、磁碟、光盘)中,包括若干指令用以使得一台多媒体终端设备(可以是手机,计算机,电视接收机,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on this understanding, the essence of the technical solution of this application or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products are stored in a storage medium (such as read-only memory/random access Memory, magnetic disk, optical disk), including several instructions to enable a multimedia terminal device (which may be a mobile phone, computer, television receiver, or network device, etc.) to execute the methods described in various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structures or equivalent process transformations made by using the description of the application and the accompanying drawings are directly or indirectly used in other related technical fields. , are all included in the patent protection scope of the present application in the same way.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210788263.8A CN114842275B (en) | 2022-07-06 | 2022-07-06 | Circuit board defect judging method, training method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210788263.8A CN114842275B (en) | 2022-07-06 | 2022-07-06 | Circuit board defect judging method, training method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114842275A CN114842275A (en) | 2022-08-02 |
CN114842275B true CN114842275B (en) | 2023-04-07 |
Family
ID=82575345
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210788263.8A Active CN114842275B (en) | 2022-07-06 | 2022-07-06 | Circuit board defect judging method, training method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114842275B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115439720B (en) * | 2022-11-08 | 2023-01-24 | 成都数联云算科技有限公司 | CAM image reconstruction method, training method, device, equipment and medium |
CN116343115B (en) * | 2023-03-15 | 2024-01-26 | 杭州力为科技有限公司 | PCB welding defect detection method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111862092A (en) * | 2020-08-05 | 2020-10-30 | 复旦大学 | A method and device for defect detection of express outer packaging based on deep learning |
CN114677567A (en) * | 2022-05-27 | 2022-06-28 | 成都数联云算科技有限公司 | Model training method and device, storage medium and electronic equipment |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103049753B (en) * | 2012-06-04 | 2016-01-20 | 深圳市强华科技发展有限公司 | The method of defect of printed circuit board is detected based on skeletal extraction and range conversion |
US10267846B1 (en) * | 2014-05-02 | 2019-04-23 | EMC IP Holding Company LLC | Printed circuit board (PCB) interconnect defect detection |
CN110648308A (en) * | 2019-08-06 | 2020-01-03 | 广东工业大学 | A method for identifying and locating PCB wire defects |
CN113205176B (en) * | 2021-04-19 | 2022-09-06 | 重庆创通联达智能技术有限公司 | Method, device and equipment for training defect classification detection model and storage medium |
CN113781485B (en) * | 2021-11-12 | 2022-09-09 | 成都数联云算科技有限公司 | Intelligent detection method and device for PCB defect types, electronic equipment and medium |
CN114463284A (en) * | 2022-01-14 | 2022-05-10 | 阿丘机器人科技(苏州)有限公司 | PCB defect detection method, device, equipment and storage medium |
CN114202543B (en) * | 2022-02-18 | 2022-04-26 | 成都数之联科技股份有限公司 | Method, device, equipment and medium for detecting dirt defects of PCB (printed circuit board) |
CN114549512A (en) * | 2022-03-01 | 2022-05-27 | 成都数之联科技股份有限公司 | A circuit board defect detection method, device, equipment and medium |
CN114581723A (en) * | 2022-05-06 | 2022-06-03 | 成都数之联科技股份有限公司 | Defect classification method, apparatus, storage medium, apparatus and computer program product |
-
2022
- 2022-07-06 CN CN202210788263.8A patent/CN114842275B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111862092A (en) * | 2020-08-05 | 2020-10-30 | 复旦大学 | A method and device for defect detection of express outer packaging based on deep learning |
CN114677567A (en) * | 2022-05-27 | 2022-06-28 | 成都数联云算科技有限公司 | Model training method and device, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN114842275A (en) | 2022-08-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114549512A (en) | A circuit board defect detection method, device, equipment and medium | |
CN114842275B (en) | Circuit board defect judging method, training method, device, equipment and storage medium | |
CN114627089B (en) | Defect identification method, defect identification device, computer equipment and computer readable storage medium | |
WO2023115409A1 (en) | Pad detection method and apparatus, and computer device and storage medium | |
CN110135225B (en) | Sample labeling method and computer storage medium | |
CN115661160B (en) | Panel defect detection method, system, device and medium | |
CN116542975B (en) | Defect classification method, device, equipment and medium for glass panel | |
US20220292661A1 (en) | Automated inspection system and operating method thereof | |
CN115578377B (en) | Panel defect detection method, training method, device, equipment and medium | |
CN110108717A (en) | A kind of display module production equipment state evaluating method, apparatus and system | |
CN117523577B (en) | Pin name upper scribing detection method and equipment based on longest horizontal straight line | |
CN114782431A (en) | Printed circuit board defect detection model training method and defect detection method | |
TWI755953B (en) | Automatic detection system and operation method thereof | |
CN116385770A (en) | PCB defect board marking and storing method, system, electronic equipment and storage medium | |
CN119574582B (en) | SMT surface defect visual inspection device based on AI image recognition | |
CN118096767B (en) | A method, system, device and storage medium for detecting wafer cutting defects | |
Khare et al. | PCB-fire: Automated classification and fault detection in PCB | |
WO2021197231A1 (en) | Image annotation method, device and system | |
CN118671075A (en) | Plate surface defect detection method and detection system based on image processing | |
CN116091503B (en) | A method, device, equipment, and medium for identifying foreign matter defects in a panel | |
CN117252844A (en) | Electronic element detection method, device, equipment and storage medium | |
CN112702905B (en) | Backtracking method and system for printed circuit board yield and production equipment error rate | |
US20230419466A1 (en) | Method and apparatus for identifying defect grade of bad picture, and storage medium | |
CN114820412A (en) | Automatic detection system and operation method thereof | |
TWI771908B (en) | Method for classifying and annotating image, device, electronic device, and storage medium |
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 | ||
EE01 | Entry into force of recordation of patent licensing contract | ||
EE01 | Entry into force of recordation of patent licensing contract |
Application publication date: 20220802 Assignee: Chengdu Shuzhi Innovation Lean Technology Co.,Ltd. Assignor: Chengdu shuzhilian Technology Co.,Ltd. Contract record no.: X2024510000014 Denomination of invention: Circuit board defect identification method, training method, device, equipment, and storage medium Granted publication date: 20230407 License type: Common License Record date: 20240723 |