PCB production defect detection method and system based on image analysis

By constructing a global and local correlation model for detecting sample images of PCB circuit boards, the problem of environmental factors affecting detection accuracy in the prior art is solved, and defect detection with high precision and environmental adaptability is achieved.

CN120070375AActive Publication Date: 2025-05-30JIANGXI JUNXIN ELECTRONICS CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

When detecting defects of PCB circuit boards, the prior art is affected by factors such as ambient light intensity, shooting angle and position, resulting in low detection accuracy and inability to effectively identify defects that are masked or interfered in complex surface structures.

Method used

By analyzing the global and local visual characteristics of multiple detected sample images, a global correlation model of the data sampling mode set is constructed, and data sampling influence parameters of local visual characteristics are generated to realize intelligent defect detection in different shooting environments.

Benefits of technology

It improves the accuracy and stability of PCB circuit board defect detection, can effectively identify small defects, and has strong environmental adaptability, and dynamically adjusts the detection strategy to adapt to different shooting environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070375A_ABST
    Figure CN120070375A_ABST
Patent Text Reader

Abstract

The invention 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: acquiring a plurality of detection sample images of the PCB, performing data sampling difference identification, and constructing to obtain a plurality of data sampling mode sets; dividing each detection sample image to obtain a plurality of local areas, and constructing to obtain a local feature sequence; constructing a plurality of local area incidence matrixes of the data sampling mode set and fusing the local area incidence matrixes to obtain a global incidence model; determining a local abnormal region of each abnormal sample in the data sampling mode set, and generating a data sampling influence parameter of each local visual feature; and determining a target set matched with the to-be-analyzed image, and performing production defect detection on the to-be-analyzed image according to the global association model of the target set and the plurality of data sampling influence parameters to obtain a defect detection result. According to the invention, the detection precision of the production defects of the PCB is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly to a method and system for detecting production defects of PCB circuit boards based on image analysis. Background Art

[0002] As a core component of electronic products, the quality control of printed circuit boards (PCB circuit boards) is particularly important during the production process, and defect detection is an important part of quality control. In the actual PCB production process, the manifestation of optical features is easily affected by environmental factors. For example, different illumination intensities, shooting angles, and shooting positions in the shooting environment may cause changes in optical features in the image, thereby affecting the detection accuracy. For the complex surface of a PCB circuit board, due to the differences in its material, process, and the complexity of its surface structure, some defects may be obscured or interfered by the surface structure of the board surface, resulting in the defect detection method based on visual features such as texture and brightness may not have sufficient discrimination ability due to the influence of external interference factors, and the detection and positioning of defects are not accurate enough. If the detection strategy is not flexibly adjusted according to factors such as illumination changes or perspective changes, it is easy to lead to poor adaptability of the detection scheme to different shooting environments.

[0003] Moreover, some detection technologies focus more on feature matching and inter-region similarity analysis in a static environment, ignoring the co-variation patterns between features under dynamic environmental changes. For example, in a darker environment, the change in brightness features caused by illumination may not be obvious while texture features may be more prominent. If the degree of attention to different features cannot be automatically adjusted according to factors such as different illumination and perspectives, it is easy to result in inconsistent detection accuracy in different environments. Summary of the Invention

[0004] To solve the above technical problems, the present invention proposes a method and system for detecting production defects of PCB circuit boards based on image analysis. By making full use of the image information in different shooting environments, analyzing the mutual correlation of optical features in different regions, and being able to intelligently identify the key features affecting the defect detection accuracy in dynamic environmental changes, defect detection is performed more accurately, improving the accuracy and stability of defect detection in the production of PCB circuit boards.

[0005] To achieve the above object, in the first aspect of the present invention, a method for detecting production defects of PCB circuit boards based on image analysis is provided, including:

[0006] Obtain a plurality of detection sample images of the PCB circuit board, 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 perform data sampling difference recognition on the plurality of detection sample images according to the global feature sequence to construct a plurality of data sampling mode sets;

[0007] Perform regional segmentation on multiple detected sample images in each data sampling pattern set according to a preset segmentation template, so as to divide each detected sample image into multiple local regions, extract multiple local visual features of each local region, and construct a local feature sequence;

[0008] According to the multiple local feature sequences of the detected sample images, construct a local region association matrix for each normal sample in the data sampling pattern set, and fuse the local region association matrices of multiple normal samples in the data sampling pattern set to obtain a global association model of the data sampling pattern set;

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

[0010] After collecting the image to be analyzed, determine the target set matching the image to be analyzed, extract multiple target feature sequences of the image to be analyzed, and perform production defect detection on the image to be analyzed according to 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.

[0011] Preferably, fusing the local region association matrices of multiple normal samples in the data sampling pattern set to obtain the global association model of the data sampling pattern set includes:

[0012] Perform tensorization processing on the local region association matrices of multiple normal samples in the data sampling pattern set to generate a target tensor, and perform Tucker decomposition on the target tensor to obtain a core tensor and multiple factor matrices;

[0013] Extract an image association feature matrix from the multiple factor matrices, and determine the feature mapping vectors corresponding to the local region association matrices of each normal sample according to the image association feature matrix;

[0014] Fuse the local region association matrices of multiple normal samples based on the multiple feature mapping vectors, including calculating multiple group mapping parameters of each normal sample through the feature mapping vectors, determining the feature fusion weights of the normal samples according to the multiple group mapping parameters, and fusing the local region association matrices corresponding to the multiple normal samples according to the feature fusion weights to generate the global association model of the data sampling pattern set.

[0015] Preferably, performing 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 includes:

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

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

[0018] Among them, processing the multiple local difference vectors of each local visual feature according to the feature fusion weights of the normal samples includes generating the pattern difference parameters of each normal sample based on the multiple local difference parameters of each normal sample in the multiple local difference vectors of each local visual feature, and performing weighted fusion on the multiple pattern difference parameters of each local visual feature based on the feature fusion weights of the normal samples to generate the data sampling influence parameters of the local visual feature.

[0019] Preferably, performing production defect detection on the image to be analyzed according to the global association model of the target set and multiple data sampling influence parameters includes:

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

[0021] Perform feature optimization on the multiple target feature sequences of the image to be analyzed according to multiple data sampling influence parameters, including 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 respectively, and generating the corrected feature sequence corresponding to each target feature sequence.

[0022] Construct a target association matrix according to the multiple corrected feature sequences of the image to be analyzed, extract the local association target vectors of each local region in the image to be analyzed from the target association matrix, determine the local association reference vectors of each local region in the image to be analyzed according to the global association model, perform defect detection on the multiple local regions of the image to be analyzed based on the multiple local association reference vectors, determine the multiple feature abnormal regions of the image to be analyzed, and generate the defect detection result of the image to be analyzed.

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

[0024] Calculate 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, and mark the local regions with the difference parameter greater than the preset difference threshold as feature abnormal regions.

[0025] The second aspect of the present invention provides a PCB circuit board production defect detection system based on image analysis. The system is used to implement the above-mentioned PCB circuit board production defect detection method based on image analysis, and includes:

[0026] A sample preprocessing module, which is used to obtain multiple detection sample images of the PCB circuit board, including multiple normal samples and abnormal samples, extract multiple global visual features of each detection sample image and construct a global feature sequence, and perform data sampling difference recognition on the multiple detection sample images according to the global feature sequence to construct multiple data sampling mode sets;

[0027] A local feature extraction module, which is used to perform region segmentation on the 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] A region correlation analysis module, which is used to construct a local region correlation matrix of each normal sample in the data sampling mode set according to the multiple local feature sequences of the detection sample images, and fuse the local region correlation matrices of multiple normal samples in the data sampling mode set to obtain a global correlation model of the data sampling mode set;

[0029] A feature impact analysis module, which is used to determine the local abnormal regions of each abnormal sample in the data sampling mode set, perform local feature difference analysis on the multiple local abnormal regions based on the multiple normal samples in the data sampling mode set, and generate data sampling impact parameters for each local visual feature;

[0030] A production defect detection module, which is used to determine a target set matching the image to be analyzed after collecting the image to be analyzed, extract multiple target feature sequences of the image to be analyzed, and perform production defect detection on the image to be analyzed according to the global correlation model of the target set and multiple data sampling impact parameters to obtain the defect detection result of the image to be analyzed.

[0031] Preferably, for the region correlation analysis module, fusing the local region correlation matrices of multiple normal samples in the data sampling mode set to obtain a global correlation model of the data sampling mode set includes:

[0032] Perform tensorization processing on the local region association matrices of multiple normal samples in the data sampling mode set to generate a target tensor, and perform Tucker decomposition on the target tensor to obtain a core tensor and multiple factor matrices;

[0033] Extract an image association feature matrix from the multiple factor matrices, and determine a feature mapping vector corresponding to the local region association matrix of each normal sample according to the image association feature matrix;

[0034] Fuse the local region association matrices of multiple normal samples based on multiple feature mapping vectors, including calculating multiple population mapping parameters of each normal sample through the feature mapping vectors, determining the feature fusion weights of normal samples according to the multiple population mapping parameters, and fusing the local region association matrices corresponding to multiple normal samples respectively according to the feature fusion weights to generate a global association model of the data sampling mode set.

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

[0036] By analyzing multiple detection sample images of a PCB circuit board, the present invention preliminarily divides different data sampling scenarios from the perspective of global features and constructs a corresponding data sampling mode set, deeply analyzes each multiple detection sample image from the perspective of local features, conducts image analysis from the perspective of the feature correlation of local regions to construct a global association model of different data sampling mode sets, analyzes the image from the perspective of the change in the degree of feature difference to generate data sampling influence parameters for each local visual feature, and conducts production defect analysis on the PCB circuit board through the global association model and the data sampling influence parameters of different local visual features. It can detect production defects of the PCB circuit board with high precision for different shooting environments, can effectively identify minute defects and has strong environmental adaptability, and can dynamically adjust the detection strategy according to the change of the actual shooting environment, improving the detection accuracy of production defects of the PCB circuit board. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic flowchart of a method for detecting production defects of a PCB circuit board based on image analysis provided by an embodiment of the present invention.

[0038] Figure 2 It is a schematic structural diagram of a system for detecting production defects of a PCB circuit board based on image analysis provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0039] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0040] Please refer to Figure 1 , a method for detecting defects in PCB circuit board production based on image analysis provided by an embodiment of the present invention 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. Identify data sampling differences for the multiple detection sample images according to the global feature sequence, and construct multiple data sampling mode sets.

[0042] Among them, for the multiple detection sample images of the PCB circuit board, it includes multiple normal samples without defects and multiple abnormal samples with minor defects. Different images can specifically be collected through devices such as high-resolution industrial cameras in different shooting environments, such as different environmental light intensities, shooting angles, shooting positions, etc., to obtain sample data with broad representativeness. For each detection sample image, extract its corresponding global visual features, which include features such as the overall brightness, texture, color distribution, and contrast of the image, and are used to reflect the macroscopic optical characteristics of the entire image. By analyzing these global visual features, a global feature sequence of each image can be constructed. Considering that the optical features of images will change under different sampling scenarios, identify data sampling differences for the multiple detection sample images. For example, cluster the multiple images through clustering techniques such as the K-means algorithm, and construct multiple data sampling mode sets. Each data sampling mode set represents that under a specific sampling environment, the global visual features of the image show similar patterns.

[0043] Step S02, perform region segmentation on the 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.

[0044] Among them, after classifying multiple images from the perspective of global visual features, for multiple detected sample images in each set of data sampling patterns, the image is divided into regions through a preset segmentation template to obtain multiple local regions corresponding to each detected sample image. In this process, different images can be transformed to the same position through rotation or other means. The preset template can be constructed based on a fixed grid. For example, for an image with a size of 256*256, it can be divided into multiple local regions of 8*8. Thus, after dividing the image into regions through the preset segmentation template, each image can obtain multiple local regions with the same position distribution. Those skilled in the art can also reasonably divide the regions according to the specific structure and manufacturing process of different types of PCB circuit boards. For example, considering information such as the material composition of the PCB circuit board, such as copper layers, metal coatings, solder masks, and microscopic structures, such as solder joints, circuits, conductive paths, etc. The significance of dividing the image into multiple local regions is to analyze the associated changes in the local optical properties of different local regions as the data acquisition scenario 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. similar to global visual features, that is, specifically analyzing more local and minute regions to more finely reflect the optical property changes in different regions of the image and provide detailed feature information for subsequent defect detection.

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

[0046] Among them, for the local feature sequences of multiple local regions of the detection sample image, for multiple normal samples in the data sampling mode set, a local region association matrix corresponding to each normal sample is constructed to represent the optical feature association relationship between different local regions in the image, such as the similarity or correlation between the optical features of any two local regions, and the co-variation pattern between different regions is assisted to be understood and analyzed through the association relationship between local regions. The distance between the local feature sequences of any two local regions can be calculated by a distance metric formula such as Euclidean distance, cosine similarity, etc. to construct the local region association matrix of each normal sample. Further, the local region association matrices of multiple normal sample images are fused to obtain a comprehensive global association model to capture the feature correlation between different local regions in the image under the data sampling scenario corresponding to the data sampling mode set. It is worth noting that due to the differences in preparation processes or structures in different regions of the PCB circuit board, the optical visual features of different regions will change to varying degrees in different data sampling environments. For example, there are significant differences in the light reflection characteristics of the copper layer and the solder mask layer and the solder joints, and these differences will change to varying degrees with factors such as light and angle. Therefore, the specific association and cooperation relationship between the optical features of different regions in normal images under different scenarios, such as different environmental light intensities, is captured. Finally, the global association models of different data sampling mode sets can reflect the differences in the inherent correlations of the optical features between regions in the image with the change of the sampling environment.

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

[0048] Among them, the global association model constructed by multiple normal samples reflects the optical property correlation of different local regions. For multiple abnormal samples in the data sampling mode set, analysis is carried out from the perspective of feature importance to identify the change in the degree of difference of different visual features in different data sampling scenarios, so as to determine some key visual features in different scenarios.

[0049] In this process, the local abnormal regions of each abnormal sample are first determined. Specifically, the defect annotation information of multiple abnormal samples can be synchronously obtained in the initially acquired samples to locate the abnormal regions. The local abnormal regions are usually caused by some production defects or abnormal conditions, resulting in abnormal optical features. After locating the local regions with production defects of each abnormal sample, combined with multiple normal samples in the data sampling mode set, specifically the optical features of the local regions at the same position in the normal samples, the degree of difference after the optical features are abnormal under production defects is analyzed. In different scenarios, such as in a darker environment, due to the low light intensity, the overall brightness of the image is usually low. In this case, the brightness feature may be greatly suppressed because the brightness difference in the image is small under low light conditions, and the brightness information tends to be blurred or have low contrast. This makes the change of the brightness feature in a low light environment difficult to be perceived and difficult to be used for effective defect detection.

[0050] Therefore, for each data sampling mode set, since it represents one of the data sampling environments, by analyzing the defect regions of multiple abnormal samples in the set and comparing and analyzing the differences between the optical features of the normal regions at the same position, it can be determined which optical features will show greater differences, so as to determine which features will be more prominent in different scenarios. In actual detection, in different scenarios, some key optical features can be specifically focused on to improve the detection accuracy. Finally, by quantifying the degree of difference of different visual features, the data sampling influence parameters of each local visual feature are analyzed to reflect the significance of the change degree of each feature in abnormal and normal situations, helping to determine which local visual features play a more crucial role in abnormal detection in a specific environment, providing a quantitative basis for subsequent defect detection.

[0051] Step S05: After the image to be analyzed is acquired, determine the target set matching the image to be analyzed, extract multiple target feature sequences of the image to be analyzed, and perform production defect detection on the image to be analyzed according to 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] Among them, after the image to be analyzed is collected, that is, the image of the PCB circuit board that needs to be subjected to production defect detection obtained by shooting with a high-definition camera device, first, based on multiple global visual features of the image to be analyzed, the image to be analyzed is matched with multiple data sampling mode sets to determine the data sampling environment where the image to be analyzed is located. In this process, a corresponding feature vector can be constructed according to multiple global visual features of the image to be analyzed. For multiple data sampling mode sets, the representative cluster centers of each set can also be determined according to the clustering results, the distances between the feature vectors of the image to be analyzed with respect to multiple global visual features and different cluster centers are calculated, and the data sampling mode set with the closest distance is selected and denoted as the target set.

[0053] Then, multiple target feature sequences of the image to be analyzed with respect to different local regions are extracted to reflect the optical features such as brightness, texture, and color change of different local regions in the image to be analyzed. And production defect detection is performed on the image to be analyzed according to the global association model of the target set and multiple data sampling influence parameters. Among them, the data sampling influence parameters can characterize which optical visual features are more critical in the current scenario, that is, they will have a greater difference from the normal image in the case of defects. Therefore, the multiple target feature sequences of the image to be analyzed can be first subjected to feature enhancement according to multiple data sampling influence parameters to amplify possible minor anomalies, and then, according to the global association model of the target set, the feature correlation between different local regions in the image to be analyzed is analyzed. For the regions with anomalies, the feature correlation between them and other normal regions in the image may change. If it does not conform to the co-variation pattern between different regions in the normal image, it indicates that there is a high probability of production defects in this region, thus realizing the frequent detection and positioning of possible minor production defects in different regions of the PCB circuit board and obtaining the corresponding defect detection results.

[0054] The above-provided method for detecting production defects of PCB circuit boards based on image analysis comprehensively utilizes global features and differential analysis of local regions, designs multi-level image analysis means from angles such as local region correlation and feature difference degree change, and can perform high-precision detection of production defects of PCB circuit boards for different shooting environments. It can not only effectively identify minor defects but also has strong environmental adaptability, can dynamically adjust the detection strategy according to changes in the actual shooting environment, and greatly improves the accuracy of detecting production defects of PCB boards.

[0055] In the above implementation process, for step S03, fusing the local region association matrices of multiple normal samples in the data sampling mode set to obtain the global association model of the data sampling mode set specifically includes:

[0056] The local region association matrices of multiple normal samples in the data sampling mode set are tensorized to generate a target tensor. For example, for the two-dimensional local region association matrix corresponding to each normal sample, multiple matrices are stacked to obtain a three-dimensional target tensor, and each local region association matrix corresponds to a slice in the target tensor. Then, the target tensor is subjected to Tucker decomposition to obtain a core tensor and multiple factor matrices. Among them, the core tensor captures the high-order interaction information between different images, between local regions, and between features, and can represent the similarity relationship between local regions in different environments, that is, in different images. The corresponding factor matrices specifically include three typical matrices U, V, and X, where they represent the implicit patterns of different images in the latent pattern space, the variations of different local regions in different patterns, that is, scenarios, and the relationships of different images in the same scenario, respectively.

[0057] The factor matrix representing the implicit pattern 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 one of the decomposition ranks and the number of normal samples in the data sampling mode 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 according to the image association feature matrix, that is, multiple elements of the image association feature matrix representing one image are constructed to obtain a feature mapping vector, which represents the local region association matrix of the corresponding normal sample and can be understood as a low-dimensional representation of the local region association matrix, and can effectively represent the association between the local characteristics and the global characteristics of the sample.

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

[0059] Specifically, in the fusion process, multiple population mapping parameters of each normal sample are calculated through the feature mapping vector to measure the feature association degree between different samples. Specifically, the association parameter between the feature mapping vectors of this normal sample and the remaining normal samples, such as cosine similarity, can be calculated. Then, the feature fusion weight of the normal sample is determined according to multiple population mapping parameters. For example, the mean of multiple population mapping parameters is taken as the feature fusion weight of this normal sample. The larger the feature fusion weight, the more representative it is in the set. Finally, the local region association matrices corresponding to multiple normal samples are fused according to the feature fusion weights. In the fusion process, the normal sample with a larger feature fusion weight contributes more significantly to the global association model, while the normal sample with a smaller feature fusion weight is appropriately weakened. The fused global association model can comprehensively reflect the feature association characteristics of multiple normal samples regarding different local regions and reflect the group feature pattern 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 mode set to generate data sampling influence parameters for each local visual feature, specifically including:

[0061] Determine the local reference regions respectively corresponding to each local abnormal region in multiple normal samples, and perform feature difference analysis on each local abnormal region based on the multiple local reference regions. Specifically, calculate the local difference parameters of each local visual feature in the multiple local reference regions respectively. For example, for the brightness mean value of multiple pixel points in a local region as the brightness feature of the local region, calculate the difference values between the local abnormal region and the brightness features in the multiple local reference regions respectively, so as to obtain the local difference parameters of the brightness local visual feature in the multiple local reference regions. Then, a local difference vector corresponding to each local visual feature of each local abnormal region is constructed through the multiple local difference parameters.

[0062] Further extract multiple local difference vectors of each local visual feature with respect to multiple local abnormal regions, that is, multiple local difference vectors of the same local visual feature under each local abnormal region. Combine the feature fusion weights of the normal samples determined above to determine the importance of the local difference vectors according to the normal samples to which the local difference vectors belong, and process the multiple local difference vectors of each local visual feature according to the feature fusion weights of the normal samples. Specifically, perform weighted fusion on the multiple local difference vectors of each local visual feature through the feature fusion weights.

[0063] Among them, the process of processing the multiple local difference vectors of each local visual feature according to the feature fusion weights of the normal samples includes first generating a pattern difference parameter for each normal sample according to the multiple local difference parameters of each normal sample in the multiple local difference vectors of each local visual feature. For example, take the mean value of multiple elements in the local difference vector corresponding to the normal sample as the pattern difference parameter of the normal sample. Then, based on the feature fusion weights of the normal samples, perform weighted fusion on the multiple pattern difference parameters of each local visual feature to generate the data sampling influence parameter of the local visual feature. The data sampling influence parameter of the local visual feature represents the overall difference level between the feature in the local abnormal region and the local reference regions of multiple normal samples. While integrating the correlation characteristics between different local regions of the normal samples, it combines the deviation degree of the feature in the abnormal region from the normal level, realizing the quantification of the feature difference between the abnormal region and the normal samples.

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

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

[0066] Among them, for multiple target feature sequences of the image to be analyzed, the image to be analyzed is subjected to regional segmentation processing according to the previously mentioned preset segmentation template, multiple local regions of the image to be analyzed are obtained, and the local visual features of each local region of the image to be analyzed are extracted to construct a target feature sequence for 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 through data sampling influence parameters that represent the importance degree of different local visual features in the defect detection process, so that it can more accurately reflect the characteristics of the local region, reduce the interference of noise or errors on subsequent analysis, and generate a corrected feature sequence corresponding to each target feature sequence after correction.

[0068] A target association matrix is constructed according to multiple corrected feature sequences of the image to be analyzed. Similar to the local region association matrix mentioned above, the target association matrix reflects the association characteristics of any two local regions in the image to be analyzed. Then, local association target vectors for each local region in the image to be analyzed are extracted from the target association matrix. Multiple elements in the local association target vector respectively represent the optical feature association relationship between the local region and the remaining local regions.

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

[0070] Please refer to Figure 2, Based on the same inventive concept, an embodiment of the present invention further provides a PCB circuit board production defect detection system based on image analysis, which is used to implement the above-mentioned PCB circuit board production defect detection method based on image analysis. The system includes:

[0071] A sample preprocessing module, which is used to obtain multiple detection sample images of the PCB circuit board, including a plurality of normal samples and abnormal samples, extract multiple global visual features of each detection sample image and construct a global feature sequence, and identify data sampling differences for the multiple detection sample images according to the global feature sequence to construct multiple data sampling mode sets;

[0072] A local feature extraction module, which is used to perform region segmentation on the 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] A region association analysis module, which is used to construct a local region association matrix for each normal sample in the data sampling mode set according to the multiple local feature sequences of the detection sample images, and fuse the local region association matrices of the multiple normal samples in the data sampling mode set to obtain a global association model of the data sampling mode set;

[0074] Among them, fusing the local region association matrices of multiple normal samples in the data sampling mode set to obtain a global association model of the data sampling mode set includes:

[0075] Performing tensorization processing on the local region association matrices of multiple 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 multiple factor matrices;

[0076] Extracting an image association feature matrix from the multiple factor matrices, and determining a feature mapping vector corresponding to the local region association matrix of each normal sample according to the image association feature matrix;

[0077] Fusing the local region association matrices of multiple normal samples based on multiple feature mapping vectors, including calculating multiple population mapping parameters for each normal sample through the feature mapping vectors, determining the feature fusion weights of the normal samples according to the multiple population mapping parameters, and fusing the local region association matrices corresponding to the multiple normal samples respectively according to the feature fusion weights to generate a global association model of the data sampling mode set.

[0078] A feature impact analysis module, configured to determine local abnormal regions of each abnormal sample in a data sampling pattern set, perform local feature difference analysis on multiple local abnormal regions based on multiple normal samples in the data sampling pattern set, and generate data sampling impact parameters for each local visual feature;

[0079] A production defect detection module, configured to determine a target set matching a to-be-analyzed image after the to-be-analyzed image is acquired, extract multiple target feature sequences of the to-be-analyzed image, and perform production defect detection on the to-be-analyzed image according to a global association model of the target set and multiple data sampling impact parameters, so as to obtain a defect detection result of the to-be-analyzed image.

[0080] The above are only specific embodiments of the present invention, which enable those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The parts not described in detail in this specification belong to the prior art well known to those skilled in the art.

Claims

1. A PCB production defect detection method based on image analysis, characterized in that: include: Acquire multiple test sample images of the PCB circuit board, including multiple normal samples and abnormal samples, extract multiple global visual features of each test sample image and construct a global feature sequence, perform data sampling difference recognition on the multiple test sample images according to the global feature sequence, and construct multiple data sampling pattern sets; Performing regional segmentation on multiple detection sample images in each data sampling pattern set according to a preset segmentation template, so as to divide each detection sample image into multiple local regions, extracting multiple local visual features of each local region and constructing a local feature sequence; According to multiple local feature sequences of the detection sample image, a local region association matrix of each normal sample in the data sampling pattern set is constructed, and the local region association matrices of multiple normal samples in the data sampling pattern set are fused to obtain a global association model of the data sampling pattern set; Determine the local abnormal region of each abnormal sample in the data sampling pattern set, perform local feature difference analysis on multiple local abnormal regions based on multiple normal samples in the data sampling pattern set, and generate data sampling influence parameters for each local visual feature; After the image to be analyzed is acquired, a target set matching the image to be analyzed is determined, and multiple target feature sequences of the image to be analyzed are extracted. 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 influencing parameters to obtain the defect detection result of the image to be analyzed.

2. A PCB production defect detection method based on image analysis according to claim 1, characterized in that: The local area association matrices of multiple normal samples in the data sampling pattern set are fused to obtain the global association model of the data sampling pattern set, including: The local area correlation matrices of multiple normal samples in the data sampling pattern set are tensorized to generate a target tensor, and the target tensor is decomposed by Tucker to obtain a core tensor and multiple factor matrices; Extracting an image correlation feature matrix from the multiple factor matrices, and determining a feature mapping vector corresponding to the local region correlation matrix of each normal sample according to the image correlation feature matrix; Based on multiple feature mapping vectors, local area association matrices of multiple normal samples are fused, including calculating multiple group mapping parameters of each normal sample through the feature mapping vector, determining the feature fusion weight of the normal sample according to the multiple group mapping parameters, and fusing the local area association matrices corresponding to the multiple normal samples according to the feature fusion weight to generate a global association model of the data sampling pattern set.

3. A PCB production defect detection method based on image analysis according to claim 2, characterized in that: Based on multiple normal samples in the data sampling pattern set, local feature difference analysis is performed on multiple local abnormal areas to generate data sampling influence parameters for each local visual feature, including: Determine the local reference areas corresponding to each local abnormal area in multiple normal samples, perform feature difference analysis on each local abnormal area based on the multiple local reference areas, calculate the local difference parameters of each local visual feature in the multiple local reference areas, and construct a local difference vector corresponding to each local visual feature of each local abnormal area; Extracting multiple local difference vectors of each local visual feature with respect to multiple local abnormal regions, processing the multiple local difference vectors of each local visual feature according to the feature fusion weight of the normal sample, and calculating the data sampling influence parameter of each local visual feature; Among them, processing multiple local difference vectors of each local visual feature according to the feature fusion weight of the normal sample includes generating a pattern difference parameter of each normal sample according to multiple local difference parameters about each normal sample in the multiple local difference vectors of each local visual feature, and performing weighted fusion on the multiple pattern difference parameters of each local visual feature based on the feature fusion weight of the normal sample to generate a data sampling influence parameter of the local visual feature.

4. The PCB production defect detection method based on image analysis according to claim 1 is characterized in that: 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 influencing parameters, including: 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 a target feature sequence of each local region is constructed to generate multiple local feature sequences of the image to be analyzed; Performing feature optimization on multiple target feature sequences of the image to be analyzed according to multiple data sampling influence parameters, including correcting 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; A target association matrix is ​​constructed according to multiple corrected feature sequences of the image to be analyzed, a local association target vector for each local area in the image to be analyzed is extracted from the target association matrix, a local association reference vector for each local area in the image to be analyzed is determined according to a global association model, defect detection is performed on multiple local areas of the image to be analyzed based on multiple local association reference vectors, multiple characteristic abnormal areas of the image to be analyzed are determined, and a defect detection result of the image to be analyzed is generated.

5. A PCB production defect detection method based on image analysis according to claim 4, characterized in that: Defect detection of multiple local areas of the image to be analyzed based on multiple local correlation reference vectors includes: The difference parameter between the local associated target vector and the local associated reference vector of each local area in the image to be analyzed is calculated, and the local area whose difference parameter is greater than a preset difference threshold is marked as a characteristic abnormal area.

6. A PCB production defect detection system based on image analysis, characterized in that: The system is used to implement a PCB production defect detection method based on image analysis as described in any one of claims 1 to 5, comprising: The sample preprocessing module is used to obtain multiple test sample images of the PCB circuit board, including multiple normal samples and abnormal samples, extract multiple global visual features of each test sample image and construct a global feature sequence, perform data sampling difference recognition on the multiple test sample images according to the global feature sequence, and construct multiple data sampling pattern sets; A local feature extraction module is used to perform regional segmentation on multiple detection sample images in each data sampling pattern 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; A regional association analysis module is used to construct a local regional association matrix of each normal sample in the data sampling pattern set according to multiple local feature sequences of the detection sample image, and to fuse the local regional association matrices of multiple normal samples in the data sampling pattern set to obtain a global association model of the data sampling pattern set; A feature impact analysis module is used to determine the local abnormal area of ​​each abnormal sample in the data sampling pattern set, perform local feature difference analysis on multiple local abnormal areas based on multiple normal samples in the data sampling pattern set, and generate data sampling impact parameters for each local visual feature; The production defect detection module is used to determine the target set that matches the image to be analyzed after the image to be analyzed is acquired, extract multiple target feature sequences of the image to be analyzed, perform production defect detection on the image to be analyzed based on the global association model of the target set and multiple data sampling influencing parameters, and obtain the defect detection result of the image to be analyzed.

7. A PCB circuit board production defect detection system based on image analysis according to claim 6, characterized in that: For the regional association analysis module, the local regional association matrices of multiple normal samples in the data sampling pattern set are fused to obtain the global association model of the data sampling pattern set, including: The local area correlation matrices of multiple normal samples in the data sampling pattern set are tensorized to generate a target tensor, and the target tensor is decomposed by Tucker to obtain a core tensor and multiple factor matrices; Extracting an image correlation feature matrix from the multiple factor matrices, and determining a feature mapping vector corresponding to the local region correlation matrix of each normal sample according to the image correlation feature matrix; Based on multiple feature mapping vectors, local area association matrices of multiple normal samples are fused, including calculating multiple group mapping parameters of each normal sample through the feature mapping vector, determining the feature fusion weight of the normal sample according to the multiple group mapping parameters, and fusing the local area association matrices corresponding to the multiple normal samples according to the feature fusion weight to generate a global association model of the data sampling pattern set.

Citation Information

Patent Citations

  • PCB defect detection method and device

    CN113379686A

  • Construction method and application of OLED novel display device surface defect detection model

    CN115619743A

  • Printed circuit board defect detection method based on small sample learning, medium and equipment

    CN116579980A

  • System for detecting small apparent defects of PCB (Printed Circuit Board)

    CN117825406A

  • PCB surface defect detection method and system based on RT-DETR detector

    CN118822989A

Cited By

  • Titanium rod production quality inspection method and system based on industrial vision

    CN120598434A

  • PCB production defect detection method based on image analysis

    CN121639620A

  • Image generation method and system applied to circuit board production

    CN121861141A