A PCB production defect detection method and system based on image analysis

By constructing a correlation model of global and local feature sequences and dynamically adjusting the detection strategy, the problem of detection accuracy of PCB circuit boards in dynamic environments is solved, and high-precision and highly environmentally adaptable defect detection is achieved.

CN120070375BActive Publication Date: 2025-12-05JIANGXI JUNXIN ELECTRONICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510146580.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-12-05
Estimated Expiration
2045-02-10

AI Technical Summary

Technical Problem

Existing PCB circuit board defect detection technologies have low detection accuracy in dynamic environments, are difficult to adapt to changes in different shooting environments, and cannot effectively identify minute defects.

Method used

By analyzing multiple inspection sample images of PCB circuit boards, global and local feature sequences are constructed, a global correlation model is established, key features are identified, the inspection strategy is dynamically adjusted, and data sampling influence parameters are generated by combining local visual feature difference analysis to achieve high-precision defect detection.

Benefits of technology

It enables high-precision defect detection of PCB circuit boards in dynamic environments, can identify minute defects, and has strong environmental adaptability, thus improving the accuracy and stability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070375B_ABST
    Figure CN120070375B_ABST
Patent Text Reader

Abstract

The application provides a PCB production defect detection method and system based on image analysis, and relates to the technical field of image processing. The method comprises the following steps: obtaining a plurality of detection sample images of a PCB and performing data sampling difference identification to obtain a plurality of data sampling mode sets; dividing each detection sample image into a plurality of local areas and constructing a local feature sequence; constructing a plurality of local area correlation matrices of the data sampling mode set and fusing to obtain a global correlation model; determining the local abnormal area of each abnormal sample in the data sampling mode set and generating a data sampling influence parameter of each local visual feature; determining a target set matched with the image to be analyzed, and performing production defect detection on the image to be analyzed according to the global correlation model of the target set and the plurality of data sampling influence parameters to obtain a defect detection result. The application improves the detection accuracy of PCB production defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and system for detecting defects in PCB circuit board production based on image analysis. Background Technology

[0002] Printed circuit boards (PCBs) are a core component of electronic products, making quality control crucial during production. Defect detection is a vital part of this process. In actual PCB manufacturing, the optical characteristics are easily affected by environmental factors. For example, variations in lighting intensity, shooting angle, and shooting position can alter the optical features in the image, thus impacting detection accuracy. For complex PCB surfaces, due to differences in materials, processes, and surface structure, some defects may be obscured or interfere with, causing defect detection methods based on visual features such as texture and brightness to lack sufficient discriminative power and precise defect location due to external interference. Failure to flexibly adjust detection strategies based on changes in lighting or viewing angle can lead to poor adaptability of the detection solution to different shooting environments.

[0003] Furthermore, some detection techniques focus primarily on feature matching and inter-region similarity analysis in static environments, neglecting the collaborative change patterns between features under dynamic environmental changes. For example, in darker environments, changes in brightness features caused by illumination may not be significant, while texture features may be more prominent. If the focus on different features cannot be automatically adjusted for different lighting conditions, viewing angles, and other factors, the detection accuracy may not remain consistent across different environments. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention proposes a method and system for detecting defects in PCB circuit board production based on image analysis. By fully utilizing image information under different shooting environments, the method analyzes the interrelationship of optical features in different regions and can intelligently identify key features affecting the accuracy of defect detection in dynamic environmental changes, thereby improving the accuracy and stability of defect detection in PCB circuit board production.

[0005] To achieve the above objectives, the first aspect of the present invention provides a method for detecting manufacturing defects in PCB circuit boards based on image analysis, comprising:

[0006] Multiple inspection sample images of PCB circuit boards are acquired, including multiple normal samples and abnormal samples. Multiple global visual features of each inspection sample image are extracted and a global feature sequence is constructed. Data sampling difference recognition is performed on multiple inspection sample images based on the global feature sequence to construct multiple data sampling pattern sets.

[0007] According to the preset segmentation template, multiple detection sample images in each data sampling mode set are segmented into regions to divide each detection sample image into multiple local regions. Multiple local visual features of each local region are extracted and a local feature sequence is constructed.

[0008] Based on multiple local feature sequences of the detected sample images, a local region correlation matrix is ​​constructed for each normal sample in the data sampling pattern set. The local region correlation matrices of multiple normal samples in the data sampling pattern set are then fused to obtain a global correlation model for the data sampling pattern set.

[0009] Identify the local abnormal region of each abnormal sample in the data sampling pattern set, and perform local feature difference analysis on multiple local abnormal regions based on multiple normal samples in the data sampling pattern set to generate data sampling influence parameters for each local visual feature;

[0010] After acquiring the image to be analyzed, a target set matching the image to be analyzed is determined, multiple target feature sequences of the image to be analyzed are extracted, and production defect detection is performed on the image to be analyzed based on the global association model of the target set and multiple data sampling influence parameters to obtain the defect detection results of the image to be analyzed.

[0011] Preferably, a global correlation model for the data sampling pattern set is obtained by fusing the local region correlation matrices of multiple normal samples in the data sampling pattern set, including:

[0012] Tensor quantization is performed on the local region correlation matrix of multiple normal samples in the data sampling pattern set to generate a target tensor. The target tensor is then decomposed using Tucker to obtain the core tensor and multiple factor matrices.

[0013] The image association feature matrix is ​​extracted from multiple factor matrices, and the feature mapping vector corresponding to the local region association matrix of each normal sample is determined based on the image association feature matrix.

[0014] The process involves fusing the local region association matrices of multiple normal samples based on multiple feature mapping vectors. This includes calculating multiple group mapping parameters for each normal sample using the feature mapping vectors, determining the feature fusion weights of the normal samples based on the multiple group mapping parameters, and fusing the local region association matrices corresponding to the multiple normal samples based on the feature fusion weights to generate a global association model of the data sampling pattern set.

[0015] Preferably, based on multiple normal samples in the data sampling pattern set, local feature difference analysis is performed on multiple local abnormal regions to generate data sampling influence parameters for each local visual feature, including:

[0016] Determine the local reference regions corresponding to each local anomalous region in multiple normal samples, perform feature difference analysis on each local anomalous region based on multiple local reference regions, calculate the local difference parameters of each local visual feature in multiple local reference regions, and construct the local difference vector of each local anomalous region for each local visual feature.

[0017] Extract multiple local difference vectors for each local visual feature with respect to multiple local abnormal regions. Process the multiple local difference vectors for each local visual feature according to the feature fusion weight of normal samples, and calculate the data sampling influence parameter for each local visual feature.

[0018] The process of processing multiple local difference vectors of each local visual feature based on the feature fusion weights of normal samples includes generating a pattern difference parameter for each normal sample based on multiple local difference parameters of each local visual feature with respect to each normal sample in the multiple local difference vectors of each local visual feature, and weighting and fusing the multiple pattern difference parameters of each local visual feature based on the feature fusion weights of normal samples to generate a data sampling influence parameter for the local visual feature.

[0019] Preferably, production defect detection is performed on the image to be analyzed based on a global correlation model of the target set and multiple data sampling influence parameters, including:

[0020] For multiple target feature sequences of the image to be analyzed, the image to be analyzed is segmented according to a preset segmentation template to obtain multiple local regions of the image to be analyzed, and the target feature sequence of each local region is constructed to generate multiple local feature sequences of the image to be analyzed.

[0021] Based on multiple data sampling influence parameters, feature optimization is performed on multiple target feature sequences of the image to be analyzed. This includes correcting the feature values ​​of each local visual feature in each target feature sequence according to the data sampling influence parameters corresponding to each local visual feature, and generating a corrected feature sequence corresponding to each target feature sequence.

[0022] A target correlation matrix is ​​constructed based on multiple modified feature sequences of the image to be analyzed. Local correlation target vectors for each local region in the image to be analyzed are extracted from the target correlation matrix. Local correlation reference vectors for each local region in the image to be analyzed are determined based on the global correlation model. Defect detection is performed on multiple local regions of the image to be analyzed based on multiple local correlation reference vectors. Multiple feature abnormal regions of the image to be analyzed are identified and defect detection results of the image to be analyzed are generated.

[0023] Preferably, defect detection based on multiple local correlation reference vectors in multiple local regions of the image to be analyzed includes:

[0024] Calculate the difference parameter between the local associated target vector and the local associated reference vector of each local region in the image to be analyzed, and mark the local regions with the difference parameter greater than the preset difference threshold as feature abnormal regions.

[0025] A second aspect of the present invention provides a PCB circuit board manufacturing defect detection system based on image analysis, the system being used to implement the above-mentioned PCB circuit board manufacturing defect detection method based on image analysis, comprising:

[0026] The sample preprocessing module is used to acquire multiple inspection sample images of the PCB circuit board, including multiple normal samples and abnormal samples. It extracts multiple global visual features of each inspection sample image and constructs a global feature sequence. Based on the global feature sequence, it performs data sampling difference recognition on multiple inspection sample images to construct multiple data sampling pattern sets.

[0027] The local feature extraction module is used to perform region segmentation on multiple detection sample images in each data sampling mode set according to a preset segmentation template, so as to divide each detection sample image into multiple local regions, extract multiple local visual features of each local region, and construct a local feature sequence.

[0028] The regional correlation analysis module is used to construct a local regional correlation matrix for each normal sample in the data sampling pattern set based on multiple local feature sequences of the detected sample image, and to fuse the local regional correlation matrices of multiple normal samples in the data sampling pattern set to obtain a global correlation model of the data sampling pattern set.

[0029] The feature impact analysis module is used to determine the local abnormal region of each abnormal sample in the data sampling pattern set. Based on multiple normal samples in the data sampling pattern set, it performs local feature difference analysis on multiple local abnormal regions and generates data sampling impact parameters for each local visual feature.

[0030] The production defect detection module is used to determine the target set that matches the image to be analyzed after the image is acquired, extract multiple target feature sequences from the image to be analyzed, and perform production defect detection on the image to be analyzed based on the global association model of the target set and multiple data sampling influence parameters to obtain the defect detection result of the image to be analyzed.

[0031] Preferably, for the regional correlation analysis module, the local regional correlation matrices of multiple normal samples in the data sampling pattern set are fused to obtain a global correlation model of the data sampling pattern set, including:

[0032] Tensor quantization is performed on the local region correlation matrix of multiple normal samples in the data sampling pattern set to generate a target tensor. The target tensor is then decomposed using Tucker to obtain the core tensor and multiple factor matrices.

[0033] The image association feature matrix is ​​extracted from multiple factor matrices, and the feature mapping vector corresponding to the local region association matrix of each normal sample is determined based on the image association feature matrix.

[0034] The process involves fusing the local region association matrices of multiple normal samples based on multiple feature mapping vectors. This includes calculating multiple group mapping parameters for each normal sample using the feature mapping vectors, determining the feature fusion weights of the normal samples based on the multiple group mapping parameters, and fusing the local region association matrices corresponding to the multiple normal samples based on the feature fusion weights to generate a global association model of the data sampling pattern set.

[0035] The present invention has the following beneficial effects:

[0036] This invention analyzes multiple inspection sample images of PCB circuit boards, initially classifies different data sampling scenarios from a global feature perspective, and constructs corresponding data sampling pattern sets. It then conducts in-depth analysis of each of the multiple inspection sample images from a local feature perspective, performs image analysis from the perspective of feature correlation in local regions to construct a global correlation model for different data sampling pattern sets, and analyzes the images from the perspective of feature difference variation to generate data sampling influence parameters for each local visual feature. Through the global correlation model and the data sampling influence parameters of different local visual features, this invention analyzes production defects in PCB circuit boards, enabling high-precision detection of production defects in PCB circuit boards under different shooting environments. It can effectively identify minute defects and has strong environmental adaptability, dynamically adjusting the detection strategy according to changes in the actual shooting environment, thus improving the detection accuracy of PCB circuit board production defects. Attached Figure Description

[0037] Figure 1 This is a flowchart illustrating a PCB manufacturing defect detection method based on image analysis, provided as an embodiment of the present invention.

[0038] Figure 2 This is a schematic diagram of a PCB circuit board manufacturing defect detection system based on image analysis, provided as an embodiment of the present invention. Detailed Implementation

[0039] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for explaining the invention and are not intended to limit the invention.

[0040] Please see Figure 1 The present invention provides a method for detecting defects in PCB circuit board manufacturing based on image analysis, which specifically includes the following steps:

[0041] Step S01: Obtain multiple detection sample images of the PCB circuit board, extract multiple global visual features of each detection sample image and construct a global feature sequence, perform data sampling difference recognition on multiple detection sample images based on the global feature sequence, and construct a set of multiple data sampling patterns.

[0042] The process involves multiple inspection sample images of PCB circuit boards, including several normal samples without defects and several abnormal samples with minor defects. These images are acquired under various shooting environments using high-resolution industrial cameras and other equipment, such as different ambient light intensities, shooting angles, and shooting positions, to obtain widely representative sample data. For each inspection sample image, its corresponding global visual features are extracted. These features include the image's overall brightness, texture, color distribution, and contrast, reflecting the overall macroscopic optical properties of the image. Analysis of these global visual features allows for the construction of a global feature sequence for each image. Considering that the optical characteristics of images change under different sampling scenarios, data sampling difference identification is performed on multiple inspection sample images. For example, clustering techniques such as the K-means algorithm are used to cluster multiple images, constructing multiple sets of data sampling patterns. Each set of data sampling patterns represents the similar patterns exhibited by the global visual features of the images under a specific sampling environment.

[0043] Step S02: Perform region segmentation on multiple detection sample images in each data sampling mode set according to the preset segmentation template, so as to divide each detection sample image into multiple local regions, extract multiple local visual features of each local region, and construct a local feature sequence.

[0044] In this process, after classifying multiple images from the perspective of global visual features, for each set of data sampling patterns, multiple detection sample images are divided into regions using a preset segmentation template, resulting in multiple local regions corresponding to each detection sample image. This process can involve rotating or other methods to transform different images to the same position. The preset template can be constructed based on a fixed grid; for example, a 256*256 image can be divided into multiple 8*8 local regions. Thus, after dividing the image into regions using the preset segmentation template, each image can obtain multiple local regions distributed at the same location. Those skilled in the art can also rationally divide the region based on the specific structure and manufacturing process of different types of PCB circuit boards, considering factors such as the material composition of the PCB circuit board (e.g., copper layer, metal coating, solder mask layer) and microstructure (e.g., solder joints, lines, conductive paths). The significance of dividing the image into multiple local regions lies in analyzing the correlation changes in the local optical properties of different local regions as the data acquisition scene changes. In each local region, multiple local visual features are further extracted and a local feature sequence is constructed, such as texture features, brightness distribution, color distribution, etc., which are similar to global visual features. This means that more local and minute regions are analyzed to more accurately reflect the changes in optical properties of different regions in the image, providing detailed feature information for subsequent defect detection.

[0045] Step S03: Based on multiple local feature sequences of the detected sample images, construct the local region correlation matrix of each normal sample in the data sampling pattern set, and fuse the local region correlation matrices of multiple normal samples in the data sampling pattern set to obtain the global correlation model of the data sampling pattern set.

[0046] Specifically, for local feature sequences of multiple local regions in the detected sample image, a local region correlation matrix is ​​constructed for each normal sample in the data sampling pattern set. This matrix represents the optical feature correlation between different local regions in the image, such as the similarity or correlation between the optical features of any two local regions. The correlation between local regions helps to understand and analyze the collaborative change patterns between different regions. The distance between the local feature sequences of any two local regions can be calculated using distance metrics such as Euclidean distance and cosine similarity to construct the local region correlation matrix for each normal sample. Furthermore, the local region correlation matrices of multiple normal sample images are fused to obtain a comprehensive global correlation model, capturing the feature correlation between different local regions in the image under the data sampling scenario corresponding to the data sampling pattern set. It is worth noting that due to differences in manufacturing processes or structures, the optical visual characteristics of different areas in a PCB circuit board can change to varying degrees under different data sampling environments. For example, the light reflection characteristics of the copper layer are significantly different from those of the solder mask and solder joints. These differences can change to varying degrees with changes in factors such as illumination and angle. Therefore, capturing the specific correlation and synergy between the optical characteristics of different areas in a normal image under different scenarios, such as different ambient light intensities, is crucial. Ultimately, a global correlation model of different data sampling mode sets can reflect the differences in the intrinsic correlation between the optical characteristics of areas in the image as the sampling environment changes.

[0047] Step S04: Determine the local abnormal region of each abnormal sample in the data sampling pattern set, and perform local feature difference analysis on multiple local abnormal regions based on multiple normal samples in the data sampling pattern set to generate data sampling influence parameters for each local visual feature.

[0048] The global correlation model constructed from multiple normal samples reflects the correlation of optical characteristics in different local areas. For multiple abnormal samples in the data sampling pattern set, the analysis is performed from the perspective of feature importance to identify the changes in the degree of difference of different visual features under different data sampling scenarios, so as to determine some key visual features under different scenarios.

[0049] In this process, the local abnormal region of each abnormal sample is first identified. Specifically, defect annotation information of multiple abnormal samples can be simultaneously acquired during the initial sample acquisition to locate the abnormal region. Local abnormal regions are usually caused by optical feature anomalies due to certain production defects or abnormal conditions. After locating the local region with production defects in each abnormal sample, the optical features of the same local region in the same normal sample from the data sampling pattern set are analyzed to determine the degree of difference in optical feature anomalies caused by production defects. In different scenarios, such as darker environments, the overall brightness of the image is usually low due to lower light intensity. In this case, brightness features may be significantly suppressed because the brightness difference in the image is small under low light conditions, and the brightness information is often blurry or has low contrast. This makes changes in brightness features in low light environments difficult to perceive and hard to use for effective defect detection.

[0050] Therefore, for each data sampling pattern set, since it represents one data sampling environment, by analyzing the defect areas of multiple abnormal samples in the set and comparing the differences in optical features between them and normal areas at the same location, we can determine which optical features exhibit significant differences. This allows us to identify which features are more significant in different scenarios. In actual detection, we can then focus on certain key optical features in different scenarios to improve detection accuracy. Finally, by quantifying the degree of difference in different visual features, we obtain the data sampling influence parameters for each local visual feature. These parameters reflect the significance of the change in each feature under abnormal and normal conditions, helping to determine which local visual features play a more crucial role in anomaly detection under specific environments, providing a quantitative basis for subsequent defect detection.

[0051] Step S05: After acquiring the image to be analyzed, determine the target set that matches the image to be analyzed, extract multiple target feature sequences from the image to be analyzed, and perform production defect detection on the image to be analyzed based on the global association model of the target set and multiple data sampling influence parameters to obtain the defect detection result of the image to be analyzed.

[0052] After acquiring the image to be analyzed—that is, the image of the PCB circuit board to be inspected for production defects, captured by a high-definition camera—the process first matches the image to be analyzed with multiple data sampling pattern sets based on multiple global visual features to determine the data sampling environment in which the image is located. In this process, corresponding feature vectors can be constructed based on the multiple global visual features of the image to be analyzed. For multiple data sampling pattern sets, representative cluster centers for each set can be determined based on clustering results. The distances between the feature vectors of the image to be analyzed regarding multiple global visual features and the different cluster centers are calculated, and the data sampling pattern set with the closest distance is selected as the target set.

[0053] Then, multiple target feature sequences of different local regions in the image to be analyzed are extracted to reflect the optical features such as brightness, texture, and color changes in different local regions of the image. Production defect detection is then performed on the image based on the global association model of the target set and multiple data sampling influence parameters. The data sampling influence parameters characterize which optical visual features are more critical in the current scene; that is, in the presence of defects, they will differ more significantly from normal images. Therefore, based on multiple data sampling influence parameters, feature enhancement is first applied to the multiple target feature sequences of the image to amplify potential minor anomalies. Then, based on the global association model of the target set, the feature correlation between different local regions in the image is analyzed. For regions with anomalies, their feature correlation with other normal regions in the image may change. If it does not conform to the cooperative change pattern between different regions in a normal image, it indicates that the region is likely to have a production defect. This enables the frequent detection and location of potential minor production defects in different regions of the PCB circuit board, yielding corresponding defect detection results.

[0054] The image analysis-based PCB manufacturing defect detection method described above comprehensively utilizes global features and local regional difference analysis. It designs multi-level image analysis methods from the perspectives of local regional correlation and feature difference changes, enabling high-precision detection of PCB manufacturing defects in different shooting environments. It can not only effectively identify minute defects, but also has strong environmental adaptability, dynamically adjusting the detection strategy according to changes in the actual shooting environment, greatly improving the accuracy of PCB manufacturing defect detection.

[0055] In the above implementation process, for step S03, the local region correlation matrices of multiple normal samples in the data sampling pattern set are fused to obtain the global correlation model of the data sampling pattern set, specifically including:

[0056] Tensorization is performed on the local region correlation matrices of multiple normal samples in the data sampling pattern set to generate a target tensor. For example, for each normal sample's corresponding two-dimensional local region correlation matrix, multiple matrices are stacked to obtain a three-dimensional target tensor, with each local region correlation matrix corresponding to a slice in the target tensor. Then, Tucker decomposition is performed on the target tensor to obtain a core tensor and multiple factor matrices. The core tensor captures high-order interaction information between different images, between local regions, and between features, representing the similarity relationships between local regions in different environments, i.e., different images. The corresponding factor matrices specifically contain three typical matrices U, V, and X, which represent the latent patterns of different images in the latent pattern space, the changes of different local regions in different patterns (i.e., scenes), and the relationships between different images in the same scene, respectively.

[0057] The factor matrix representing the latent patterns of different images in the latent pattern space is denoted as the image association feature matrix. The dimension of the image association feature matrix depends on the rank of one of the decompositions and the number of normal samples in the data sampling pattern set. Each row of the matrix represents one of the normal samples. After extracting the image association feature matrix from multiple factor matrices, the feature mapping vector corresponding to the local region association matrix of each normal sample is determined based on the image association feature matrix. That is, the image association feature matrix represents multiple elements of one image to construct a feature mapping vector, which represents the local region association matrix of the corresponding normal sample. It can be understood as a low-dimensional representation of the local region association matrix, which can effectively represent the relationship between the local and global characteristics of the sample.

[0058] Finally, the local region correlation matrices of multiple normal samples are fused based on multiple feature mapping vectors to generate a global correlation model of the data sampling pattern set.

[0059] Specifically, during the fusion process, multiple group mapping parameters are calculated for each normal sample using feature mapping vectors to measure the degree of feature association between different samples. This can be achieved by calculating association parameters, such as cosine similarity, between the feature mapping vectors of the normal sample and other normal samples. Then, the feature fusion weight of the normal sample is determined based on these multiple group mapping parameters. For example, the average of these parameters can be used as the feature fusion weight. A larger feature fusion weight indicates greater representativeness within the set. Finally, the local region association matrices corresponding to the multiple normal samples are fused based on their feature fusion weights. During the fusion process, normal samples with larger feature fusion weights contribute more significantly to the global association model, while those with smaller weights are appropriately weakened. The fused global association model comprehensively reflects the feature association characteristics of multiple normal samples across different local regions, reflecting the group feature patterns of normal samples in the set.

[0060] In the above implementation process, for step 04, local feature difference analysis is performed on multiple local abnormal regions based on multiple normal samples in the data sampling pattern set to generate data sampling influence parameters for each local visual feature, specifically including:

[0061] The local reference regions corresponding to each local anomalous region in multiple normal samples are determined. Based on the multiple local reference regions, feature difference analysis is performed on each local anomalous region. Specifically, the local difference parameters of each local visual feature in the multiple local reference regions are calculated. For example, the average brightness of multiple pixels in a local region is taken as the brightness feature of the local region. The difference value between the brightness feature of the local anomalous region and the brightness feature in the multiple local reference regions is calculated to obtain the local difference parameters of the local visual feature of brightness in the multiple local reference regions. Then, the local difference vector of each local anomalous region with respect to each local visual feature is constructed through the multiple local difference parameters.

[0062] Further, multiple local difference vectors are extracted for each local visual feature across multiple local anomalous regions; that is, multiple local difference vectors for the same local visual feature under each local anomalous region. Combining the feature fusion weights of normal samples determined earlier, the importance of the local difference vectors is determined based on the normal sample to which they belong. The multiple local difference vectors of each local visual feature are then processed according to the feature fusion weights of normal samples, specifically by weighted fusion of the multiple local difference vectors for each local visual feature.

[0063] The process of processing multiple local difference vectors for each local visual feature based on the feature fusion weights of normal samples includes: first, generating a pattern difference parameter for each normal sample based on multiple local difference parameters for each normal sample in the multiple local difference vectors of each local visual feature; for example, averaging multiple elements in the local difference vector corresponding to a normal sample and using it as the pattern difference parameter for that normal sample; then, weighted fusion of the multiple pattern difference parameters for each local visual feature based on the feature fusion weights of normal samples to generate a data sampling influence parameter for the local visual feature. The data sampling influence parameter for a local visual feature represents the overall difference level of that feature between the local abnormal region and multiple local reference regions of normal samples. By comprehensively considering the correlation characteristics between different local regions of normal samples and combining the deviation of features in abnormal regions from normal levels, the feature difference between abnormal regions and normal samples is quantified.

[0064] In the above implementation process, for step S05, production defect detection is performed on the image to be analyzed based on the global correlation model of the target set and multiple data sampling influence parameters, specifically including:

[0065] Feature optimization is performed on multiple target feature sequences of the image to be analyzed based on multiple data sampling influence parameters. This includes correcting the feature values ​​of each local visual feature in each target feature sequence according to the data sampling influence parameters corresponding to each local visual feature, and generating a corrected feature sequence corresponding to each target feature sequence.

[0066] Specifically, for multiple target feature sequences of the image to be analyzed, the image to be analyzed is segmented according to the previously mentioned preset segmentation template to obtain multiple local regions of the image to be analyzed, and the local visual features of each local region of the image to be analyzed are extracted to construct the target feature sequence of each local region, and finally multiple local feature sequences of the image to be analyzed are obtained.

[0067] Then, for each target feature sequence, the feature values ​​of different local visual features are corrected by using data sampling influence parameters that characterize the importance of different local visual features in the defect detection process. This makes the feature values ​​of different local visual features more accurately reflect the characteristics of the local area, reduce the interference of noise or error on subsequent analysis, and generate the corrected feature sequence corresponding to each target feature sequence after correction.

[0068] A target correlation matrix is ​​constructed based on multiple modified feature sequences of the image to be analyzed. Similar to the aforementioned local region correlation matrix, the target correlation matrix reflects the correlation characteristics between any two local regions in the image to be analyzed. Then, a local correlation target vector for each local region in the image to be analyzed is extracted from the target correlation matrix. Multiple elements in the local correlation target vector represent the optical feature correlation relationships between that local region and the other local regions.

[0069] For a global association model of the target set, local association reference vectors corresponding to each local region in the image to be analyzed can be extracted. Finally, based on multiple local association reference vectors, defect detection is performed on multiple local regions of the image to be analyzed. This includes calculating a difference parameter, such as Euclidean distance, between the local association target vector and the local association reference vector of each local region in the image to determine whether there are abnormal features in that region. The larger the difference parameter, the greater the deviation. If the difference exceeds a preset difference threshold, it indicates a higher probability of a production defect. Local regions with difference parameters greater than the preset difference threshold are then marked as feature anomalous regions. In this way, multiple feature anomalous regions in the image to be analyzed are identified, and the defect detection results for the image are generated.

[0070] Please see Figure 2Based on the same inventive concept, this invention also provides an image analysis-based PCB manufacturing defect detection system to implement the above-described image analysis-based PCB manufacturing defect detection method. The system includes:

[0071] The sample preprocessing module is used to acquire multiple inspection sample images of the PCB circuit board, including multiple normal samples and abnormal samples. It extracts multiple global visual features of each inspection sample image and constructs a global feature sequence. Based on the global feature sequence, it performs data sampling difference recognition on multiple inspection sample images to construct multiple data sampling pattern sets.

[0072] The local feature extraction module is used to perform region segmentation on multiple detection sample images in each data sampling mode set according to a preset segmentation template, so as to divide each detection sample image into multiple local regions, extract multiple local visual features of each local region, and construct a local feature sequence.

[0073] The regional correlation analysis module is used to construct a local regional correlation matrix for each normal sample in the data sampling pattern set based on multiple local feature sequences of the detected sample image, and to fuse the local regional correlation matrices of multiple normal samples in the data sampling pattern set to obtain a global correlation model of the data sampling pattern set.

[0074] The global correlation model of the data sampling pattern set is obtained by fusing the local region correlation matrices of multiple normal samples in the data sampling pattern set, including:

[0075] Tensor quantization is performed on the local region correlation matrix of multiple normal samples in the data sampling pattern set to generate a target tensor. The target tensor is then decomposed using Tucker to obtain the core tensor and multiple factor matrices.

[0076] The image association feature matrix is ​​extracted from multiple factor matrices, and the feature mapping vector corresponding to the local region association matrix of each normal sample is determined based on the image association feature matrix.

[0077] The process involves fusing the local region association matrices of multiple normal samples based on multiple feature mapping vectors. This includes calculating multiple group mapping parameters for each normal sample using the feature mapping vectors, determining the feature fusion weights of the normal samples based on the multiple group mapping parameters, and fusing the local region association matrices corresponding to the multiple normal samples based on the feature fusion weights to generate a global association model of the data sampling pattern set.

[0078] The feature impact analysis module is used to determine the local abnormal region of each abnormal sample in the data sampling pattern set. Based on multiple normal samples in the data sampling pattern set, it performs local feature difference analysis on multiple local abnormal regions and generates data sampling impact parameters for each local visual feature.

[0079] The production defect detection module is used to determine the target set that matches the image to be analyzed after the image is acquired, extract multiple target feature sequences from the image to be analyzed, and perform production defect detection on the image to be analyzed based on the global association model of the target set and multiple data sampling influence parameters to obtain the defect detection result of the image to be analyzed.

[0080] The above are merely specific embodiments of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art. Parts not described in detail in this specification are prior art known to those skilled in the art.

Claims

1. A method for detecting defects in PCB production based on image analysis, characterized in that, The application relates to a PCB line detection method and device. A plurality of detection sample images of a PCB line board are acquired, including a plurality of normal samples and abnormal samples, a plurality of global visual features of each detection sample image are extracted, and a global feature sequence is constructed; data sampling difference recognition is performed on the plurality of detection sample images according to the global feature sequence, and a plurality of data sampling mode sets are constructed; According to a preset segmentation template, the plurality of detection sample images in each data sampling mode set are subjected to region segmentation, so that each detection sample image is divided into a plurality of local regions, a plurality of local visual features of each local region are extracted, and a local feature sequence is constructed; According to the plurality of local feature sequences of the detection sample images, a local region correlation matrix of each normal sample in the data sampling mode set is constructed, a global correlation model of the data sampling mode set is obtained by fusing the local region correlation matrices of the plurality of normal samples in the data sampling mode set, including tensor processing of the local region correlation matrices of the plurality of normal samples in the data sampling mode set to generate a target tensor, and Tucker decomposition of the target tensor to obtain a core tensor and a plurality of factor matrices; An image correlation feature matrix is extracted from the plurality of factor matrices, and a feature mapping vector corresponding to the local region correlation matrix of each normal sample is determined according to the image correlation feature matrix; The local region correlation matrices of the plurality of normal samples are fused based on the plurality of feature mapping vectors, including calculating a plurality of group mapping parameters of each normal sample through the feature mapping vector, determining a feature fusion weight of the normal sample according to the plurality of group mapping parameters, fusing the local region correlation matrices respectively corresponding to the plurality of normal samples according to the feature fusion weight, and generating the global correlation model of the data sampling mode set; Local abnormal regions of each abnormal sample in the data sampling mode set are determined, local feature difference analysis is performed on the plurality of local abnormal regions based on the plurality of normal samples in the data sampling mode set, data sampling influence parameters of each local visual feature are generated, including determining local reference regions respectively corresponding to each local abnormal region in the plurality of normal samples, performing feature difference analysis on each local abnormal region based on the plurality of local reference regions, calculating local difference parameters of each local visual feature in the plurality of local reference regions, and constructing a local difference vector corresponding to each local visual feature of each local abnormal region; A plurality of local difference vectors of each local visual feature with respect to the plurality of local abnormal regions are extracted, the plurality of local difference vectors of each local visual feature are processed according to the feature fusion weight of the normal sample, the plurality of local difference parameters of each local visual feature with respect to each normal sample in the plurality of local difference vectors of each local visual feature are used to generate a mode difference parameter of each normal sample, and the plurality of mode difference parameters of each local visual feature are weighted and fused to generate the data sampling influence parameter of the local visual feature based on the feature fusion weight of the normal sample. The method comprises the following steps: determining a target set matched with the image to be analyzed after collecting the image to be analyzed, extracting a plurality of target feature sequences of the image to be analyzed, and performing production defect detection on the image to be analyzed according to a global correlation model of the target set and a plurality of data sampling influence parameters to obtain a defect detection result of the image to be analyzed.

2. The method for detecting defects in PCB production based on image analysis according to claim 1, characterized in that, The method for performing production defect detection on the image to be analyzed according to the global correlation model of the target set and the plurality of data sampling influence parameters comprises the following steps: For the plurality of target feature sequences of the image to be analyzed, the image to be analyzed is subjected to region segmentation processing according to a preset segmentation template to obtain a plurality of local regions of the image to be analyzed, and a target feature sequence of each local region is constructed to generate a plurality of local feature sequences of the image to be analyzed; The feature optimization on the plurality of target feature sequences of the image to be analyzed according to the plurality of data sampling influence parameters comprises the following steps: according to the data sampling influence parameter corresponding to each local visual feature, the feature value of each local visual feature in each target feature sequence is corrected to generate a corrected feature sequence corresponding to each target feature sequence; The target correlation matrix is constructed according to the plurality of corrected feature sequences of the image to be analyzed, a local correlation target vector of each local region in the image to be analyzed is extracted from the target correlation matrix, a local correlation reference vector of each local region in the image to be analyzed is determined according to the global correlation model, and the plurality of local regions of the image to be analyzed are subjected to defect detection based on the plurality of local correlation reference vectors to determine a plurality of feature abnormal regions of the image to be analyzed and generate a defect detection result of the image to be analyzed.

3. The method of claim 2, wherein the method comprises: The defect detection on the plurality of local regions of the image to be analyzed based on the plurality of local correlation reference vectors comprises the following steps: The difference parameter between the local correlation target vector and the local correlation reference vector of each local region in the image to be analyzed is calculated, and the local region with a difference parameter greater than a preset difference threshold is marked as a feature abnormal region.

4. An image analysis-based PCB line board production defect detection system, characterized by, The system is used to implement the PCB production defect detection method based on image analysis in any one of claims 1-3, and comprises: A sample preprocessing module is configured to acquire a plurality of detection sample images of a PCB, including a plurality of normal samples and abnormal samples, extract a plurality of global visual features of each detection sample image and construct a global feature sequence, and identify data sampling differences of the plurality of detection sample images according to the global feature sequence to construct a plurality of data sampling mode sets; A local feature extraction module is configured to divide each detection sample image in each data sampling mode set into a plurality of local regions according to a preset segmentation template, extract a plurality of local visual features of each local region and construct a local feature sequence; A region correlation analysis module is configured to construct a local region correlation matrix of each normal sample in the data sampling mode set according to the plurality of local feature sequences of the detection sample image, and fuse the local region correlation matrices of the plurality of normal samples in the data sampling mode set to obtain a global correlation model of the data sampling mode set. The feature influence analysis module is configured to determine local abnormal regions of each abnormal sample in the data sampling mode set, perform local feature difference analysis on the local abnormal regions based on a plurality of normal samples in the data sampling mode set, and generate a data sampling influence parameter of each local visual feature; The production defect detection module is configured to determine a target set matched with the to-be-analyzed image after the to-be-analyzed image is collected, extract a plurality of target feature sequences of the to-be-analyzed image, perform production defect detection on the to-be-analyzed image according to the global correlation model of the target set and the plurality of data sampling influence parameters, and obtain a defect detection result of the to-be-analyzed image.

5. The image analysis based PCB production defect detection system according to claim 4, wherein, For the region correlation analysis module, the local region correlation matrices of the plurality of normal samples in the data sampling mode set are fused to obtain the global correlation model of the data sampling mode set, including: tensorizing the local region correlation matrices of the plurality of normal samples in the data sampling mode set to generate a target tensor, and performing Tucker decomposition on the target tensor to obtain a core tensor and a plurality of factor matrices; extracting an image correlation feature matrix from the plurality of factor matrices, determining a feature mapping vector corresponding to the local region correlation matrix of each normal sample according to the image correlation feature matrix; fusing the local region correlation matrices of the plurality of normal samples based on the plurality of feature mapping vectors, including calculating a plurality of group mapping parameters of each normal sample through the feature mapping vector, determining a feature fusion weight of the normal sample according to the plurality of group mapping parameters, fusing the local region correlation matrices respectively corresponding to the plurality of normal samples according to the feature fusion weight, and generating the global correlation model of the data sampling mode set.

Citation Information

Patent Citations

  • PCB defect detection method and device

    CN113379686A

  • Wafer surface defect detection method and device before epitaxy

    CN119069376A

  • PCB defect detection method based on coordinate attention mechanism

    CN119107316A