Circuit board inner wall defect detection method and system based on AI analysis feedback
Through AI-based detection methods, SIFT and CNN technologies are used to detect defects in circuit board holes, which solves the problems of low efficiency and insufficient accuracy of traditional methods, and achieves high-precision and efficient detection.
Patent Information
- Application Number
- CN202411240024.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional circuit board hole inner wall defect detection method is low efficiency and subjective, making it difficult to accurately identify complex morphological defects, resulting in insufficient detection accuracy and unable to meet the high-density and high-precision manufacturing needs.
Using AI-based detection methods, SIFT algorithm is used to detect and correct image distortion, CNN constructs an inner wall defect recognition model, and combines image expansion processing and fusion technology to identify and optimize detection efficiency.
It improves the intelligence, accuracy and efficiency of defect detection in the inner wall of circuit board holes, reduces missed and missed detection, and improves detection accuracy and stability.
Smart Images

Figure CN119104555A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of inner wall defect detection, and in particular to a circuit board inner wall defect detection method and system based on AI analysis feedback. Background Art
[0002] During the manufacturing process of PCB, the processing quality of through holes and blind holes on the circuit board is particularly critical, because these holes are usually used for electrical connection between different layers of circuits. The integrity of the inner wall of the hole plays a vital role in the conductive performance and overall stability of the circuit. However, due to the complexity of the manufacturing process and the precision of the tiny structure, various defects such as cracks, pits, delamination, and contaminant attachment are prone to occur on the inner wall of the hole during the processing process. These defects will not only affect the conductivity of the circuit, but may also cause the overall failure of the device.
[0003] Traditional hole inner wall defect detection methods usually rely on manual inspection and simple image processing technology. Manual inspection requires experienced operators to carefully observe the condition of the hole inner wall through tools such as microscopes. This method is not only inefficient, but also highly subjective, and is prone to missed detection or false detection due to operator fatigue or decreased attention. In addition, when processing complex hole inner wall images, traditional image processing technology is limited by the limitations of the algorithm and it is difficult to accurately identify and classify a variety of defects, resulting in insufficient detection accuracy. In the face of high-density and high-precision PCB manufacturing needs, these traditional methods have gradually exposed their shortcomings in detection speed, accuracy and stability.
[0004] Therefore, how to improve the intelligence, accuracy and efficiency of circuit board hole inner wall defect detection is an urgent problem to be solved. Summary of the invention
[0005] The present invention overcomes the defects of the prior art and provides a circuit board inner wall defect detection method and system based on AI analysis feedback, the important purpose of which is to improve the intelligence, accuracy and efficiency of defect detection.
[0006] To achieve the above-mentioned purpose, the first aspect of the present invention provides a circuit board inner wall defect detection method based on AI analysis feedback, comprising:
[0007] Performing inner wall defect detection on the target circuit board to obtain inner wall defect detection information, and performing image preprocessing on the inner wall defect detection information to obtain preprocessed image information;
[0008] Based on the SIFT algorithm, image distortion is judged according to the preprocessed image information, whether image distortion occurs is analyzed and image correction is performed to obtain corrected defect detection image information;
[0009] Perform image expansion processing on the corrected defect detection image, convert the annular detection image into a two-dimensional plane image, and perform image fusion according to the time attribute of each expanded image to obtain a complete detection image of the inner wall of the target circuit board hole, and obtain the image information of the inner wall of the target hole position;
[0010] Building an inner wall defect recognition model based on CNN, inputting the inner wall image information of the target hole position into the inner wall defect recognition model for analysis, identifying the inner wall defects of the target circuit board hole, and obtaining inner wall defect recognition information;
[0011] The detection quantity range of each type of defects of the circuit boards in the current detection batch and the high-frequency defect areas of each type of defects are analyzed according to the inner wall defect identification information, and a detection optimization plan is formulated to optimize the detection efficiency.
[0012] In this solution, the inner wall defect detection of the target circuit board is performed to obtain inner wall defect detection information, and the inner wall defect detection information is subjected to image preprocessing to obtain preprocessed image information, which specifically includes:
[0013] Identify the target circuit board hole position, and perform hole inner wall defect detection based on the identification result to obtain inner wall defect detection information;
[0014] Performing image preprocessing on the inner wall defect detection information, filtering and denoising the inner wall defect detection information using a Gaussian filter, graying the filtered image, and obtaining a grayscale inner wall defect detection image;
[0015] A grayscale histogram is calculated according to the grayscale inner wall defect detection image, and contrast enhancement is performed on the grayscale inner wall defect detection image according to the grayscale histogram to obtain preprocessed image information.
[0016] In this solution, the SIFT algorithm is used to judge image distortion according to the preprocessed image information, analyze whether image distortion occurs and perform image correction to obtain corrected defect detection image information, specifically including:
[0017] Based on the pre-processed image information, the SIFT algorithm is used to perform image distortion detection, a reference image is defined, the reference image is downsampled to construct an image Gaussian pyramid, and two adjacent layers of images in the image Gaussian pyramid are subtracted to obtain a differential pyramid;
[0018] Detecting extreme points according to the difference pyramid, performing quadratic fitting on the detected extreme points, calculating the contrast of each extreme value and judging it with a preset threshold, and screening the extreme points according to the judgment result;
[0019] Calculate the similar gradient amplitudes and directions in the local neighborhood of the filtered extreme point, count the distribution of the gradient directions in the neighborhood and generate a direction histogram, extract the peak of the direction histogram as the main direction of the corresponding extreme point, generate the feature descriptor of the target extreme point and form a scale space;
[0020] Extracting reference feature points and reference feature descriptors based on the constructed scale space, performing feature extraction on the preprocessed image information to obtain first feature points and first feature descriptors, and calculating a Euclidean distance value between the reference feature descriptors and the first feature descriptors;
[0021] Performing feature point matching according to the calculated Euclidean distance value to obtain matching feature point pairs, and calculating the deviation between the matching point pairs according to the matching feature points to perform image distortion evaluation;
[0022] If there is image distortion, the distortion type is identified by constructing a transformation matrix according to the matching feature points, and image correction is performed on the preprocessed image information based on the distortion type identification result to obtain corrected defect detection image information.
[0023] In this solution, the image expansion processing is performed on the corrected defect detection image, the annular detection image is converted into a two-dimensional plane image, and image fusion is performed according to the time attribute of each expanded image to obtain a complete detection image of the inner wall of the target circuit board hole, which specifically includes:
[0024] Acquire the corrected defect detection image information, perform image expansion processing on the corrected defect detection image, expand the annular detection image into a two-dimensional plane image, extract the center of the circle according to the Hough circle transform method, and define it as the image expansion center;
[0025] Constructing a spatial coordinate system and a plane coordinate system, using a reverse mapping method to expand the target image according to the image expansion center, and converting the polar coordinates of the annular image into two-dimensional plane coordinates;
[0026] Obtaining a grayscale histogram based on the corrected detection image information, assigning grayscale values to each pixel point of the expanded two-dimensional plane image, and performing grayscale interpolation operation on the two-dimensional plane image after the grayscale assignment using a bilinear interpolation method to obtain final expanded image information;
[0027] Extracting the time attribute of each expanded image according to the final expanded image information to form an expanded image sequence, and performing image registration and image stitching on each expanded image in combination with an image fusion algorithm to obtain fused image information;
[0028] It is determined whether the fused image has image distortion according to the fused image information. If image distortion exists, image distortion correction is performed to obtain the target hole position inner wall image information.
[0029] In this solution, the inner wall defect recognition model is constructed based on CNN, and the inner wall image information of the target hole position is input into the inner wall defect recognition model for analysis to identify the inner wall defects of the target circuit board hole, specifically including:
[0030] Based on big data retrieval, defect images of the inner walls of various circuit board holes are obtained, the similarity between the defect images is calculated, and the clustering algorithm is used to classify them to obtain the classification information;
[0031] Based on the category division information, randomly rotate, randomly scale and randomly transform the images of different defect categories to expand the defect image samples and form a defect image data set;
[0032] Building an inner wall defect recognition model based on CNN, performing deep learning and training on the inner wall defect recognition model according to the defect image data set, and obtaining an inner wall defect recognition model that meets expectations;
[0033] Obtaining target hole inner wall image information, inputting it into the internal defect recognition model for defect recognition, performing feature extraction on the input hole inner wall image information, obtaining features of different scales, and generating shallow feature maps and deep feature maps;
[0034] A multi-layer hybrid attention mechanism is introduced to obtain the attention scores corresponding to the deep feature maps, including channel attention scores and spatial attention scores, and weighted fusion is performed to obtain the fused attention score;
[0035] The shallow feature map is feature-weighted according to the obtained fusion attention score, and shallow features are screened. The screened shallow features are fused with the deep feature map to obtain a fused feature map. Defects are identified based on the fused feature map to obtain inner wall defect identification information.
[0036] In this solution, the detection quantity interval of each type of defect of the circuit board in the current detection batch and the high-frequency defect area of each type of defect are analyzed according to the inner wall defect identification information, and a detection optimization plan is formulated to optimize the detection efficiency, which specifically includes:
[0037] Analyze the defect status of the circuit boards of the current inspection batch according to the inner wall defect identification information, count the defect types, sizes and areas of the circuit boards of the current inspection batch, and obtain circuit board defect status analysis information;
[0038] Extract the circuit board inspection serial numbers corresponding to each defect type according to the circuit board defect status analysis information and sort them, and analyze the inspection intervals where each type of defect in the current inspection batch appears according to the sorting results;
[0039] Extracting the regional features of each defect type through the defect condition analysis information, performing high-frequency defect area analysis, determining the high-frequency defect area of each type of defect in the current inspection batch, and obtaining high-frequency defect area information;
[0040] A detection optimization plan is formulated based on the high-frequency defect area information and the detection intervals where each type of defect occurs. The recognition priority of the corresponding defect type is allocated according to the detection intervals where each type of defect occurs. The attention weight is set according to the high-frequency defect area information to optimize the defect detection efficiency.
[0041] A second aspect of the present invention provides a circuit board inner wall defect detection system based on AI analysis feedback, the system comprising: a memory, a processor, the memory containing a circuit board inner wall defect detection method program based on AI analysis feedback, the circuit board inner wall defect detection method program based on AI analysis feedback when executed by the processor implements the following steps:
[0042] Performing inner wall defect detection on the target circuit board to obtain inner wall defect detection information, and performing image preprocessing on the inner wall defect detection information to obtain preprocessed image information;
[0043] Based on the SIFT algorithm, image distortion is judged according to the preprocessed image information, whether image distortion occurs is analyzed and image correction is performed to obtain corrected defect detection image information;
[0044] Perform image expansion processing on the corrected defect detection image, convert the annular detection image into a two-dimensional plane image, and perform image fusion according to the time attribute of each expanded image to obtain a complete detection image of the inner wall of the target circuit board hole, and obtain the image information of the inner wall of the target hole position;
[0045] Building an inner wall defect recognition model based on CNN, inputting the inner wall image information of the target hole position into the inner wall defect recognition model for analysis, identifying the inner wall defects of the target circuit board hole, and obtaining inner wall defect recognition information;
[0046] The detection quantity range of each type of defects of the circuit boards in the current detection batch and the high-frequency defect areas of each type of defects are analyzed according to the inner wall defect identification information, and a detection optimization plan is formulated to optimize the detection efficiency.
[0047] The present invention discloses a circuit board inner wall defect detection method and system based on AI analysis feedback, including: obtaining inner wall defect detection information, performing image preprocessing on the inner wall defect detection information, and obtaining preprocessed image information; performing image distortion judgment based on the preprocessed image information based on the SIFT algorithm, analyzing whether image distortion occurs and performing image correction; performing image expansion processing on the corrected defect detection image, and performing image fusion according to the time attribute of each expanded image to obtain a complete detection image of the inner wall of the target circuit board hole; constructing an inner wall defect recognition model based on CNN, identifying the inner wall defects of the target circuit board hole, and obtaining inner wall defect recognition information; analyzing the detection quantity interval of each type of defect of the current detection batch of circuit boards and the high-frequency defect area of each type of defect according to the inner wall defect recognition information, and formulating a detection optimization plan to optimize the detection efficiency. Improve the intelligence, accuracy and efficiency of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments or exemplary embodiments of the present invention, the drawings required for use in the embodiments or exemplary descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained according to the drawings without paying creative work.
[0049] Figure 1 A flow chart of a circuit board inner wall defect detection method based on AI analysis feedback provided in one embodiment of the present invention;
[0050] Figure 2 A flow chart of a circuit board inner wall defect detection control method provided by an embodiment of the present invention;
[0051] Figure 3 A block diagram of a circuit board inner wall defect detection system based on AI analysis feedback provided in one embodiment of the present invention;
[0052] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0054] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0055] Figure 1 A flow chart of a circuit board inner wall defect detection method based on AI analysis feedback provided in one embodiment of the present invention;
[0056] like Figure 1 As shown, the present invention provides a flow chart of a circuit board inner wall defect detection method based on AI analysis feedback, including:
[0057] S102, performing inner wall defect detection on the target circuit board to obtain inner wall defect detection information, and performing image preprocessing on the inner wall defect detection information to obtain preprocessed image information;
[0058] S104, performing image distortion judgment based on the preprocessed image information based on a SIFT algorithm, analyzing whether image distortion occurs and performing image correction to obtain corrected defect detection image information;
[0059] S106, performing image expansion processing on the corrected defect detection image, converting the annular detection image into a two-dimensional plane image, and performing image fusion according to the time attribute of each expanded image to obtain a complete detection image of the inner wall of the target circuit board hole, and obtaining the image information of the inner wall of the target hole position;
[0060] S108, constructing an inner wall defect recognition model based on CNN, inputting the inner wall image information of the target hole position into the inner wall defect recognition model for analysis, identifying the inner wall defects of the target circuit board hole, and obtaining inner wall defect recognition information;
[0061] S110, analyzing the detection quantity interval of each type of defects of the circuit boards of the current detection batch and the high-frequency defect area of each type of defects according to the inner wall defect identification information, and formulating a detection optimization plan to optimize the detection efficiency.
[0062] It should be noted that the present invention provides a circuit board inner wall defect detection method and system based on AI analysis feedback. In the process of in-hole defect detection, the SIFT algorithm is used to determine whether image distortion occurs, so as to perform preliminary processing. At the same time, since the hole position detection image is an annular image, the annular image is expanded into a two-dimensional plane image, and the image is fused according to the time series properties of the image to obtain a complete inner wall defect detection image. CNN is used to construct an inner wall defect recognition model, and a hybrid attention mechanism is introduced to further enhance the extraction effect of defect features, so as to obtain accurate inner wall defect recognition results. Finally, using the defect recognition results, the detected detection intervals of various types of defects in the current inspection batch of circuit boards and the high-frequency defect areas where defects occur are statistically analyzed to optimize the detection efficiency and improve the intelligence and accuracy of defect detection.
[0063] Further, in a preferred embodiment of the present invention, the inner wall defect detection of the target circuit board is performed to obtain the inner wall defect detection information, and the inner wall defect detection information is image preprocessed to obtain the preprocessed image information, specifically including:
[0064] Identify the target circuit board hole position, and perform hole inner wall defect detection based on the identification result to obtain inner wall defect detection information;
[0065] Performing image preprocessing on the inner wall defect detection information, filtering and denoising the inner wall defect detection information using a Gaussian filter, graying the filtered image, and obtaining a grayscale inner wall defect detection image;
[0066] A grayscale histogram is calculated according to the grayscale inner wall defect detection image, and contrast enhancement is performed on the grayscale inner wall defect detection image according to the grayscale histogram to obtain preprocessed image information.
[0067] Further, in a preferred embodiment of the present invention, the image distortion judgment is performed based on the pre-processed image information based on the SIFT algorithm, and whether image distortion occurs and image correction is performed to obtain the corrected defect detection image information, specifically including:
[0068] Based on the pre-processed image information, the SIFT algorithm is used to perform image distortion detection, a reference image is defined, the reference image is downsampled to construct an image Gaussian pyramid, and two adjacent layers of images in the image Gaussian pyramid are subtracted to obtain a differential pyramid;
[0069] Detecting extreme points according to the difference pyramid, performing quadratic fitting on the detected extreme points, calculating the contrast of each extreme value and judging it with a preset threshold, and screening the extreme points according to the judgment result;
[0070] Calculate the similar gradient amplitudes and directions in the local neighborhood of the filtered extreme point, count the distribution of the gradient directions in the neighborhood and generate a direction histogram, extract the peak of the direction histogram as the main direction of the corresponding extreme point, generate the feature descriptor of the target extreme point and form a scale space;
[0071] Extracting reference feature points and reference feature descriptors based on the constructed scale space, performing feature extraction on the preprocessed image information to obtain first feature points and first feature descriptors, and calculating a Euclidean distance value between the reference feature descriptors and the first feature descriptors;
[0072] Performing feature point matching according to the calculated Euclidean distance value to obtain matching feature point pairs, and calculating the deviation between the matching point pairs according to the matching feature points to perform image distortion evaluation;
[0073] If there is image distortion, the distortion type is identified by constructing a transformation matrix according to the matching feature points, and image correction is performed on the preprocessed image information based on the distortion type identification result to obtain corrected defect detection image information.
[0074] It should be noted that in the defect detection process, when the internal conditions are detected by the detection device, there is a distortion of the corresponding detection image due to the change of the posture of the detection device. The scale-invariant feature transform (SIFT) algorithm is used to detect and correct the image distortion. By defining the reference image, that is, the detection image initially obtained when the inner wall of the target hole is detected, the Gaussian pyramid is constructed by downsampling, and the image is smoothed and reduced multiple times at different scales to generate a series of image layers with different resolutions. Then, by subtracting the images of two adjacent layers in the Gaussian pyramid, a differential pyramid is formed, and extreme point detection is performed according to the differential pyramid, and quadratic fitting is performed on each detected extreme point to screen out truly meaningful extreme points, that is, key points. After the extreme point screening is completed, the gradient amplitude and direction of each similar point in the local neighborhood of each extreme point are calculated, and a direction histogram is generated. The peak value in the histogram is extracted as the main direction of the extreme point to generate a feature descriptor. The feature descriptor reflects the characteristics of the key points in the image at different scales. Subsequently, feature matching and distortion recognition are performed, and based on the recognition result of the distortion type, image correction is performed on the preprocessed image to obtain corrected defect detection image information.
[0075] Further, in a preferred embodiment of the present invention, the image expansion processing is performed on the corrected defect detection image, the annular detection image is converted into a two-dimensional plane image, and image fusion is performed according to the time attribute of each expanded image to obtain a complete detection image of the inner wall of the target circuit board hole, specifically including:
[0076] Acquire the corrected defect detection image information, perform image expansion processing on the corrected defect detection image, expand the annular detection image into a two-dimensional plane image, extract the center of the circle according to the Hough circle transform method, and define it as the image expansion center;
[0077] Constructing a spatial coordinate system and a plane coordinate system, using a reverse mapping method to expand the target image according to the image expansion center, and converting the polar coordinates of the annular image into two-dimensional plane coordinates;
[0078] Obtaining a grayscale histogram based on the corrected detection image information, assigning grayscale values to each pixel point of the expanded two-dimensional plane image, and performing grayscale interpolation operation on the two-dimensional plane image after the grayscale assignment using a bilinear interpolation method to obtain final expanded image information;
[0079] Extracting the time attribute of each expanded image according to the final expanded image information to form an expanded image sequence, and performing image registration and image stitching on each expanded image in combination with an image fusion algorithm to obtain fused image information;
[0080] It is determined whether the fused image has image distortion according to the fused image information. If image distortion exists, image distortion correction is performed to obtain the target hole position inner wall image information.
[0081] It should be noted that the original images obtained by the video tube and the camera are a series of continuous annular original images of the inner wall of the pipeline. The annular image is a panoramic image and is not suitable for observation. Moreover, due to the relatively small size of the conical mirror, each original image obtained only shows a very small section of the inner wall image of the pipeline, and it is difficult to extract defect features. Therefore, it is necessary to integrate all the original images to obtain the overall image of the inner wall of the pipeline. First, the Hough circle transform method is used to extract the center position of the image. The algorithm can effectively detect the edge features of the circle in the annular image and accurately extract the center position. Next, the spatial coordinate system and the plane coordinate system are constructed, and the target image is unfolded by the reverse mapping method. The core of the reverse mapping method is to convert the polar coordinates of the annular image into two-dimensional plane coordinates, so that the hole inner wall image originally arranged in a circle can be unfolded into a continuous two-dimensional plane image. After the unfolding is completed, the grayscale assignment is performed. The grayscale assignment is to obtain the grayscale value of each pixel in the rectangular image according to the grayscale of the annular image. If the horizontal and vertical coordinates of a point in the rectangular image are both integers after reverse mapping, that is, it just falls on a pixel point in the annular original image, then the grayscale of the point on the annular image is the grayscale value of the corresponding point after expansion; if it is not an integer coordinate value, it is necessary to perform grayscale interpolation on the original image to obtain the grayscale value of the position. Calculate the grayscale distribution of each pixel in the expanded image, and then use bilinear interpolation to process these grayscale values to ensure that the grayscale transition in the expanded image is natural, laying the foundation for subsequent analysis. Finally, according to the time attributes of each expanded image, the expanded image sequence is formed, and the image fusion algorithm is combined for registration and splicing to generate fused image information, and determine whether the fused image is distorted. If image distortion is detected, distortion correction is performed, and the target hole position inner wall image information is finally generated, so that the real condition of the inner wall of the circuit board hole can be accurately and clearly reflected, providing reliable data support for defect detection.
[0082] Further, in a preferred embodiment of the present invention, the inner wall defect recognition model is constructed based on CNN, and the inner wall image information of the target hole position is input into the inner wall defect recognition model for analysis to identify the inner wall defects of the target circuit board hole, specifically including:
[0083] Based on big data retrieval, defect images of the inner walls of various circuit board holes are obtained, the similarity between the defect images is calculated, and the clustering algorithm is used to classify them to obtain the classification information;
[0084] Based on the category division information, randomly rotate, randomly scale and randomly transform the images of different defect categories to expand the defect image samples and form a defect image data set;
[0085] Building an inner wall defect recognition model based on CNN, performing deep learning and training on the inner wall defect recognition model according to the defect image data set, and obtaining an inner wall defect recognition model that meets expectations;
[0086] Obtaining target hole inner wall image information, inputting it into the internal defect recognition model for defect recognition, performing feature extraction on the input hole inner wall image information, obtaining features of different scales, and generating shallow feature maps and deep feature maps;
[0087] A multi-layer hybrid attention mechanism is introduced to obtain the attention scores corresponding to the deep feature maps, including channel attention scores and spatial attention scores, and weighted fusion is performed to obtain the fused attention score;
[0088] The shallow feature map is feature-weighted according to the obtained fusion attention score, and shallow features are screened. The screened shallow features are fused with the deep feature map to obtain a fused feature map. Defects are identified based on the fused feature map to obtain inner wall defect identification information.
[0089] It should be noted that the inner wall defect recognition model is constructed using a convolutional neural network (CNN). The defect images of the circuit board holes of different defect categories are obtained through big data retrieval. The images of different defect categories are randomly rotated, randomly scaled and randomly grayscale transformed to expand the defect image samples, and the defect image data set is formed. The model is deeply learned and trained. In the process of model construction, a multi-layer hybrid attention mechanism is introduced for model optimization. The channel attention and spatial attention mechanisms are arranged in parallel using a parallel structure. The original SE module is replaced with SESM to introduce the spatial attention mechanism, and MMAM (multi-layer hybrid attention module) is added before the last fully connected layer of the model. This module applies channel attention and spatial attention in parallel, and enhances feature representation through average pooling and maximum pooling, allowing the model to learn features from different angles at the same time. The channel attention module captures channel-level features through average pooling and maximum pooling, generates different feature representations respectively, and then calculates the weights through one-dimensional convolution and sigmoid function. The spatial attention module focuses on the spatial dimension of the image, and uses operations similar to channel attention, but applied to the spatial domain, to identify and enhance important spatial areas in the image. In MAMM, the convolution kernel size of the one-dimensional convolution can be dynamically adjusted according to the number of channels of the input feature map, thereby adapting to features of different dimensions and reducing the amount of calculation, thereby achieving accurate identification and classification of different defect types.
[0090] Furthermore, in a preferred embodiment of the present invention, the detection quantity interval of each type of defect of the circuit board of the current detection batch and the high-frequency defect area of each type of defect are analyzed according to the inner wall defect identification information, and a detection optimization plan is formulated to optimize the detection efficiency, which specifically includes:
[0091] Analyze the defect status of the circuit boards of the current inspection batch according to the inner wall defect identification information, count the defect types, sizes and areas of the circuit boards of the current inspection batch, and obtain circuit board defect status analysis information;
[0092] Extract the circuit board inspection serial numbers corresponding to each defect type according to the circuit board defect status analysis information and sort them, and analyze the inspection intervals where each type of defect in the current inspection batch appears according to the sorting results;
[0093] Extracting the regional features of each defect type through the defect condition analysis information, performing high-frequency defect area analysis, determining the high-frequency defect area of each type of defect in the current inspection batch, and obtaining high-frequency defect area information;
[0094] A detection optimization plan is formulated based on the high-frequency defect area information and the detection intervals where each type of defect occurs. The recognition priority of the corresponding defect type is allocated according to the detection intervals where each type of defect occurs. The attention weight is set according to the high-frequency defect area information to optimize the defect detection efficiency.
[0095] It should be noted that when a large number of circuit board hole defects are detected, there are multiple holes to be detected on the circuit board. Due to the comprehensiveness of defect detection, all-round traversal identification of each hole position during detection will lead to reduced detection efficiency. Using the initial detection data, the defect type, size and specific area of each circuit board in the current detection batch are further analyzed, and all detected defects are summarized. Then, according to the defect status analysis information, the circuit board detection serial number corresponding to each defect type is extracted, and these serial numbers are sorted. The sorting result reveals the detection interval in which each type of defect appears in the current batch. For example, a crack defect will appear once in three to ten detection times, that is, the detection interval of three to ten times is the priority identification interval of the crack defect. At the same time, a high-frequency defect area analysis is performed based on the defect area to determine which areas are the most common defect concentration areas in the current detection batch. It further provides the importance of the defect concentration area when performing image feature extraction. Finally, based on the high-frequency defect area information and the detection interval of each type of defect, an optimized detection plan is formulated. According to the frequency of occurrence of the defect type, the corresponding defect type recognition priority is assigned. For example, if a certain type of defect frequently appears at a certain detection frequency, the recognition priority of the defect will be increased at that detection frequency. At the same time, the attention weight is set using the high-frequency defect area information to focus on these high-frequency defect areas, thereby optimizing the overall defect detection efficiency. This ensures that key defects can be identified more accurately and efficiently during the detection process, improving the overall quality and reliability of circuit board hole inner wall defect detection.
[0096] Figure 2 A flow chart of a circuit board inner wall defect detection control method provided by an embodiment of the present invention;
[0097] like Figure 2 As shown, the present invention provides a flow chart of a circuit board inner wall defect detection control method, including:
[0098] S202, performing inner wall defect detection on the target circuit board to obtain inner wall defect detection information, and performing image preprocessing on the inner wall defect detection information;
[0099] S204, performing image distortion judgment according to the pre-processed image information, performing distortion correction on the real-time detection image, and obtaining corrected defect detection image information;
[0100] S206, performing image expansion processing on each corrected defect detection image, converting the annular detection image into a two-dimensional plane image, and performing image fusion to obtain a complete detection image of the inner wall of the target circuit board hole;
[0101] S208, inputting the complete detection image of the inner wall of the target circuit board hole into the defect recognition model for defect recognition, and generating a defect detection report for the current detection batch according to the defect recognition result;
[0102] S210, using the defect detection report of the current detection batch to perform defect statistics, analyzing the detection quantity range of each type of defects of the circuit boards of the current detection batch and the high-frequency defect area of each type of defects, and formulating a detection optimization plan to optimize the detection efficiency.
[0103] In addition, in a circuit board inner wall defect detection method based on AI analysis feedback provided by the present invention, the following steps are also included:
[0104] Based on big data retrieval, images of inner walls of circuit board holes of different performance levels are acquired to form an initial data set, and representations of images of inner walls of circuit boards of different performance levels are analyzed according to the initial data set;
[0105] Extract defect features from the inner wall images of each circuit board hole at each performance level, analyze using a k-means clustering algorithm based on the extracted defect features, determine the various defect types at each performance level, and obtain first analysis information;
[0106] Based on the first analysis information, defect feature portraits of different performance levels are constructed as representations of corresponding performance levels to form a performance preliminary evaluation database;
[0107] Obtaining inner wall defect identification information of the target circuit board, performing feature extraction and calculating similarity between the extracted defect features and the defect feature portraits in the preliminary performance evaluation database, preliminarily evaluating the performance level of the target circuit board, and obtaining second analysis information;
[0108] Obtaining the performance standard requirements of the current batch of circuit boards, comparing the second analysis information with the performance standard of the current batch of circuit boards, and analyzing whether the target defective circuit board meets the corresponding performance standard;
[0109] If the performance standard requirements of the current batch of circuit boards are not met, the minimum performance standard requirements for the current circuit boards to be enabled are obtained to analyze whether the standard requirements are met;
[0110] If the minimum performance standards are met, the target circuit board will be marked as a usable circuit board and enabled in the next batch of production.
[0111] It should be noted that in the production process of circuit boards, defective circuit boards will inevitably appear. If the defective circuit boards are discarded, it will cause great economic losses. At the same time, strict performance testing of circuit boards will increase the workload and increase economic expenditure. Therefore, by using the defect characteristics of defective circuit boards, the presence or absence of defects in the inner wall images of circuit boards with different performance levels can be analyzed, and then the performance can be preliminarily evaluated, so that circuit boards that do not meet the requirements can be screened during the defect detection process, reducing the workload of subsequent performance evaluation. At the same time, because of different production needs, the performance requirements for circuit boards are also different. Circuit boards that do not meet the expected performance in the current batch may meet the corresponding performance requirements in the next production, thereby making full use of resources and avoiding waste.
[0112] Figure 3 A circuit board inner wall defect detection system 3 based on AI analysis feedback is provided in one embodiment of the present invention. The system includes: a memory 31 and a processor 32. The memory 31 contains a circuit board inner wall defect detection method program based on AI analysis feedback. When the circuit board inner wall defect detection method program based on AI analysis feedback is executed by the processor 32, the following steps are implemented:
[0113] Performing inner wall defect detection on the target circuit board to obtain inner wall defect detection information, and performing image preprocessing on the inner wall defect detection information to obtain preprocessed image information;
[0114] Based on the SIFT algorithm, image distortion is judged according to the preprocessed image information, whether image distortion occurs is analyzed and image correction is performed to obtain corrected defect detection image information;
[0115] Perform image expansion processing on the corrected defect detection image, convert the annular detection image into a two-dimensional plane image, and perform image fusion according to the time attribute of each expanded image to obtain a complete detection image of the inner wall of the target circuit board hole, and obtain the image information of the inner wall of the target hole position;
[0116] Building an inner wall defect recognition model based on CNN, inputting the inner wall image information of the target hole position into the inner wall defect recognition model for analysis, identifying the inner wall defects of the target circuit board hole, and obtaining inner wall defect recognition information;
[0117] The detection quantity range of each type of defects of the circuit boards in the current detection batch and the high-frequency defect areas of each type of defects are analyzed according to the inner wall defect identification information, and a detection optimization plan is formulated to optimize the detection efficiency.
[0118] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0119] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0120] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0121] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.
[0122] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0123] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A circuit board inner wall defect detection method based on AI analysis feedback, It is characterized in that include: Performing inner wall defect detection on the target circuit board to obtain inner wall defect detection information, and performing image preprocessing on the inner wall defect detection information to obtain preprocessed image information; Based on the SIFT algorithm, image distortion is judged according to the preprocessed image information, whether image distortion occurs is analyzed and image correction is performed to obtain corrected defect detection image information; Perform image expansion processing on the corrected defect detection image, convert the annular detection image into a two-dimensional plane image, and perform image fusion according to the time attribute of each expanded image to obtain a complete detection image of the inner wall of the target circuit board hole, and obtain the image information of the inner wall of the target hole position; Building an inner wall defect recognition model based on CNN, inputting the inner wall image information of the target hole position into the inner wall defect recognition model for analysis, identifying the inner wall defects of the target circuit board hole, and obtaining inner wall defect recognition information; The detection quantity range of each type of defects of the circuit boards in the current detection batch and the high-frequency defect areas of each type of defects are analyzed according to the inner wall defect identification information, and a detection optimization plan is formulated to optimize the detection efficiency.
2. According to claim 1, a circuit board inner wall defect detection method based on AI analysis feedback, It is characterized in that The step of performing inner wall defect detection on the target circuit board to obtain inner wall defect detection information and performing image preprocessing on the inner wall defect detection information to obtain preprocessed image information specifically includes: Identify the target circuit board hole position, and perform hole inner wall defect detection based on the identification result to obtain inner wall defect detection information; Performing image preprocessing on the inner wall defect detection information, filtering and denoising the inner wall defect detection information using a Gaussian filter, graying the filtered image, and obtaining a grayscale inner wall defect detection image; A grayscale histogram is calculated according to the grayscale inner wall defect detection image, and contrast enhancement is performed on the grayscale inner wall defect detection image according to the grayscale histogram to obtain preprocessed image information.
3. According to claim 1, a circuit board inner wall defect detection method based on AI analysis feedback, It is characterized in that The method of judging image distortion based on the preprocessed image information based on the SIFT algorithm, analyzing whether image distortion occurs and performing image correction to obtain corrected defect detection image information specifically includes: Based on the pre-processed image information, the SIFT algorithm is used to perform image distortion detection, a reference image is defined, the reference image is downsampled to construct an image Gaussian pyramid, and two adjacent layers of images in the image Gaussian pyramid are subtracted to obtain a differential pyramid; Detecting extreme points according to the difference pyramid, performing quadratic fitting on the detected extreme points, calculating the contrast of each extreme value and judging it with a preset threshold, and screening the extreme points according to the judgment result; Calculate the similar gradient amplitudes and directions in the local neighborhood of the filtered extreme point, count the distribution of the gradient directions in the neighborhood and generate a direction histogram, extract the peak of the direction histogram as the main direction of the corresponding extreme point, generate the feature descriptor of the target extreme point and form a scale space; Extracting reference feature points and reference feature descriptors based on the constructed scale space, performing feature extraction on the preprocessed image information to obtain first feature points and first feature descriptors, and calculating a Euclidean distance value between the reference feature descriptors and the first feature descriptors; Performing feature point matching according to the calculated Euclidean distance value to obtain matching feature point pairs, and calculating the deviation between the matching point pairs according to the matching feature points to perform image distortion evaluation; If there is image distortion, the distortion type is identified by constructing a transformation matrix according to the matching feature points, and image correction is performed on the preprocessed image information based on the distortion type identification result to obtain corrected defect detection image information.
4. According to claim 1, a circuit board inner wall defect detection method based on AI analysis feedback, It is characterized in that The image expansion processing is performed on the corrected defect detection image, the annular detection image is converted into a two-dimensional plane image, and image fusion is performed according to the time attribute of each expanded image to obtain a complete detection image of the inner wall of the target circuit board hole, specifically including: Acquire the corrected defect detection image information, perform image expansion processing on the corrected defect detection image, expand the annular detection image into a two-dimensional plane image, extract the center of the circle according to the Hough circle transform method, and define it as the image expansion center; Constructing a spatial coordinate system and a plane coordinate system, using a reverse mapping method to expand the target image according to the image expansion center, and converting the polar coordinates of the annular image into two-dimensional plane coordinates; Obtaining a grayscale histogram based on the corrected detection image information, assigning grayscale values to each pixel point of the expanded two-dimensional plane image, and performing grayscale interpolation operation on the two-dimensional plane image after the grayscale assignment using a bilinear interpolation method to obtain final expanded image information; Extracting the time attribute of each expanded image according to the final expanded image information to form an expanded image sequence, and performing image registration and image stitching on each expanded image in combination with an image fusion algorithm to obtain fused image information; It is determined whether the fused image has image distortion according to the fused image information. If image distortion exists, image distortion correction is performed to obtain the target hole position inner wall image information.
5. According to claim 1, a circuit board inner wall defect detection method based on AI analysis feedback, It is characterized in that The inner wall defect recognition model is constructed based on CNN, and the inner wall image information of the target hole position is input into the inner wall defect recognition model for analysis to identify the inner wall defects of the target circuit board hole, specifically including: Based on big data retrieval, defect images of the inner walls of various circuit board holes are obtained, the similarity between the defect images is calculated, and the clustering algorithm is used to classify them to obtain the classification information; Based on the category division information, randomly rotate, randomly scale and randomly transform the images of different defect categories to expand the defect image samples and form a defect image data set; Building an inner wall defect recognition model based on CNN, performing deep learning and training on the inner wall defect recognition model according to the defect image data set, and obtaining an inner wall defect recognition model that meets expectations; Obtaining target hole inner wall image information, inputting it into the internal defect recognition model for defect recognition, performing feature extraction on the input hole inner wall image information, obtaining features of different scales, and generating shallow feature maps and deep feature maps; A multi-layer hybrid attention mechanism is introduced to obtain the attention scores corresponding to the deep feature maps, including channel attention scores and spatial attention scores, and weighted fusion is performed to obtain the fused attention score; The shallow feature map is feature-weighted according to the obtained fusion attention score, and shallow features are screened. The screened shallow features are fused with the deep feature map to obtain a fused feature map. Defects are identified based on the fused feature map to obtain inner wall defect identification information.
6. According to claim 1, a circuit board inner wall defect detection method based on AI analysis feedback, It is characterized in that The method of analyzing the detection quantity interval of each type of defect of the circuit boards in the current detection batch and the high-frequency defect area of each type of defect according to the inner wall defect identification information, and formulating a detection optimization plan to optimize the detection efficiency specifically includes: Analyze the defect status of the circuit boards of the current inspection batch according to the inner wall defect identification information, count the defect types, sizes and areas of the circuit boards of the current inspection batch, and obtain circuit board defect status analysis information; Extract the circuit board inspection serial numbers corresponding to each defect type according to the circuit board defect status analysis information and sort them, and analyze the inspection intervals where each type of defect in the current inspection batch appears according to the sorting results; Extracting the regional features of each defect type through the defect condition analysis information, performing high-frequency defect area analysis, determining the high-frequency defect area of each type of defect in the current inspection batch, and obtaining high-frequency defect area information; A detection optimization plan is formulated based on the high-frequency defect area information and the detection intervals where each type of defect occurs. The recognition priority of the corresponding defect type is allocated according to the detection intervals where each type of defect occurs. The attention weight is set according to the high-frequency defect area information to optimize the defect detection efficiency.
7. A circuit board inner wall defect detection system based on AI analysis feedback, It is characterized in that The system includes: a memory and a processor, wherein the memory contains a circuit board inner wall defect detection method program based on AI analysis feedback, and the circuit board inner wall defect detection method program based on AI analysis feedback is executed by the processor to implement the following steps: Performing inner wall defect detection on the target circuit board to obtain inner wall defect detection information, and performing image preprocessing on the inner wall defect detection information to obtain preprocessed image information; Based on the SIFT algorithm, image distortion is judged according to the preprocessed image information, whether image distortion occurs is analyzed and image correction is performed to obtain corrected defect detection image information; Perform image expansion processing on the corrected defect detection image, convert the annular detection image into a two-dimensional plane image, and perform image fusion according to the time attribute of each expanded image to obtain a complete detection image of the inner wall of the target circuit board hole, and obtain the image information of the inner wall of the target hole position; Building an inner wall defect recognition model based on CNN, inputting the inner wall image information of the target hole position into the inner wall defect recognition model for analysis, identifying the inner wall defects of the target circuit board hole, and obtaining inner wall defect recognition information; The detection quantity range of each type of defects of the circuit boards in the current detection batch and the high-frequency defect areas of each type of defects are analyzed according to the inner wall defect identification information, and a detection optimization plan is formulated to optimize the detection efficiency.
Citation Information
Cited By
PCB drilling quality automatic evaluation method based on artificial intelligence
CN121073916A
X-ray-based PCB blind hole defect detection method
CN121120594A
An X-ray-based method for detecting blind via defects in PCB boards
CN121120594B
