Circuit board image appearance comparative analysis system and method based on large model
By analyzing the global edge density and local texture contrast of circuit board images, dynamic scale factors are generated, regional correlation diagrams are constructed, and parallel convolutional paths are dynamically selected, which solves the problem of global and local analysis switching in large-scale circuit board detection, and improves detection accuracy and robustness.
Patent Information
- Application Number
- CN202510411793.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-07-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
It is difficult to dynamically switch between global and local analysis in the detection of existing large-scale circuit boards, resulting in missing key information or redundant misjudgment of the detection results, especially in complex circuit board designs with intensified defect diversity and background interference.
By analyzing the significance distribution of global edge density and local texture contrast, dynamic scale factors are generated, regional correlation maps are constructed, parallel convolution paths are dynamically selected, global and local features are accurately extracted, and defect probability distribution maps are generated through feature integration.
It significantly improves the accuracy and robustness of circuit board defect detection, reduces false detection and missed detection, adapts to complex circuit board design and variable manufacturing processes, and improves the efficiency and reliability of quality control.
Smart Images

Figure CN120259267A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of circuit board detection, and more specifically, to a circuit board image appearance comparison and analysis system and method based on a large model. Background Art
[0002] In a circuit board image appearance comparison and analysis system based on a large model, the detection task needs to flexibly switch between global and local analysis according to the defect type. For example, when checking whether the overall layout of the circuit board is shifted, global analysis is required to capture changes in the macro structure; while when detecting whether a small solder joint is unsoldered, it is necessary to focus on the local area to extract fine texture features. However, in actual industrial scenarios, defects are often not of a single type, but may involve both global and local characteristics simultaneously. For example, a circuit board may have an abnormal overall layout due to installation offset, and at the same time, some solder joints may have small cracks due to uneven pressure. Such composite defects require the system to pay attention to the overall context during analysis and accurately locate local anomalies. Large models usually process such problems through multi-scale feature extraction (such as multi-layer feature maps of convolutional neural networks), but lack a clear decision-making mechanism to determine when to give priority to the global view and when to focus on local details. This ambiguity may lead to missing key information or generating redundant misjudgments in the detection results. Especially in complex circuit board designs (such as high-density interconnect boards HDI), the diversity of defects and background interference further exacerbate this challenge.
[0003] To solve the above problems, a technical solution is provided. Summary of the Invention
[0004] To overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a circuit board image appearance comparison and analysis system and method based on a large model. By analyzing the significance distribution of global edge density and local texture contrast, key features are extracted and a dynamic scale factor is generated. Combining regional space and significance differences, a regional association graph is constructed to achieve adaptive switching between global and local foci; based on the connection strength of the regional association graph, parallel convolution paths are dynamically selected to accurately extract global and local features, and a defect probability distribution map is generated through feature integration technology to accurately locate and classify defects; thereby significantly improving the accuracy and robustness of circuit board defect detection, effectively reducing false detections and missed detections, providing efficient and reliable support for quality control in the circuit board manufacturing industry, and overall promoting the technological progress and quality assurance capabilities of the industry to solve the problems raised in the above background art.
[0005] To achieve the above object, the present invention provides the following technical solutions: A circuit board image appearance comparison and analysis method based on a large model, including the steps: Analyze the global and local feature saliency distributions of the circuit board image, extract key features from it, and generate a dynamic scale factor; Based on the dynamic scale factor and regional saliency differences, construct a regional association graph to guide focus switching; Based on the regional association graph, dynamically select the feature extraction path; Integrate the features extracted by the dynamic path according to the association graph, and generate a defect probability distribution map to identify defects.
[0006] In a preferred embodiment, obtaining the dynamic scale factor specifically includes the following content: The key features include the global edge complexity index and the local texture difference index ; Combining the global edge complexity index and the local texture difference index, guiding the large model to adaptively adjust the analysis strategy according to the image features, the calculation formula of the dynamic scale factor is as follows: , where and are the weights of the global edge complexity index and the local texture difference index respectively.
[0007] In a preferred embodiment, the calculation of the global edge complexity index is divided into the following steps: First, apply the Canny edge detection algorithm to the input circuit board image to generate a binary edge image ; The global edge density is defined as: , where, and represent the height and width of the circuit board image; represents the pixel value in the edge image; Then, combining the edge density and edge connectivity, calculate the global edge complexity index as: , where, represents the number of connected components in the edge image.
[0008] In a preferred embodiment, the calculation of the local texture difference index is divided into the following steps: Divide the input circuit board image into grids, each grid corresponds to a region, for each region, use the contrast index of the gray-level co-occurrence matrix to calculate the texture contrast : , where, The elements of the gray-level co-occurrence matrix representing the region indicate the gray levels and the probability of adjacency; combining the statistical characteristics of the contrast of all regions, calculate the local texture difference index: and ; where , represents the variance of all texture contrasts; represents the standard deviation of the texture contrast; represents the maximum contrast value in all regions; represents the mean of all texture contrasts.
[0009] In a preferred embodiment, the process of constructing the region association graph is as follows: After dividing the regions and extracting features, for any two adjacent regions and , calculate the difference in their significant features, denoted as , and the calculation formula is , where and are the local texture contrasts of regions and respectively; at the same time, considering the spatial distance between regions, which is defined as the Euclidean distance between the center points of the two regions.
[0010] In a preferred embodiment, combining the significant difference , the spatial distance and the dynamic scale factor , calculate the similarity measure between regions: , where and are normalization factors, taking the means of the significant differences and spatial distances of all adjacent region pairs respectively, used to standardize the influence of feature differences and distances; , is the maximum distance between any two regions in the image, representing the global spatial correlation; represents the similarity of local features; Based on the calculated similarity, construct an undirected graph as the region association graph, where the vertex set corresponds to all regions , and the edge set connects adjacent regions, and the weight of the edge is set to the similarity.
[0011] In a preferred embodiment, based on the region association graph, the feature extraction path is dynamically selected, and the specific processing process is as follows: A. Through the convolution path processing in parallel with the global convolution path and the local convolution path, independent feature maps are generated respectively; B. Dynamically select the output of which path according to the connection strength of the region association graph, quantify the feature extraction requirements of each region based on the region association graph, and calculate its average connection strength : , where represents the number of neighbor regions directly connected to region ; represents the connection strength between region and neighbor region ; represents the set of regions adjacent to region ; For each region, compare the average connection strength with the global threshold: If the average connection strength is greater than the global threshold, select the global convolution path; if the average connection strength is less than or equal to the global threshold, select the local convolution path.
[0012] In a preferred embodiment, C. According to the selection result, extract features for each region from the corresponding convolution path; finally, splice the feature maps of all regions into a complete feature map.
[0013] In a preferred embodiment, the process of obtaining the defect probability distribution map is as follows: Calculate the dynamic weighting factor of each region according to the connection strength of the region association graph. The dynamic weighting factor is obtained by multiplying the average connection strength by the exponential decay term of the significance entropy and then performing normalization processing; After obtaining the dynamic weighting factor, adaptively fuse the global and local features of each region; the fused feature consists of a linear combination of the weighted global feature, the weighted local feature, and the mutual information enhancement term; The fused feature map is input into the defect detection network to generate a defect probability distribution map; through multi-scale feature integration and hybrid loss optimization, a defect probability distribution map is generated; Post-process the defect probability distribution map to identify the specific location and type of the defect.
[0014] A circuit board image appearance comparison and analysis system based on a large model includes: a feature parsing module, an association regulation module, a path optimization module, and a defect location module; Feature parsing module: By analyzing the global and local feature saliency distributions of the circuit board image, extract key features and generate a dynamic scale factor; Association regulation module: Use dynamic scale factors and regional significant differences to construct regional association maps, dynamically regulate focus switching, and enhance the association between regions; Path optimization module: Based on the regional association graph, dynamically select the optimal feature extraction path to improve detection accuracy and efficiency; Defect location module: Integrate the features extracted from the dynamic path according to the association graph to generate a defect probability distribution map to accurately identify the defect location and type.
[0015] The technical effects and advantages of the circuit board image appearance comparison and analysis system and method based on a large model of the present invention are as follows: The present invention analyzes the significance distribution of global edge density and local texture contrast, extracts key features and generates dynamic scale factors, and constructs a regional association map in combination with regional space and significance differences to achieve adaptive switching of global and local focus; based on the connection strength of the regional association map, the present invention dynamically selects parallel convolution paths, accurately extracts global and local features, and generates a defect probability distribution map through feature integration technology to accurately locate and classify defects; thereby significantly improving the accuracy and robustness of circuit board defect detection, effectively reducing false detections and missed detections, and showing excellent versatility and adaptability under complex circuit board designs and changing manufacturing processes, providing efficient and reliable support for quality control in the circuit board manufacturing industry, and promoting the industry's overall technological progress and quality assurance capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of a flow chart of a circuit board image appearance comparison and analysis method based on a large model of the present invention; Figure 2 The present invention is a schematic structural diagram of a circuit board image appearance comparison and analysis system based on a large model. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] Embodiment 1: Figure 1 The present invention provides a circuit board image appearance comparison and analysis method based on a large model, comprising: The global and local feature saliency distribution of circuit board images is analyzed, key features are extracted from them and dynamic scaling factors are generated.
[0019] Construct a regional association graph based on dynamic scale factors and regional significance differences to guide focus switching.
[0020] Based on the regional association graph, dynamically select the feature extraction path.
[0021] Integrate the features extracted by the dynamic path according to the association graph to generate a defect probability distribution map to identify defects.
[0022] Obtain the dynamic scale factor, which specifically includes the following: In the circuit board image appearance comparison and analysis system based on large models of the present invention, the core task is to accurately analyze the global features (such as overall layout offset) and local features (such as texture details in the solder joint area) of the circuit board image to identify potential defects (such as abnormal solder joints, circuit breaks, etc.). The characteristics of the circuit board image are its complex layout and rich details. Relying solely on global analysis may overlook local anomalies, while excessive focus on local details may ignore the overall layout offset problem. Therefore, the system needs to achieve a dynamic balance between global and local analysis. To this end, the present invention introduces two key indices: the global edge complexity index and the local texture difference index, and generates a dynamic scale factor based on these two indices to guide the large model to adaptively adjust the analysis strategy according to the actual features of the circuit board image.
[0023] The key features include the global edge complexity index and the local texture difference index.
[0024] Global edge complexity index: Evaluate the complexity of the overall layout of the circuit board.
[0025] In the appearance comparison and analysis of circuit board images, the global edge complexity index is used to quantify the complexity of the overall layout of the circuit board image, reflecting the distribution characteristics of circuit traces, solder pads, and component outlines. Through the global edge complexity index, the system can determine whether the circuit board image requires stronger global analysis (such as overall layout offset or large-scale breaks). The calculation of the global edge complexity index is divided into the following steps: First, apply the Canny edge detection algorithm to the input circuit board image to generate a binary edge image . The edges on the circuit board mainly come from circuit traces, solder pads, and component outlines. The global edge density is defined as the ratio of the number of edge pixels to the total number of pixels in the image, and is used to measure the complexity of the overall layout of the circuit board: , where and represent the height and width of the circuit board image.
[0026] represents the pixel The value, if it is an edge point, then , otherwise it is 0.
[0027] The range of is between [0, 1]. The larger the value, the more complex the PCB layout is, and more attention needs to be paid to the global features.
[0028] The global edge density only reflects the proportion of edges and cannot comprehensively evaluate the complexity and potential anomalies (such as breaks) of the PCB layout. Therefore, by combining the edge density and edge connectivity (reflecting the continuity and integrity of the circuit traces), the global edge complexity index is calculated as: , where represents the number of connected components in the edge image, reflecting the breaks or anomalies in the circuit traces.
[0029] The first part : Through logarithmic function smoothing, combining the edge density and the square root of the connected components to highlight the influence of abnormal edges.
[0030] The second part : Based on the Sigmoid function, enhancing the sensitivity to moderately complex PCBs.
[0031] The global edge complexity index quantifies the complexity and abnormality of the PCB edge through non - linear combination, providing an important reference for the global features of the large model and guiding it to adjust the priority of global analysis.
[0032] Local texture difference index: Evaluating anomalies in the detailed areas of the PCB.
[0033] In the appearance comparison and analysis of PCB images, the local texture difference index is used to quantify the texture differences in the detailed areas (such as solder joints, traces, or components) of the PCB image and identify potential local defects. The calculation of the local texture difference index evaluates the degree of anomaly in the detailed area by analyzing the statistical characteristics of the local texture contrast. The specific steps are as follows: Divide the input PCB image into grids, and each grid corresponds to an area that may contain key parts such as solder joints, traces, or components. For each area, calculate the texture contrast using the contrast index of the gray - level co - occurrence matrix , reflecting the richness of local details: , where represents the element of the gray - level co - occurrence matrix of area , indicating the probability that the gray levels and are adjacent.
[0034] The larger the texture contrast value, the more significant the texture change in the area, which may contain solder joint abnormalities or circuit defects.
[0035] To evaluate the overall difference of the local texture of the circuit board image, combining the statistical characteristics of the contrast of all regions, calculate the local texture difference index: , where represents the variance of all texture contrasts, reflecting the degree of dispersion of texture contrasts. The texture difference in the defective area on the circuit board is usually large.
[0036] represents the standard deviation of the texture contrast.
[0037] represents the maximum contrast value in all regions, which may correspond to the defective area.
[0038] represents the mean value of all texture contrasts, which is the benchmark for the overall texture level.
[0039] The first part : Highlight the extreme cases of texture differences. When the maximum contrast is much higher than the mean value, it indicates the existence of local abnormalities.
[0040] The second part : When the standard deviation of the texture contrast exceeds 1, enhance the attention to the high-difference regions.
[0041] The global edge complexity index and the local texture difference index respectively reflect the importance of the global and local features of the circuit board image. However, relying solely on a single index cannot achieve the dynamic balance of global and local analysis. Therefore, combine the global edge complexity index and the local texture difference index to guide the large model to adaptively adjust the analysis strategy according to the image features. The calculation formula of the dynamic scale factor is as follows: , where and are the weights of the global edge complexity index and the local texture difference index respectively, based on the empirical assumption that local details (such as solder joint defects) are usually more critical than the global layout in circuit board detection. It can be dynamically adjusted according to the detection deviation later.
[0042] The numerator : Combine the global edge complexity index and the local texture difference index in a weighted sum manner to highlight their linear contributions. The weights reflect the relative importance of global and local features.
[0043] The denominator : Take the square root of the sum of the square of the difference between the global edge complexity index and the local texture difference index plus 1 as the normalization factor. When the difference between the global edge complexity index and the local texture difference index is large, the denominator increases and the value of the dynamic scale factor decreases, indicating an imbalance in the dominance of global and local features, suggesting that the large model tends to focus on more prominent features; when the two are close, the denominator approaches 1 and the value of the dynamic scale factor is closer to the weighted sum, suggesting that global and local features need to be analyzed evenly.
[0044] In the circuit board image appearance comparison and analysis system based on the large model of the present invention, by calculating the global edge complexity index and the local texture difference index and comprehensively generating a dynamic scale factor, the system can dynamically adjust the analysis strategy according to the actual characteristics of the circuit board image. The global edge complexity index evaluates the complexity of the overall layout by analyzing the density and connectivity of the circuit board edge; the local texture difference index evaluates the abnormality degree of the detail area through the statistical characteristics of the local texture contrast. The final dynamic scale factor provides clear guidance for the large model, ensuring that global and local analysis are adaptively balanced during the detection process, thereby improving the accuracy and robustness of circuit board defect detection. The present invention realizes efficient and accurate appearance comparison and analysis by combining the characteristics of circuit board images through index design and dynamic adjustment mechanisms.
[0045] The process of constructing the region association graph is as follows: After dividing the regions and extracting features, for any two adjacent regions and , calculate the difference in their significant features, denoted as , and the calculation formula is . In the formula, and are the local texture contrasts of regions and respectively. The absolute value operation ensures that the difference is positive, reflecting the gap in texture complexity between the two regions. At the same time, considering the spatial distance between regions, which is defined as the Euclidean distance between the center points of the two regions. The significant difference quantifies the difference in texture features between adjacent regions, and the spatial distance introduces the constraint of spatial relationship. The combination of the two provides a multi-dimensional basis for similarity calculation, ensuring that similarity depends not only on feature differences but also on spatial proximity.
[0046] Comprehensively considering the significant difference , the spatial distance and the dynamic scale factor , calculate the similarity measure between regions. Among them, and is a normalization factor that takes the mean of the significant differences and spatial distances of all adjacent region pairs respectively, and is used to standardize the effects of feature differences and distances; , is the maximum distance between any two regions in the image, representing the global spatial correlation. The smaller the value, the farther the distance and the weaker the global correlation; , representing the similarity of local features. When the significant difference is small, the local similarity is higher. The exponential decay term ensures that the similarity decreases as the difference and distance increase, and is then multiplied by a weighting factor to dynamically adjust the global and local contributions. The similarity combines the feature difference and spatial distance through exponential decay, making adjacent regions with similar features have a higher similarity, while the weighted adjustment of the dynamic scale factor ensures that the similarity calculation can flexibly change according to global or local requirements.
[0047] Based on the calculated similarity, construct an undirected graph as the region association graph. Among them, the vertex set corresponds to all regions , and the edge set connects adjacent regions, and the weight of the edge is set to the similarity. This association graph is used to guide the focus switching: if the weight of a certain edge is high, it means that the two regions are strongly correlated and tend to perform global feature analysis; if the weight is low, it means that the region has strong independence and should focus on local detail analysis. The region association graph intuitively reflects the similarity strength between regions through the weights of the edges, provides explicit guidance for subsequent feature extraction, enables the large model to dynamically adjust the analysis focus, and improves the ability to capture global and local features in the circuit board image.
[0048] Based on the region association graph, dynamically select the feature extraction path. The specific processing process is as follows: A. The defects in the circuit board image have multi-scale characteristics, and a single convolutional path is difficult to capture global and local features simultaneously. Therefore, use a convolutional path processing with a global convolutional path and a local convolutional path in parallel: Global convolutional path: Use a large convolutional kernel (such as 7×7) to capture large-range edges, layout offsets, or overall structural features in the image through a larger receptive field, which is suitable for detecting global defects, such as overall layout offsets or large-area fractures.
[0049] Local convolutional path: Use a small convolutional kernel (such as 3×3) to focus on extracting fine textures and local detail features, which is suitable for detecting local defects, such as solder joint abnormalities or circuit scratches.
[0050] These two paths run in parallel and generate independent feature maps respectively.
[0051] D. Dynamically select the output of which path to use based on the connection strength of the regional association graph. Quantify the feature extraction requirements of each region based on the regional association graph and calculate its average connection strength : , where represents the number of neighbor regions directly connected to region ; represents the connection strength between region and neighbor region ; represents the set of regions adjacent to region .
[0052] In the circuit board image, regions with high connection strength usually have similar textures and structures, may belong to a part of a large-scale defect, and are suitable for global feature extraction; while regions with low connection strength may contain independent details or local anomalies and require local feature extraction. The average connection strength provides a quantitative basis for dynamic path selection.
[0053] To achieve dynamic path selection, calculate a global threshold as the judgment basis, which is defined as the mean of the average connection strengths of all regions.
[0054] For each region, compare the average connection strength with the global threshold: If the average connection strength is greater than the global threshold, select the global convolution path (large convolution kernel).
[0055] If the average connection strength is less than or equal to the global threshold, select the local convolution path (small convolution kernel).
[0056] C. According to the selection result, extract features from each region from the corresponding convolution path: If the global convolution path is selected, use a large convolution kernel for convolution to generate a global feature map .
[0057] If the local convolution path is selected, use a small convolution kernel for convolution to generate a local feature map .
[0058] Finally, splice the feature maps of all regions into a complete feature map : , where is the feature map of region ( or ), and the spatial correspondence of the regions is maintained during splicing.
[0059] By dynamically extracting features and adjusting the feature granularity according to the regional characteristics of the circuit board image, it ensures that the features of global defects (such as layout offset) and local defects (such as solder joint anomalies) are effectively captured, providing high-quality input for subsequent defect detection.
[0060] D. In order to continuously improve the detection accuracy, a feedback optimization mechanism is introduced to use the deviation between the subsequent defect probability distribution map and the actual annotation to reversely adjust the global threshold: If the detection results show a lot of false positives (normal areas are mistakenly identified as defects), increase the global threshold to reduce the proportion of global feature extraction and enhance attention to local details.
[0061] If the inspection results show a large number of missed detections (defects are not detected), reduce the global threshold to increase the proportion of global feature extraction.
[0062] Adjustment can be done by optimizing the global threshold via gradient descent to minimize the overall detection bias: , in, represents the detection bias loss function; Represents the learning rate.
[0063] The feedback mechanism enables the system to dynamically optimize the path selection strategy according to the actual detection results, improve the adaptability to different circuit board images, ensure the stable improvement of long-term detection accuracy, and meet the needs of high-precision comparison and analysis in background technology.
[0064] The process of obtaining the defect probability distribution diagram is as follows: To achieve adaptive fusion of global and local features, the dynamic weighting factor of each region is calculated according to the connection strength of the regional association map. Specifically, for each image region, the average value of its connection strength with neighboring regions is calculated as a measure of the similarity between regions. To enhance the discrimination of the weighting factor, the regional saliency entropy is introduced as a modulation factor. Saliency entropy calculates the degree of uniformity by analyzing the normalized distribution of connection strength. The higher the uniformity, the greater the entropy value. Finally, the dynamic weighting factor is obtained by multiplying the average connection strength with the exponential decay term of saliency entropy and then normalizing it. By combining the average connection strength and saliency entropy, the feature fusion weight of each region is finely adjusted to avoid excessive dominance of global features and ensure the adaptability of the fusion process.
[0065] After obtaining the dynamic weighting factors, the global and local features of each region are adaptively fused. In the fusion process, the dynamic weighting factors are first used to weight and adjust the global and local features, and at the same time, a mutual information enhancement term between the features is introduced. Mutual information measures the correlation between the global and local features by comparing the joint distribution and their respective independent distributions. The stronger the correlation, the larger the mutual information value. The final fused feature is composed of the weighted global feature, the weighted local feature, and a linear combination of the mutual information enhancement terms. Through dynamic weighting and mutual information enhancement, the potential dependence relationships between the features are mined, and the representation ability of the fused feature for defects is enhanced, thereby improving the detection accuracy.
[0066] The fused feature map is input into a specially designed defect detection network to generate a defect probability distribution map. The network first extracts high-level semantic features through multi-layer convolution and pooling operations, then applies a channel attention module to adjust the weights of each channel, and finally restores the feature map to the original resolution through an upsampling operation to output the defect probability of each pixel. To optimize the network performance, a combination of cross-entropy loss and Dice loss is adopted. The former measures the difference between the predicted probability and the true label, and the latter improves the segmentation accuracy of the defect region. Through multi-scale feature integration and hybrid loss optimization, a fine defect probability distribution map is generated to improve the detection ability for small defects.
[0067] The defect probability distribution map is post-processed to identify the specific location and type of the defect. First, a dynamic threshold is set according to the mean and standard deviation of the pixel values of the probability map, and the pixels exceeding the threshold are marked as potential defect regions. Then, a clustering algorithm is applied to group these defect pixels to form independent defect regions. For each defect region, the corresponding subset of fused features is extracted and input into a lightweight classification network. The network processes the features through fully connected layers and then uses the softmax function to generate the type probability distribution, and the category with the highest probability is taken as the final type of the defect. Through dynamic thresholding and clustering classification, accurate segmentation and semantic annotation of the defect are achieved, improving the practicality and interpretability of the detection results.
[0068] Through the dynamic path extraction and feature integration technology, the precise capture of multi-scale defects in the printed circuit board image is realized, which can adaptively balance the analysis requirements of global layout anomalies and local detail problems, and significantly improve the accuracy and robustness of defect detection. Through adaptive feature fusion and the generation of defect probability distribution maps, false detections and missed detections are effectively reduced. Especially in the face of complex printed circuit board designs and variable manufacturing processes, it shows good generality and adaptability. In addition, this automated detection scheme significantly improves production efficiency, reduces the cost and error rate of manual inspection, and provides efficient and reliable technical support for quality control in the printed circuit board manufacturing industry.
[0069] Example 2: Figure 2The present invention provides a circuit board image appearance comparison and analysis system based on a large model, including: a feature analysis module, a correlation regulation module, a path optimization module, and a defect location module.
[0070] Feature analysis module: By analyzing the global and local feature saliency distributions of the circuit board image, key features are extracted and a dynamic scale factor is generated, laying a foundation for subsequent steps.
[0071] Correlation regulation module: Using the dynamic scale factor and regional saliency differences, a regional correlation graph is constructed to dynamically regulate the focus switching and enhance the correlation between regions.
[0072] Path optimization module: Based on the regional correlation graph, the optimal feature extraction path is dynamically selected to improve the detection accuracy and efficiency.
[0073] Defect location module: The features extracted by the dynamic path are integrated according to the correlation graph to generate a defect probability distribution map, accurately identifying the defect location and type.
[0074] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data for software simulation to obtain a formula that is closest to the actual situation. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0075] Only some exemplary embodiments of the present invention have been described above by way of illustration. Undoubtedly, for those of ordinary skill in the art, without departing from the spirit and scope of the present invention, the described embodiments can be modified in various different ways. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the protection scope of the claims of the present invention.
[0076] It should be noted that in this text, if there are relational terms such as first and second, they are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "including", "comprising" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0077] As described above, it is only the specific implementation manner of the present application. However, the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims described above.
Claims
1. A method for comparing and analyzing the appearance of printed circuit board images based on a large model, characterized in that, Including the steps: Analyze the global and local feature saliency distributions of the circuit board image, extract key features therefrom, and generate a dynamic scale factor; Based on the dynamic scale factor and regional saliency differences, construct a regional association graph to guide focus switching; Based on the regional association graph, dynamically select the feature extraction path; Integrate the features extracted by the dynamic path according to the association graph to generate a defect probability distribution map to identify defects.
2. The method for comparing and analyzing the appearance of a circuit board image based on a large model according to claim 1, wherein, Obtain the dynamic scale factor, which specifically includes the following: The key features include the global edge complexity index and the local texture difference index ; Integrate the global edge complexity index and the local texture difference index to guide the large model to adaptively adjust the analysis strategy according to the image features. The calculation formula of the dynamic scale factor is as follows: , wherein and are the weights of the global edge complexity index and the local texture difference index, respectively.
3. A method for comparing and analyzing the appearance of a circuit board image based on a large model according to claim 2, characterized in that, The calculation of the global edge complexity index is divided into the following steps: First, apply the Canny edge detection algorithm to the input circuit board image to generate a binary edge image ; The global edge density is defined as: , Among them, and represent the height and width of the circuit board image; represents the pixel value in the edge image; combined with the edge density and edge connectivity, the global edge complexity index is calculated as: , Among them, represents the number of connected components in the edge image.
4. A method for comparing and analyzing the appearance of a circuit board image based on a large model according to claim 2, characterized in that, The calculation of the local texture difference index is divided into the following steps: Divide the input circuit board image into grids, where each grid corresponds to an area. For each area, calculate the texture contrast using the contrast index of the gray-level co-occurrence matrix : , Among them, represents the gray-level co-occurrence matrix element of the region , indicating the probability of the gray level and being adjacent; combining the statistical characteristics of the contrast of all regions, calculate the local texture difference index: , Among them, represents the variance of all texture contrasts; represents the standard deviation of texture contrast; represents the maximum contrast value in all regions; represents the mean of all texture contrasts.
5. The method for comparing and analyzing the appearance of a circuit board image based on a large model according to claim 4, wherein The process of constructing the regional association graph is as follows: After dividing the regions and extracting features, for any two adjacent regions and , calculate the difference in their significant features, denoted as , and the calculation formula is . In the formula,[[]] and are the local texture contrasts of regions and respectively; meanwhile, consider the spatial distance , defined as the Euclidean distance between the central points of the two regions.
6. A method for appearance comparison and analysis of circuit board images based on a large model according to claim 5, characterized in that: Comprehensive significant difference , spatial distance and dynamic scale factor , calculate the similarity measure between regions: , Among them, and are normalization factors, which respectively take the mean values of the significant differences and spatial distances of all adjacent region pairs, and are used to standardize the effects of feature differences and distances; , is the maximum distance between any two regions in the image, representing the global spatial correlation; , representing the similarity of local features; Construct an undirected graph based on the calculated similarity As a region association graph, where the vertex set corresponds to all regions , and the edge set connects adjacent regions, and the weight of the edge is set to the similarity.
7. A method for appearance comparison and analysis of circuit board images based on a large model according to claim 6, characterized in that: Based on the regional association graph, dynamically select the feature extraction path, and the specific processing process is as follows: A. Through the convolution path processing in parallel with the global convolution path and the local convolution path, generate independent feature maps respectively; B. Dynamically select the output using which path according to the connection strength of the regional association graph, quantify the feature extraction requirements of each region based on the regional association graph, and calculate its average connection strength : , Among them, represents the number of neighbor regions directly connected to region ; represents the connection strength between region and neighbor region ; represents the set of regions adjacent to region . For each region, compare the average connection strength with the global threshold: If the average connection strength is greater than the global threshold, select the global convolution path; if the average connection strength is less than or equal to the global threshold, select the local convolution path.
8. A method for appearance comparison and analysis of circuit board images based on a large model according to claim 7, characterized in that: C. According to the selection result, extract features from the corresponding convolution path for each region; finally, splice the feature maps of all regions into a complete feature map.
9. The method for comparing and analyzing the appearance of a circuit board image based on a large model according to claim 8, characterized in that, The process of obtaining the defect probability distribution map is: Calculate the dynamic weighting factor for each region according to the connection strength of the regional association graph. The dynamic weighting factor is obtained by multiplying the average connection strength by the exponential decay term of the saliency entropy and then performing normalization processing; After obtaining the dynamic weighting factor, adaptively fuse the global and local features of each region; The fused feature consists of a linear combination of the weighted global feature, the weighted local feature, and the mutual information enhancement term; The fused feature map is input into the defect detection network to generate a defect probability distribution map; through multi-scale feature integration and hybrid loss optimization, generate a defect probability distribution map; Perform post-processing on the defect probability distribution map to identify the specific location and type of the defect.
10. A circuit board image appearance comparison and analysis system based on a large model, which is used to implement a circuit board image appearance comparison and analysis method according to any one of claims 1-9, characterized in that, Including: A feature analysis module, an association regulation module, a path optimization module, and a defect localization module; Feature analysis module: By analyzing the global and local feature saliency distributions of the circuit board image, extract key features and generate a dynamic scale factor; Association regulation module: Utilize the dynamic scale factor and regional saliency differences to construct a regional association graph, dynamically regulate focus switching, and enhance the correlation between regions; Path optimization module: Based on the regional association graph, dynamically select the optimal feature extraction path to improve the detection accuracy and efficiency; Defect localization module: Integrate the features extracted by the dynamic path according to the association graph to generate a defect probability distribution map, and accurately identify the defect location and type.
Citation Information
Cited By
Defect hotspot detection method based on two-dimensional contour extraction
CN120931568A
Defect hotspot detection method based on two-dimensional profile extraction
CN120931568B