A PCB adaptive detection system and method based on a causal topology
Patent Information
- Application Number
- CN202610871368.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-16
- Publication Date
- 2026-09-25
AI Technical Summary
[0005]针对上述缺陷,本发明的目的在于提出一种基于因果拓扑的PCB自适应检测系统及方法,解决因PCB板材质导致检测图像收到环境影响,导致无法稳定识别缺陷的问题
[0015]上述技术方案中的一个技术方案具有如下优点或有益效果:第一、因果解耦彻底打破了缺陷识别结果与成像环境之间的特征耦合,使模型在不同批次、不同材质、不同环境光干扰下均能稳定提取缺陷的几何本质特征,误报率和漏检率不再随工况波动;第二、基于拓扑图的空间对齐和结构匹配,大幅降低了对像素级纹理一致性的依赖,从而克服了紫外光非均匀明暗波动带来的虚假响应;第三、多级决策融合模块根据材质反射特性动态分配权重,使得系统在面对铜箔厚度变化或阻焊层反射率差异时能够自适应地选择最可靠的成像模态,显著提升了检测的鲁棒性和泛化能力。
Smart Images

Figure CN122820568A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of PCB board inspection technology, and in particular to an adaptive PCB inspection system and method based on causal topology. Background Technology
[0002] Printed circuit boards (PCBs), as the core carrier of modern electronic information products, directly affect the electrical performance and operational reliability of the entire device due to their manufacturing process quality. As electronic devices evolve towards miniaturization and high integration, the density of circuit layouts continues to increase, placing extremely high demands on defect detection during the manufacturing process. Current industrial production typically employs a two-stage screening architecture combining automated optical inspection and virtual rescanning technology. This process first uses optical inspection equipment for preliminary scanning to locate suspected defects. Then, rescanning equipment acquires multimodal images, including visible light, ultraviolet light, and reference design vector graphics. A deep learning model is then used for secondary judgment, thereby achieving defect classification and verification.
[0003] However, existing visual inspection technologies still face significant technical bottlenecks when dealing with complex and ever-changing production environments. First, current discrimination models heavily rely on pixel-level texture feature representation, leading to severe feature coupling between defect identification results and the imaging environment. In actual production, different batches of circuit boards naturally differ in substrate material, copper foil thickness, and solder mask reflectivity, and ultraviolet imaging is easily affected by ambient light, resulting in non-uniform brightness fluctuations. This inconsistency in imaging makes it difficult for the model to accurately decouple the essential geometric features of defects from complex backgrounds, causing the system to be extremely sensitive to changes in illumination, and making it difficult to maintain stable false alarm and false negative rates under various operating conditions.
[0004] More importantly, the distribution of defects on printed circuit boards exhibits a typical long-tail characteristic. While samples of common defects such as open circuits and short circuits are relatively abundant, samples of rare defects caused by occasional fluctuations in specific processes are extremely scarce. Traditional discrimination architectures lack a closed-loop mechanism for online adaptation and self-learning, making it impossible to update knowledge in real time for newly emerging anomalies during production. This results in the system's long-term low accuracy in identifying rare defects. This reliance on massive amounts of labeled data and the static learning model has become a major obstacle restricting the evolution of printed circuit board inspection towards high intelligence. Summary of the Invention
[0005] To address the aforementioned shortcomings, the present invention aims to propose a PCB adaptive inspection system and method based on causal topology, which solves the problem that the inspection image is affected by the environment due to the PCB material, resulting in the inability to stably identify defects.
[0006] To achieve this objective, the present invention adopts the following technical solution: a PCB adaptive inspection method based on causal topology, comprising the following steps: Step S1: Obtain the original image of the PCB board, use a causal encoder to decouple the features of the original image, separate the environmental confounding factors from the essential structural features, and obtain the first image; Image enhancement is performed on the first image based on the material of the PCB board to obtain the second image; Step S2: Generate a first feature topology map based on the second image; spatially align the first feature topology map with the second feature topology map of the standard PCB board, input the spatially aligned second image into the modal perceptron, and output the preliminary confidence score; Step S3: For locations with an initial confidence level below the threshold, mark them as processing locations. Use a multi-level decision fusion module to integrate multimodal perception results, dynamically allocate weights based on material reflection characteristics, and output the defect category and refined geometric contour of the processing location.
[0007] Preferably, the causal encoder representation of the first image obtained in step S1 is as follows: ; in An imaging mapping function is used to represent the generation relationship of the original image during the physical imaging process, which is influenced by both structural and environmental features. To observe random noise, These are environmental confounding factors and essential structural characteristics, respectively.
[0008] Preferably, the step of acquiring the second image in step S1 is as follows: Step S11: Based on the material of the PCB board, find the corresponding brightness compensation gain G in the preset compensation table, and calculate and obtain the mean and variance in the first image; The first image is normalized using the brightness compensation gain G, mean, and variance to obtain the perceived image; The formula for obtaining the perceived image is expressed as follows: B is the base grayscale value. , These are the mean and variance, respectively. For essential structural features in perceived images, the Laplacian operator is used. Nonlinear enhancement is performed to obtain the second image; The formula for nonlinearly enhancing the essential structural features is expressed as follows: , This is the proportionality coefficient.
[0009] Preferably, before performing space alignment in step S2, the following steps also need to be performed: Obtain the similarity between the first feature topology graph and the second topology graph, and determine whether the similarity is greater than a first similarity threshold. If it is less than the first similarity threshold, an error is reported; if it is greater than the first similarity threshold, a spatial alignment operation is performed.
[0010] Preferably, during spatial alignment, sub-pixel-level spatial alignment between the first feature topology map and the second topology map is achieved by solving for the minimum value of the following energy functional: ; in For space operators, , These are the i-th nodes of the first and second topological graphs, respectively. For the total number of nodes, Smoothing constraint coefficient This is the displacement field smoothing term.
[0011] Preferably, before executing step S3, the following step also needs to be performed: determine whether the similarity is less than a second similarity threshold, wherein the second similarity threshold is greater than a first similarity threshold; if the similarity is less than the second similarity threshold, Then perform the following steps: Initiate an improved generative adversarial architecture, using the original image as a seed for the defective image. And simulate physical perturbations within the potential space, generating virtual augmented samples through a generator. ; The training loss function LG of the generator is defined as follows: ; in, This represents the expected value of the seed distribution. To counter network architecture, This is the adverse loss term.
[0012] Preferably, the steps for obtaining the processing location are as follows: Step S31: Based on the preliminary confidence results, select the search range and the ideal edge corresponding to the standard PCB board. ; Step S32: With the ideal edge As a priori guiding force, an evolutionary energy functional containing the aforementioned priori guiding force constraint terms is constructed: ;in These are the scaling factors, The contour curve of the second image; ; By solving for the minimum value of the evolutionary energy functional, the contour curve C(s) is driven to shrink and align towards the physical boundary of the defect, thereby achieving contour extraction with sub-pixel accuracy and outputting processing position information and geometric shape. The shrinkage of the contour curve C(s) is shown below: ; Among them radius of curvature Let v be the normal vector, and v be a preset constant. For edge stopping function, For prior weights, This represents the spatial gradient.
[0013] Preferably, step S3 is as follows: Step S31: Obtain the preliminary confidence levels of different defects output by different modal sensor, and determine the physical reflection coefficient based on the PCB board material. ; Step S32: Based on the physical reflection coefficient, find the weight operator of the corresponding modal sensor in the preset weight table; The weighting operator is used to adjust the probabilities of different defects, and the initial execution degree of the adjusted defects is accumulated to obtain the global score of the defect. Step S33: Determine whether the highest confidence defect categories output by different modal perceptrons are consistent. If they are inconsistent, trigger the conflict resolution algorithm and output the defect category with higher physical prior weight as the type of defect identification. If they are consistent, determine whether the scores of the highest and second highest global defect scores are greater than the threshold. If they are greater than the threshold, use the defect with the highest global defect score as the type of defect identification. If they are less than the threshold, trigger the conflict resolution algorithm and output the defect category with higher physical prior weight as the type of defect identification.
[0014] A PCB adaptive inspection system based on causal topology, using the aforementioned PCB adaptive inspection method based on causal topology, includes: The image processing module is used to acquire the original image of the PCB board, and to use a causal encoder to decouple the features of the original image, separating environmental confounding factors from essential structural features to obtain the first image. Image enhancement is performed on the first image based on the material of the PCB board to obtain the second image; Alignment module, used to generate a first feature topology map based on the second image; Spatially align the first feature topology map with the second feature topology map of the standard PCB board, input the spatially aligned second image into the modal perceptron, and output the preliminary confidence score. The judgment and identification module is used to mark the locations with an initial confidence level below the threshold as processing locations. The multi-level decision fusion module integrates the multimodal perception results, dynamically allocates weights based on the material reflection characteristics, and outputs the defect category and refined geometric contour of the processing location.
[0015] One of the above technical solutions has the following advantages or beneficial effects: First, causal decoupling completely breaks the feature coupling between defect identification results and imaging environment, enabling the model to stably extract the geometric essential features of defects under different batches, different materials, and different ambient light interference, and the false alarm rate and false negative rate no longer fluctuate with the working conditions; Second, based on spatial alignment and structural matching of topology graph, the dependence on pixel-level texture consistency is greatly reduced, thereby overcoming the false response caused by non-uniform brightness fluctuations of ultraviolet light; Third, the multi-level decision fusion module dynamically allocates weights according to the material reflectivity, enabling the system to adaptively select the most reliable imaging modality when facing changes in copper foil thickness or differences in solder resist reflectivity, significantly improving the robustness and generalization ability of detection. Attached Figure Description
[0016] Figure 1 This is a flowchart of one embodiment of the method of the present invention.
[0017] Figure 2 This is a schematic diagram of the structure of one embodiment of the system of the present invention. Detailed Implementation
[0018] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0019] In the description of embodiments of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0020] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0021] like Figures 1-2 As shown, a PCB adaptive inspection method based on causal topology includes the following steps: Step S1: Obtain the original image of the PCB board, use a causal encoder to decouple the features of the original image, separate the environmental confounding factors from the essential structural features, and obtain the first image; Image enhancement is performed on the first image based on the material of the PCB board to obtain the second image; Step S2: Generate a first feature topology map based on the second image; spatially align the first feature topology map with the second feature topology map of the standard PCB board, input the spatially aligned second image into the modal perceptron, and output the preliminary confidence score; Step S3: For locations with an initial confidence level below the threshold, mark them as processing locations. Use a multi-level decision fusion module to integrate multimodal perception results, dynamically allocate weights based on material reflection characteristics, and output the defect category and refined geometric contour of the processing location.
[0022] Because the original image of the PCB board contains different colors, such as green, blue, and black paint, the reflectivity varies. This inconsistency in imaging makes it difficult for the model to accurately decouple the essential geometric features of defects from the complex background. This results in the system being extremely sensitive to changes in lighting, and the false alarm rate and false negative rate are difficult to maintain stable under various operating conditions. Therefore, in this invention, the original image is first input into a trained causal encoder. The convolutional neural network of the causal encoder decomposes the environmental confounding factors and essential structural features in the original image. The environmental confounding factors are separated from the original image to obtain a first image containing essential structural features. These essential structural features include physical contours such as circuit traces and pads. The first image does not contain environmental confounding factors. In subsequent recognition, only the physical contours of circuit traces and pads are judged and recognized, ensuring consistent perception sensitivity across various process materials.
[0023] Although the environmental noise factors affected by the layer color on the PCB board are removed, the metallic characteristics of the PCB board itself are still affected by the lighting environment. Therefore, after obtaining the first image, the first image is enhanced based on the material of the PCB board to obtain the second image and eliminate ambient light interference.
[0024] The second image is then converted into a topological graph. This topological graph uses Mark points and electronic components on the PCB board as nodes, and connections and spatial distribution as edges. The topological graph naturally possesses invariance to changes in illumination because the topological structure reflects the essential shape and relative position of defects rather than pixel grayscale. Spatially aligning the first feature topological graph with the second feature topological graph of a standard PCB board eliminates deviations caused by board deformation or placement angles. After alignment, the second image is input into a modal perceptron, a device capable of processing and fusing information from multiple sensor modalities. This device integrates multiple sensors and a trained deep learning model for outputting confidence scores. The modal perceptron obtains the probabilities (preliminary confidence scores) of different defect categories under different modalities, such as the probabilities of different defects under conventional visual modality, infrared visual modality, or ultrasonic modality. Finally, weights are dynamically assigned based on material reflectivity to output the defect category and refined geometric contour at the processing location.
[0025] The advantages of this invention are as follows: First, causal decoupling completely breaks the feature coupling between defect identification results and imaging environment, enabling the model to stably extract the geometric essential features of defects under different batches, different materials, and different ambient light interference, and the false alarm rate and false negative rate no longer fluctuate with the working conditions; Second, based on spatial alignment and structural matching of topology graph, the dependence on pixel-level texture consistency is greatly reduced, thereby overcoming the false response caused by non-uniform brightness fluctuations of ultraviolet light; Third, the multi-level decision fusion module dynamically allocates weights according to the material reflectivity, enabling the system to adaptively select the most reliable imaging mode when facing changes in copper foil thickness or differences in solder resist reflectivity, significantly improving the robustness and generalization ability of detection.
[0026] Preferably, the causal encoder representation of the first image obtained in step S1 is as follows: ; in An imaging mapping function is used to represent the generation relationship of the original image during the physical imaging process, which is influenced by both structural and environmental features. To observe random noise, These are environmental confounding factors and essential structural characteristics, respectively.
[0027] Preferably, the step of acquiring the second image in step S1 is as follows: Step S11: Based on the material of the PCB board, find the corresponding brightness compensation gain G in the preset compensation table, and calculate and obtain the mean and variance in the first image; The first image is normalized using the brightness compensation gain G, mean, and variance to obtain the perceived image; The formula for obtaining the perceived image is expressed as follows: B is the base grayscale value. , These are the mean and variance, respectively. In this invention, different PCB board materials will have a corresponding brightness compensation gain G set in the corresponding preset compensation table. The first image cancels the environmental interference through the brightness compensation gain G corresponding to the board material and generates the corresponding perception image. In the process of generating the perception image, a reference gray value will also be added. Its function is to uniformly shift the brightness distribution of different color substrates to the standard gray range to avoid features being too dark or too bright.
[0028] For essential structural features in perceived images, the Laplacian operator is used. Nonlinear enhancement is performed to obtain the second image; The formula for nonlinearly enhancing the essential structural features is expressed as follows: , This is the proportionality coefficient.
[0029] The essential structural features in the perceived image are nonlinearly enhanced using the Laplacian operator. The scaling factor in the formula controls the enhancement intensity, and the second-derivative operator highlights geometric abrupt changes at the edges of lines and defect boundaries while suppressing flat background areas. Compared to linear filtering, this nonlinear enhancement preserves the fine geometric contours of defects better. Furthermore, because the enhancement operation is applied to an image that has already undergone material normalization, it avoids the overshoot or false edge problems caused by the coupling between enhancement and material reflectivity in traditional methods.
[0030] Preferably, before performing space alignment in step S2, the following steps also need to be performed: Obtain the similarity between the first feature topology graph and the second topology graph, and determine whether the similarity is greater than a first similarity threshold. If it is less than the first similarity threshold, an error is reported; if it is greater than the first similarity threshold, a spatial alignment operation is performed.
[0031] Before aligning the first and second topology maps, a conventional similarity score can be used to indicate whether their structures are similar. If the similarity is less than the first similarity threshold (60%), the PCB board being photographed may not be the PCB board being detected, but rather another type of PCB board mixed into the detection. Therefore, an error needs to be reported and manually intervened. If the similarity is greater than the first similarity threshold, subsequent spatial alignment can be performed.
[0032] Preferably, during spatial alignment, sub-pixel-level spatial alignment between the first feature topology map and the second topology map is achieved by solving for the minimum value of the following energy functional: ; in For space operators, , These are the i-th nodes of the first and second topological graphs, respectively. For the total number of nodes, Smoothing constraint coefficient This is the displacement field smoothing term.
[0033] 6. The PCB adaptive detection method based on causal topology according to claim 4, characterized in that, before executing step S3, the following steps are also required: determining whether the similarity is less than a second similarity threshold, wherein the second similarity threshold is greater than a first similarity threshold; if the similarity is less than the second similarity threshold, it indicates that the matched PCB board is very likely to be a defective PCB board. To address the lack of existing defect templates, the present invention will perform the following steps: Then perform the following steps: Initiate an improved generative adversarial architecture, using the original image as a seed for the defective image. And simulate physical perturbations within the potential space, generating virtual augmented samples through a generator. ; The training loss function LG of the generator is defined as follows: ; in, This represents the expected value of the seed distribution. To counter network architecture, This is the adversarial loss term. Its function is to drive the generator to continuously improve the realism of the generated images, so that they can logically "deceive" the discriminator. For content constraints, use The difference between the norm calculation-generated graph and the original seed graph ensures that the generated virtual defects do not deviate from the essential form of the defect image seed in terms of geometric features; This is a weight balancing operator used to dynamically adjust the ratio between the "realism" and "form similarity" of an image. It generates virtual augmented samples. It will automatically feed back into the existing decision operator library for incremental training, and virtually augment the samples in subsequent decisions. It can also be used as a sample in the initial confidence level matching judgment, enabling the learning of newly emerging rare defects to be completed in a very short time. This closed-loop mechanism solves the problem of the difficulty in obtaining rare samples in industrial fields, and significantly improves the system's online adaptive capability.
[0034] Preferably, the steps for obtaining the processing location are as follows: Step S31: Based on the preliminary confidence results, select the search range and the ideal edge corresponding to the standard PCB board. ; Step S32: With the ideal edge As a priori guiding force, an evolutionary energy functional containing the aforementioned priori guiding force constraint terms is constructed: ;in These are the scaling factors, The contour curve of the second image; ; When locating the processing position, the approximate location of the defect is first determined using the results of the preceding classification, thus limiting the contour search range to a smaller region of interest. This avoids computational redundancy and mismatches caused by global search. Furthermore, when calculating the evolutionary energy functional, [the following is added]... As a priori guiding force constraint, it is used to constrain the evolution path of the physical boundary constraint curve provided by the design drawing, and to constrain the actual evolution profile curve C(s) in real time so that it does not deviate too far from the ideal boundary.
[0035] By solving for the minimum value of the evolutionary energy functional, the contour curve C(s) is driven to shrink and align towards the physical boundary of the defect, thereby achieving contour extraction with sub-pixel accuracy and outputting processing position information and geometric shape. The shrinkage of the contour curve C(s) is shown below: ; Among them radius of curvature Let v be the normal vector, and v be a preset constant. For edge stopping function, For prior weights, This represents the spatial gradient.
[0036] Taking the detection of "excess copper" defects in circuits as an example, the system first initializes a closed initial curve outside the area with excess copper foil based on the preliminary judgment. Then, it drives this curve to evolve automatically inwards. During the evolution process, the formula... The term provides the power for smooth contraction, while the newly introduced This prevents the curve from accidentally entering the normal circuit area during contraction. The edge-stop function stops when the curve moves to the actual physical edge beyond the copper foil. With image gradient term This creates a balance, allowing the curve to be precisely positioned at the edge of the defect. Ultimately, the output is a smooth and realistic geometric profile.
[0037] Preferably, step S3 is as follows: Step S31: Obtain the preliminary confidence levels of different defects output by different modal sensor, and determine the physical reflection coefficient based on the PCB board material. ; Step S32: Based on the physical reflection coefficient, find the weight operator of the corresponding modal sensor in the preset weight table; The weighting operator is used to adjust the probabilities of different defects, and the initial execution degree of the adjusted defects is accumulated to obtain the global score of the defect. Step S33: Determine whether the highest confidence defect categories output by different modal perceptrons are consistent. If they are inconsistent, trigger the conflict resolution algorithm and output the defect category with higher physical prior weight as the type of defect identification. If they are consistent, determine whether the scores of the highest and second highest global defect scores are greater than the threshold. If they are greater than the threshold, use the defect with the highest global defect score as the type of defect identification. If they are less than the threshold, trigger the conflict resolution algorithm and output the defect category with higher physical prior weight as the type of defect identification.
[0038] Specifically, the formula for calculating the global defect score is as follows: ,in For weight operators, Let be the confidence level of the m-th modal perceptron output for defect type l.
[0039] After obtaining the global defect score, the system first determines whether the defect categories corresponding to the highest global defect scores output by different modal perceptrons are consistent. If they are consistent, the system is initially reliable, but it is still necessary to determine whether the difference between the highest and second-highest scores is greater than a preset threshold. If it is, the defect category corresponding to the highest score is directly output. If the difference is not greater than the threshold (i.e., the scores of the two defect categories are close), a conflict resolution algorithm is triggered, outputting the defect category with higher physical prior weight. If the highest-scoring defect categories output by each modality are inconsistent, a conflict resolution algorithm, such as the existing Bayesian inference algorithm, is also triggered. Finally, the types of defects identified in this study are obtained.
[0040] The following is an example: For example, defect categories include cracks, pores, and inclusions; In this embodiment, there are two modal sensors, namely modal sensor A (ordinary image vision module) and modal sensor B (infrared vision module). The modal sensor A outputs confidence levels for cracks, pores, and inclusions, yielding confidence levels of 0.7, 0.2, and 0.1, respectively.
[0041] The modal sensor B outputs confidence levels for cracks, pores, and inclusions, obtaining confidence levels of 0.4, 0.5, and 0.1, respectively.
[0042] Since the highest confidence level in modal perceptron A is for crack defects, while the highest confidence level in modal perceptron B is for porosity defects, there is no need to use the global defect score. Instead, the type of defect identified in this instance can be determined directly through the conflict resolution algorithm.
[0043] If the modal sensor A outputs confidence levels for cracks, pores, and inclusions, respectively, confidence levels of 0.7, 0.2, and 0.1 are obtained.
[0044] The modal sensor B outputs confidence levels for cracks, pores, and inclusions, obtaining confidence levels of 0.6, 0.5, and 0.1, respectively.
[0045] At this point, based on the PCB board material, the weight operators for the corresponding modal sensors are determined to be 0.7 for modal sensor A and 0.3 for modal sensor B.
[0046] Therefore, the global defect score for the crack defect is 0.7. 0.7 + 0.6 0.3 = 0.67, while the global score for porosity defects is 0.2. 0.7 + 0.5 0.3 = 0.29. At this point, the difference between the highest global score of the trap and the second highest global score of the defect is 0.67 - 0.29 = 0.38, which is much greater than the threshold of 0.2. Therefore, the crack is directly used as the type of defect to be identified in this case.
[0047] A PCB adaptive inspection system based on causal topology, using the PCB adaptive inspection method based on causal topology described above, includes: The image processing module is used to acquire the original image of the PCB board, and to use a causal encoder to decouple the features of the original image, separating environmental confounding factors from essential structural features to obtain the first image. Image enhancement is performed on the first image based on the material of the PCB board to obtain the second image; Alignment module, used to generate a first feature topology map based on the second image; Spatially align the first feature topology map with the second feature topology map of the standard PCB board, input the spatially aligned second image into the modal perceptron, and output the preliminary confidence score. The judgment and identification module is used to mark the locations with an initial confidence level below the threshold as processing locations. The multi-level decision fusion module integrates the multimodal perception results, dynamically allocates weights based on the material reflection characteristics, and outputs the defect category and refined geometric contour of the processing location.
[0048] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0049] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A PCB adaptive inspection method based on causal topology, characterized in that, Includes the following steps: Step S1: Obtain the original image of the PCB board, use a causal encoder to decouple the features of the original image, separate the environmental confounding factors from the essential structural features, and obtain the first image; Image enhancement is performed on the first image based on the material of the PCB board to obtain the second image; Step S2: Generate a first feature topology map based on the second image; Spatially align the first feature topology map with the second feature topology map of the standard PCB board, input the spatially aligned second image into the modal perceptron, and output the preliminary confidence score. Step S3: For locations with an initial confidence level below the threshold, mark them as processing locations. Use a multi-level decision fusion module to integrate multimodal perception results, dynamically allocate weights based on material reflection characteristics, and output the defect category and refined geometric contour of the processing location.
2. The PCB adaptive inspection method based on causal topology according to claim 1, characterized in that, The causal encoder representation of the first image obtained in step S1 is shown below: ; in An imaging mapping function is used to represent the generation relationship of the original image during the physical imaging process, which is influenced by both structural and environmental features. To observe random noise, These are environmental confounding factors and essential structural characteristics, respectively.
3. The PCB adaptive inspection method based on causal topology according to claim 1, characterized in that, The steps for obtaining the second image in step S1 are as follows: Step S11: Based on the material of the PCB board, find the corresponding brightness compensation gain G in the preset compensation table, and calculate and obtain the mean and variance in the first image; The first image is normalized using the brightness compensation gain G, mean, and variance to obtain the perceived image; The formula for obtaining the perceived image is expressed as follows: B is the base grayscale value. , These are the mean and variance, respectively. For essential structural features in perceived images, the Laplacian operator is used. Nonlinear enhancement is performed to obtain the second image; The formula for nonlinearly enhancing the essential structural features is expressed as follows: , This is the proportionality coefficient.
4. The PCB adaptive inspection method based on causal topology according to claim 1, characterized in that, Before performing space alignment in step S2, the following steps also need to be performed: Obtain the similarity between the first feature topology graph and the second topology graph, and determine whether the similarity is greater than a first similarity threshold. If it is less than the first similarity threshold, an error is reported; if it is greater than the first similarity threshold, a spatial alignment operation is performed.
5. The PCB adaptive inspection method based on causal topology according to claim 4, characterized in that, During spatial alignment, sub-pixel-level spatial alignment between the first feature topology map and the second topology map is achieved by solving for the minimum value of the following energy functional: ; in For space operators, , These are the i-th nodes of the first and second topological graphs, respectively. For the total number of nodes, Smoothing constraint coefficient This is the displacement field smoothing term.
6. The PCB adaptive inspection method based on causal topology according to claim 4, characterized in that, Before executing step S3, the following steps also need to be performed: determine whether the similarity is less than the second similarity threshold, where the second similarity threshold is greater than the first similarity threshold. If the similarity is less than the second similarity threshold, Then perform the following steps: Initiate an improved generative adversarial architecture, using the original image as a seed for the defective image. And simulate physical perturbations within the potential space, generating virtual augmented samples through a generator. ; The training loss function LG of the generator is defined as follows: ; in, This represents the expected value of the seed distribution. To counter network architecture, This is an adversarial loss term.
7. The PCB adaptive inspection method based on causal topology according to claim 1, characterized in that, The steps for obtaining the processing location are as follows: Step S31: Based on the preliminary confidence results, select the search range and the ideal edge corresponding to the standard PCB board. ; Step S32: With the ideal edge As a priori guiding force, an evolutionary energy functional containing the aforementioned priori guiding force constraint terms is constructed: ;in These are the scaling factors, The contour curve of the second image; ; By solving for the minimum value of the evolutionary energy functional, the contour curve C(s) is driven to shrink and align towards the physical boundary of the defect, thereby achieving contour extraction with sub-pixel accuracy and outputting processing position information and geometric shape. The shrinkage of the contour curve C(s) is shown below: ; Among them radius of curvature Let v be the normal vector, and v be a preset constant. For edge stopping function, For prior weights, This represents the spatial gradient.
8. The PCB adaptive inspection method based on causal topology according to claim 1, characterized in that, The steps in step S3 are as follows: Step S31: Obtain the preliminary confidence levels of different defects output by different modal sensor, and determine the physical reflection coefficient based on the PCB board material. ; Step S32: Based on the physical reflection coefficient, find the weight operator of the corresponding modal sensor in the preset weight table; The weighting operator is used to adjust the probabilities of different defects, and the initial execution degree of the adjusted defects is accumulated to obtain the global score of the defect. Step S33: Determine whether the highest confidence defect categories output by different modal perceptrons are consistent. If they are inconsistent, trigger the conflict resolution algorithm and output the defect category with higher physical prior weight as the type of defect identification. If they are consistent, determine whether the scores of the highest and second highest global defect scores are greater than the threshold. If they are greater than the threshold, use the defect with the highest global defect score as the type of defect identification. If they are less than the threshold, trigger the conflict resolution algorithm and output the defect category with higher physical prior weight as the type of defect identification.
9. A PCB adaptive inspection system based on causal topology, using the PCB adaptive inspection method based on causal topology as described in any one of claims 1 to 8, characterized in that, include: The image processing module is used to acquire the original image of the PCB board, and to use a causal encoder to decouple the features of the original image, separating environmental confounding factors from essential structural features to obtain the first image. Image enhancement is performed on the first image based on the material of the PCB board to obtain the second image; Alignment module, used to generate a first feature topology map based on the second image; Spatially align the first feature topology map with the second feature topology map of the standard PCB board, input the spatially aligned second image into the modal perceptron, and output the preliminary confidence score. The judgment and identification module is used to mark the locations with an initial confidence level below the threshold as processing locations. The multi-level decision fusion module integrates the multimodal perception results, dynamically allocates weights based on the material reflection characteristics, and outputs the defect category and refined geometric contour of the processing location.