CN-121978132-A - Printed circuit board micro defect detection method and system based on image recognition
Abstract
The application discloses a printed circuit board micro-defect detection method and system based on image recognition, and relates to the technical field of electronic component detection. The method comprises the steps of obtaining a multispectral image sequence of the surface of a component to be detected, generating a preliminary defect thermodynamic diagram containing space positions and abnormal degrees, establishing a morphological rule base according to the physical structure and material properties of the component, defining typical geometric forms and spectral response modes of defects, matching the thermodynamic diagram with the rule base class by class, verifying geometric constraints, filtering abnormal areas to generate a refining list, extracting multispectral reflection curves of the refining areas, calculating the fitness according to the spectral modes of the rule base, confirming and classifying according to the fitness and the abnormal degrees of the thermodynamic diagram, and outputting reports containing defect types, coordinates and severity levels. According to the application, the detection precision and reliability of the micro defects are improved by quantitative positioning abnormality through multispectral thermodynamic diagram and combining with dual verification of the morphological rule base.
Inventors
- MA MEIFENG
- ZHANG LIANG
- YANG PEI
- WANG YUANPING
Assignees
- 西安朗创电子技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260317
Claims (10)
- 1. A printed circuit board microdefect detection method based on image recognition, the method comprising: Acquiring a surface multispectral image sequence of an electronic component to be detected, and generating a preliminary defect thermodynamic diagram containing a space position and an abnormality degree based on the surface multispectral image sequence; establishing a morphology rule base corresponding to the defect type according to the known physical structure and material properties of the electronic component to be detected; performing class-by-class pattern matching and geometric constraint verification on the preliminary defect thermodynamic diagram and the morphology rule library, filtering abnormal areas which do not accord with any type of defect morphology rule, and generating a refined defect area list; Extracting a corresponding multispectral reflection curve from the multichannel fusion image for each defect region in the refined defect region list, and carrying out spectrum fitness calculation by combining a spectrum response mode of a corresponding type of defect in the morphology rule base; And finally confirming and classifying each defect in the refined defect area list according to the calculation result of the spectrum fitness and the abnormality degree of the corresponding area in the preliminary defect thermodynamic diagram, and outputting a detection report containing the defect type, the coordinate and the quantized severity level.
- 2. The method for detecting micro defects of a printed circuit board based on image recognition according to claim 1, wherein the generating a preliminary defect thermodynamic diagram including a spatial position and an abnormality degree based on the surface multispectral image sequence comprises: Respectively acquiring gray level images of the surface of the electronic component to be detected under a plurality of monochromatic light sources with different wavelengths to form the surface multispectral image sequence; performing region registration and pixel alignment operation on the surface multispectral image sequence to synthesize a multichannel fusion image of the electronic component to be detected, wherein each pixel point in the multichannel fusion image contains reflection intensity information from a plurality of wavelength light sources; retrieving a template image consistent with the model of the electronic component to be detected from a standard component database, and normalizing the multi-channel fusion image and the template image on a spatial scale to be matched with a reference feature point; Calculating the element values of the pixel intensity difference distribution map of each local image block in the multichannel fusion image and the corresponding region in the template image and the corresponding element values of the texture structure similarity matrix based on the matched corresponding relation; Constructing a hierarchical defect feature extraction network, wherein the hierarchical defect feature extraction network comprises a shallow edge response layer and a deep semantic abstraction layer, and the element values of the pixel intensity difference distribution map and the corresponding element values of the texture structure similarity matrix are input into the hierarchical defect feature extraction network in parallel to perform multi-scale feature extraction; And fusing the edge discontinuous feature map output by the shallow edge response layer and the abnormal mode feature map output by the deep semantic abstraction layer to generate a preliminary defect thermodynamic diagram containing space positions and abnormal degrees.
- 3. The method for detecting micro defects of a printed circuit board based on image recognition according to claim 2, wherein the performing region registration and pixel alignment operation on the surface multispectral image sequence to synthesize a multichannel fused image of the electronic component to be detected comprises: selecting an image collected under a central wavelength light source in the surface multispectral image sequence as a space reference image; For each gray level image collected under the non-central wavelength light source in the surface multispectral image sequence, calculating coordinate transformation parameters between each gray level image collected under the non-central wavelength light source and the space reference image in the surface multispectral image sequence by adopting an image registration algorithm based on a feature point detection and affine transformation model; carrying out space transformation on each gray level image under the non-central wavelength light source by utilizing the coordinate transformation parameters, so that the pixel points in each gray level image under the non-central wavelength light source are aligned with the pixel points of the space reference image one by one in space position; And stacking gray images of all the wavelength light sources with the completed pixel alignment according to the wavelength sequence to construct a multichannel fusion image.
- 4. The method for detecting micro defects of a printed circuit board based on image recognition according to claim 3, wherein the calculating the element values of the pixel intensity difference distribution map and the corresponding element values of the texture similarity matrix of each local image block in the multi-channel fusion image and the corresponding region in the template image comprises: Uniformly dividing the normalized multi-channel fusion image and the template image into a plurality of local image blocks which have the same size and are not overlapped; For each pair of local image blocks corresponding to space positions, calculating absolute intensity differences on different spectrum channels pixel by pixel to serve as spectrum channel differences, and taking an average value of the spectrum channel differences as a comprehensive intensity difference value of the pixel points; Counting the comprehensive intensity difference values of all pixel points in each local image block, and calculating the average value of all the comprehensive intensity difference values as the element value of the pixel intensity difference distribution map of the local image block area; Meanwhile, for each pair of local image blocks, calculating the correlation coefficient and contrast difference of the local image blocks on the gray level co-occurrence matrix characteristics, and taking the combined measurement of the correlation coefficient and the contrast difference as the corresponding element value of the texture similarity matrix.
- 5. The method for detecting micro-defects of a printed circuit board based on image recognition according to claim 2, wherein the constructing a hierarchical defect feature extraction network, the hierarchical defect feature extraction network including a shallow edge response layer and a deep semantic abstraction layer, the multi-scale feature extraction is performed by inputting the element values of the pixel intensity difference distribution map and the corresponding element values of the texture structure similarity matrix into the hierarchical defect feature extraction network in parallel, the method comprising: The shallow edge response layer is formed by connecting a plurality of edge detection operators with different scales in parallel, and the edge detection operators comprise a Sobel operator and a Laplacian operator; The element values of the pixel intensity difference distribution map are input into the shallow edge response layer, convolution operation is independently carried out by each edge detection operator, and edge gradient and direction information under different scales are extracted; carrying out weighted fusion on the edge gradients and the direction information output by each edge detection operator to generate an edge discontinuity characteristic map for emphasizing the edge discontinuity of the difference region; The corresponding element values of the texture structure similarity matrix undergo nonlinear transformation and feature dimension reduction for a plurality of times in the deep semantic abstraction layer, and high-dimensional feature expression associated with a typical defect mode is abstracted step by step; and outputting the high-dimensional feature expression as a feature map by the last layer of the deep semantic abstraction layer, namely the abnormal pattern feature map.
- 6. The method for detecting micro-defects of a printed circuit board based on image recognition according to claim 1, wherein the step of performing class-by-class pattern matching and geometric constraint verification on the preliminary defect thermodynamic diagram and the morphology rule base, filtering out abnormal regions which do not conform to any class of defect morphology rules, and generating a refined defect region list comprises the steps of: reading typical geometrical description of each type of defect one by one from the morphology rule library, wherein the typical geometrical description comprises an aspect ratio range, an area threshold value, boundary curvature characteristics and a main axis direction; Extracting the outlines of potential defect areas with abnormal intensities exceeding a threshold value by using a connected domain analysis algorithm on the preliminary defect thermodynamic diagram; Calculating actual geometric form parameters of each extracted potential defect area outline, and comparing the actual geometric form parameters with the typical geometric form description of each type of defect in a form rule base one by one; and only reserving potential defect areas with the matching degree of the actual geometric parameters and the typical geometric description exceeding a set threshold, and recording outline information and matching defect type assumptions into the refined defect area list.
- 7. The method of claim 6, wherein for each defect region in the refined defect region list, extracting a corresponding multispectral reflection curve from the multichannel fused image comprises: for each item in the refined defect area list, positioning the pixel position of the refined defect area in the multi-channel fusion image according to the contour information recorded by each item; Acquiring data of all pixel points of the multichannel fusion image in a contour area, wherein each pixel point comprises reflection intensity values under all acquired wavelength light sources; for the refining defect area, respectively calculating the area average value of the reflection intensity values of all pixel points under each specific wavelength light source; and sequentially connecting the calculated area average values under the light sources with a plurality of wavelengths according to the order of the wavelengths from short to long, and drawing a curve which takes the wavelength as a horizontal axis and the average reflection intensity as a vertical axis, wherein the curve is the multispectral reflection curve of the refining defect area.
- 8. The method for detecting micro-defects of a printed circuit board based on image recognition according to claim 7, wherein the performing spectral fitness calculation by combining the spectral response modes of the corresponding types of defects in the morphology rule base includes: Obtaining a standard spectral response curve corresponding to the defect type assumed by the current refined defect area from the morphology rule library; Aligning sampling points of the multispectral reflection curve of the current defect area and the standard spectrum response curve of the same type; Calculating the difference value of the reflection intensity between all the corresponding sampling points on the two curves, and solving the root mean square error of the difference value of the reflection intensity; and inputting the root mean square error into a preset conversion function to obtain spectrum fitness.
- 9. The method for detecting micro-defects of a printed circuit board based on image recognition according to claim 8, wherein the final verification and classification labeling of each defect in the refined defect area list according to the calculation result of the spectrum fitness and the degree of abnormality of the corresponding area in the preliminary defect thermodynamic diagram comprises: Presetting an abnormality degree confirmation threshold, and setting a confirmation threshold of the spectrum fitness for each defect type; for each item in the refined defect area list, judging whether the spectrum matching degree calculated by the item reaches a confirmation threshold value of the spectrum matching degree; Meanwhile, reading an average value of the abnormality degree of the refining defect area from the preliminary defect thermodynamic diagram, and judging whether the average value reaches an abnormality degree confirmation threshold of the assumed defect type; only when the average value of the spectrum coincidence degree and the abnormality degree simultaneously reaches or exceeds a corresponding confirmation threshold value, finally confirming the refining defect area as the assumed defect type, and classifying and marking the refining defect area as the assumed defect type; And if the average value of the spectrum coincidence degree and the abnormality degree cannot reach or exceed the corresponding confirmation threshold value at the same time, removing the item from the refined defect area list or marking the item as a suspected defect to be reviewed.
- 10. A printed circuit board micro defect detection system based on image recognition, comprising a memory, a processor and a computer program stored in the memory and running on the processor, characterized in that the processor, when executing the computer program, realizes the steps of the printed circuit board micro defect detection method based on image recognition as claimed in any one of the preceding claims 1 to 9.
Description
Printed circuit board micro defect detection method and system based on image recognition Technical Field The application relates to the technical field of electronic component detection, in particular to a printed circuit board microdefect detection method and system based on image recognition. Background In the field of manufacturing and detection of printed circuit boards, defect detection is a key element for guaranteeing product quality. In the prior art, the surface image of a circuit board is mainly acquired through optical imaging, and defects such as scratches, stains, bad welding spots and the like are identified by using a method based on a gray threshold value, edge detection or a general machine learning model. However, the method has obvious limitations that firstly, in the defect sensing and characterization level, a single spectrum or limited multispectral image is generally relied on, the information dimension is insufficient, a comprehensive characterization image capable of accurately reflecting the spatial position and the quantitative abnormality degree of the defect at the same time is difficult to generate, so that the severity evaluation of the defect is rough, secondly, in the defect judging and verifying level, general image features or data driving models which are disjointed with the physical characteristics of the circuit board are mostly adopted, prior knowledge rules aiming at the materials, the structure and the typical defect modes of the circuit board are not integrated, and therefore, when the background is complicated, the illumination is uneven or texture interference exists, the false abnormality similar to the real defect and the appearance is difficult to accurately distinguish, and finally, the omission ratio and the false detection ratio of the detection system are higher. Disclosure of Invention The application aims to solve the defects in the prior art, and provides a printed circuit board micro defect detection method and system based on image recognition. In order to achieve the above purpose, the application adopts the following technical scheme that the method for detecting the micro defects of the printed circuit board based on image recognition comprises the following steps: Acquiring a surface multispectral image sequence of an electronic component to be detected, and generating a preliminary defect thermodynamic diagram containing a space position and an abnormality degree based on the surface multispectral image sequence; establishing a morphology rule base corresponding to the defect type according to the known physical structure and material properties of the electronic component to be detected; performing class-by-class pattern matching and geometric constraint verification on the preliminary defect thermodynamic diagram and the morphology rule library, filtering abnormal areas which do not accord with any type of defect morphology rule, and generating a refined defect area list; Extracting a corresponding multispectral reflection curve from the multichannel fusion image for each defect region in the refined defect region list, and carrying out spectrum fitness calculation by combining a spectrum response mode of a corresponding type of defect in the morphology rule base; And finally confirming and classifying each defect in the refined defect area list according to the calculation result of the spectrum fitness and the abnormality degree of the corresponding area in the preliminary defect thermodynamic diagram, and outputting a detection report containing the defect type, the coordinate and the quantized severity level. As a further aspect of the present application, generating a preliminary defect thermodynamic diagram comprising spatial location and degree of anomaly based on the sequence of surface multispectral images includes: Respectively acquiring gray level images of the surface of the electronic component to be detected under a plurality of monochromatic light sources with different wavelengths to form the surface multispectral image sequence; performing region registration and pixel alignment operation on the surface multispectral image sequence to synthesize a multichannel fusion image of the electronic component to be detected, wherein each pixel point in the multichannel fusion image contains reflection intensity information from a plurality of wavelength light sources; retrieving a template image consistent with the model of the electronic component to be detected from a standard component database, and normalizing the multi-channel fusion image and the template image on a spatial scale to be matched with a reference feature point; Calculating the element values of the pixel intensity difference distribution map of each local image block in the multichannel fusion image and the corresponding region in the template image and the corresponding element values of the texture structure similarity matrix based on the matched corresponding rela