A Deep Learning-Based Method for Defect Feature Recognition of Circuit Board Assemblies

By generating spatially topologically aligned prior density tensors and contrast excitation masks, the problem of unstable identification of minute defects in the detection of highly reflective metal components by deep learning models is solved, and efficient defect feature extraction and identification are achieved.

CN122265748BActive Publication Date: 2026-07-31HUNAN AVIONICS XINTONG TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN AVIONICS XINTONG TECHNOLOGY CO LTD
Filing Date
2026-05-27
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing deep learning models struggle to effectively distinguish between deterministic physical reflections and random defect interference in the optical inspection of highly reflective metal components, resulting in poor stability in identifying minute defects. Furthermore, existing improved methods are prone to introducing identification risks and lacking generalization ability.

Method used

By acquiring image data and spatial topology design data of circuit board assemblies, a prior density tensor with spatial topology alignment is generated. Local standard deviation is calculated using a sliding window and a contrast excitation mask is generated to suppress high-reflection artifact components and enhance the feature tensor. Combined with contrast-aware constraints, a deep neural network is trained to achieve defect recognition.

Benefits of technology

It improves the stability and accuracy of defect identification under highly reflective backgrounds, enhances the adaptability to complex optical environments, reduces the false alarm rate, and improves the defect recall rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122265748B_ABST
    Figure CN122265748B_ABST
Patent Text Reader

Abstract

This invention relates to the field of image recognition technology and discloses a method for identifying defect features of circuit board components based on deep learning. The method includes: acquiring image data of the target to be detected and extracting feature tensors; reading spatial topology design data and projecting geometric wiring onto the feature tensor coordinate space to generate a spatially topology-aligned prior density tensor; applying a nonlinear damping penalty to the local standard deviation based on its numerical distribution to generate a contrast excitation mask; using the mask to correct the feature tensor, suppressing high-reflectivity artifact components and enhancing edge features, and outputting an enhanced feature tensor to identify defects. This invention couples physical design priors with visual features, suppresses physical artifacts generated by metal reflection, compensates for small edge signals, and maintains the constancy of feature expression across different lighting conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for identifying defect features of circuit board components based on deep learning, belonging to the field of image recognition technology. Background Technology

[0002] Currently, surface defect detection of circuit board assemblies generally adopts optical recognition technology based on convolutional neural networks, which uses deep neural networks to extract image features for the classification and localization of defect areas.

[0003] In the optical inspection of highly reflective metal components, fluctuations in ambient light and the reflective properties of the metal surface cause drastic changes in contrast in local areas. Because existing deep learning models lack awareness of the physical design structure, they tend to use global statistical characteristics to balance image contrast. This leads to signal degradation of minute defect features during the feature extraction process of deep networks. Furthermore, this type of data-driven feature extraction logic struggles to build a stable discrimination mechanism between strong reflection interference and weak defect boundaries, reducing the stability of micron-level defect identification. For example, Chinese invention patent application CN113822882A discloses a deep learning-based method and device for detecting surface defects on circuit boards. It acquires images from different angles using multiple cameras at intervals, calculates sharpness using the Laplacian operator to generate a super-depth-of-field image, and then feeds it into an improved... While the Faster R-CNN model for detection has made breakthroughs in multi-dimensional data acquisition and image enhancement, it is essentially a data-driven approach. There is a logical disconnect between the feature extraction logic and the prior knowledge of the circuit board component topology design. Existing technologies rely on supervised learning using labeled samples. When faced with complex metal topology distributions, the model cannot distinguish between deterministic physical reflections and random defect interference. Common improvement directions focus on adjusting the optical acquisition environment or increasing network depth. Although such attempts can improve the apparent performance in specific scenarios, they often introduce additional recognition risks due to the synchronous amplification of sensor noise because they do not address the fundamental contradiction between design data and pixel feature tensors. Furthermore, the linear approach of increasing computational overhead to improve detection accuracy is prone to being constrained by low model convergence efficiency and lack of generalization ability when faced with complex metal topology distributions.

[0004] Therefore, how to construct the mapping relationship between visual feature tensors and computer-aided design wiring data, hereinafter referred to as CAD data topological constraints, in order to solve the problems of feature contrast degradation and loss of small defect signals under highly reflective backgrounds, has become the technical problem to be solved by this invention. Summary of the Invention

[0005] To address the problems mentioned in the background art, the technical solution of the present invention is as follows: A method for identifying defect features of circuit board components based on deep learning, comprising the following steps:

[0006] Step S1: Obtain image data of the target to be detected and extract the feature tensor of the image data in the deep neural network;

[0007] Step S2: Read the spatial topology design data corresponding to the target to be detected, and project the geometric wiring and reference structure in the spatial topology design data to the coordinate space of the feature tensor through discretized grid mapping to generate the prior density tensor of spatial topology alignment.

[0008] Step S3: Use a sliding window to traverse the feature tensors, calculate the local standard deviation of the feature tensors within the sliding window, and determine the gain weight based on the value of the prior density tensor within the sliding window. Apply the gain weight to the local standard deviation to generate a contrast excitation mask. The gain weight is negatively correlated with the value of the prior density tensor, and the gain weight decreases according to a preset exponential function as the value of the prior density tensor increases.

[0009] Step S4: Using the prior density tensor as a spatial distribution constraint, the feature tensor is modified element-wise by contrast excitation mask to suppress the activation intensity of high-reflection artifact components and compensate for the response amplitude of edge feature components, and the enhanced feature tensor is output.

[0010] Step S5: Input the enhanced feature tensor into the classification prediction layer, extract the semantic features representing geometric anomalies from the enhanced feature tensor, and output the defect identification result.

[0011] Preferably, in step S2, the spatial coordinate set of the geometric wiring and the reference structure is converted into a wiring density function, and the wiring density function is resampled according to the geometric transformation parameters of the image data during sampling, so that the generated prior density tensor and the feature tensor are aligned at the pixel level in spatial location.

[0012] Preferably, in step S3, the determination of the gain weight follows the calculation rules below: ,in, For the gain weights at coordinates i,j in the corresponding feature tensor; λ represents the value of the prior density tensor at coordinates i,j; λ is the preset damping coefficient; the gain weight is used to multiply the local standard deviation to reduce the response intensity of regions in the prior density tensor with values ​​greater than the preset threshold in the contrast excitation mask.

[0013] Preferably, in step S3, the process of generating the contrast excitation mask further includes: extracting the mean of the feature tensor within the sliding window, calculating the relative deviation between the feature tensor and the mean, and logically fusing the relative deviation with the local standard deviation after gain weight correction to generate a mask value representing local saliency.

[0014] Preferably, in step S4, the contrast excitation mask is multiplied element-wise with the feature tensor, and the physical artifact signal is stripped away by using the attenuation operator of the contrast excitation mask in the corresponding high-density prior region and the enhancement operator in the non-high-density prior region.

[0015] Preferably, the method further includes a training optimization phase, the steps of which include: integrating a contrast perception constraint term into the loss function of the deep neural network, and guiding the weights of the deep neural network to update in the direction of maximizing the mean difference by calculating the mean difference between the labeled defect region and its background neighborhood on the enhancement feature tensor.

[0016] Preferably, in step S5, the defect identification results include the identified reflection area boundaries, edge cracks, and geometric defects of the reference structure; during the identification process, the feature expression is maintained constant across the illumination fluctuation range by enhancing the feature tensor.

[0017] Preferably, in step S3, the damping coefficient The value is set based on the ambient illumination parameter of the image data, where the damping coefficient is... It is positively correlated with the ambient illuminance parameter.

[0018] Preferably, the process of generating the prior density tensor also includes encoding the material properties in the spatial topology design data and setting the component weights of the prior density tensor according to the physical reflectivity corresponding to different material properties, so as to distinguish the response differences of structures with different reflectivity in the feature space.

[0019] Preferably, in step S5, the deep semantic features enhanced by contrast are used to classify and locate defects, and the output is structured data containing defect category, coordinates and confidence level.

[0020] Compared with the prior art, the beneficial effects of the present invention are:

[0021] 1. In the identification of defect features of circuit board components, the computer-aided design wiring data corresponding to the circuit board component under test is obtained, and the spatial coordinate set of the metal layer geometric wiring and the pad component is mapped to the feature tensor space to generate a prior density tensor with spatial topology alignment. This deep coupling between physical prior and visual features enables the identification process to have the ability to perceive the design structure, breaks the blindness of the model to the physical properties of the processed object, and realizes the essential decoupling between the known design quantities and the unknown visual quantities.

[0022] 2. The local contrast factor generated during the sliding window traversal process, combined with the nonlinear damping term determined by the prior density tensor, constructs a spatial excitation mechanism with selective gain. This mechanism generates a suppression effect on the local standard deviation within a pre-determined strong reflection physical region, stripping away the high-frequency artifact gain caused by metal reflection, while maintaining a high activation weight in the edge region where real defects may exist, compensating for the signal attenuation of small features in the deep network.

[0023] 3. By utilizing the relative relationship between the mean and standard deviation within the local receptive field of the feature tensor, and in conjunction with topology density-driven adaptive modulation, the generated enhanced feature tensor is unaffected by global absolute illumination intensity. Under conditions of non-uniform light sources or fluctuating reflectivity of metal surfaces, the system maintains the constancy of defect feature expression due to the synergistic effect of damping penalty logic and local statistical characteristics, thereby enhancing the adaptability of the defect identification logic to complex optical environments. Attached Figure Description

[0024] Figure 1 This is a flowchart of the defect identification method that couples physical priors and visual features according to the present invention.

[0025] Figure 2 This is a logic diagram for training and optimizing a neural network that integrates contrast perception constraints, as described in this invention.

[0026] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0027] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0028] A method for identifying defect features in circuit board components based on deep learning includes the following steps:

[0029] Step S1: Obtain image data of the target to be detected and extract the feature tensor of the image data in the deep neural network;

[0030] Step S2: Read the spatial topology design data corresponding to the target to be detected, and project the geometric wiring and reference structure in the spatial topology design data to the coordinate space of the feature tensor through discretized grid mapping to generate the prior density tensor of spatial topology alignment.

[0031] Step S3: Use a sliding window to traverse the feature tensors, calculate the local standard deviation of the feature tensors within the sliding window, and determine the gain weight based on the value of the prior density tensor within the sliding window. Apply the gain weight to the local standard deviation to generate a contrast excitation mask. The gain weight is negatively correlated with the value of the prior density tensor, and the gain weight decreases according to a preset exponential function as the value of the prior density tensor increases.

[0032] Step S4: Using the prior density tensor as a spatial distribution constraint, the feature tensor is modified element-wise by contrast excitation mask to suppress the activation intensity of high-reflection artifact components and compensate for the response amplitude of edge feature components, and the enhanced feature tensor is output.

[0033] Step S5: Input the enhanced feature tensor into the classification prediction layer, extract the semantic features representing geometric anomalies from the enhanced feature tensor, and output the defect identification result.

[0034] Preferably, in step S2, the spatial coordinate set of the geometric wiring and the reference structure is converted into a wiring density function, and the wiring density function is resampled according to the geometric transformation parameters of the image data during sampling, so that the generated prior density tensor and the feature tensor are aligned at the pixel level in spatial location.

[0035] Preferably, in step S3, the determination of the gain weight follows the calculation rules below: ,in, For the gain weights at coordinates i,j in the corresponding feature tensor; λ represents the value of the prior density tensor at coordinates i,j; λ is the preset damping coefficient; the gain weight is used to multiply the local standard deviation to reduce the response intensity of regions in the prior density tensor with values ​​greater than the preset threshold in the contrast excitation mask.

[0036] Preferably, in step S3, the process of generating the contrast excitation mask further includes: extracting the mean of the feature tensor within the sliding window, calculating the relative deviation between the feature tensor and the mean, and logically fusing the relative deviation with the local standard deviation after gain weight correction to generate a mask value representing local saliency.

[0037] Preferably, in step S4, the contrast excitation mask is multiplied element-wise with the feature tensor, and the physical artifact signal is stripped away by using the attenuation operator of the contrast excitation mask in the corresponding high-density prior region and the enhancement operator in the non-high-density prior region.

[0038] Preferably, the method further includes a training optimization phase, the steps of which include: integrating a contrast perception constraint term into the loss function of the deep neural network, and guiding the weights of the deep neural network to update in the direction of maximizing the mean difference by calculating the mean difference between the labeled defect region and its background neighborhood on the enhancement feature tensor.

[0039] Preferably, in step S5, the defect identification results include the identified reflection area boundaries, edge cracks, and geometric defects of the reference structure; during the identification process, the feature expression is maintained constant across the illumination fluctuation range by enhancing the feature tensor.

[0040] Preferably, in step S3, the damping coefficient The value is set based on the ambient illumination parameter of the image data, where the damping coefficient is... It is positively correlated with the ambient illuminance parameter.

[0041] Preferably, the process of generating the prior density tensor also includes encoding the material properties in the spatial topology design data and setting the component weights of the prior density tensor according to the physical reflectivity corresponding to different material properties, so as to distinguish the response differences of structures with different reflectivity in the feature space.

[0042] Preferably, in step S5, the deep semantic features enhanced by contrast are used to classify and locate defects, and the output is structured data containing defect category, coordinates and confidence level.

[0043] Example 1: In the electronic component manufacturing environment at the end of a surface mount technology production line, when the inspection system is in the optical inspection condition of highly reflective metal components, the strong reflection of the metal surface causes local image contrast degradation, resulting in signal annihilation of originally micron-level defect edge features during the global feature extraction process of the deep neural network. To solve the problem of defect feature loss caused by the above-mentioned physical artifact interference, the processor constructs a feature reconstruction mechanism with design drawing awareness by coupling physical design priors with visual features. The system acquires the image data of the target to be inspected and extracts the feature tensor X of the image data in the deep neural network. The processor reads the spatial topology design data corresponding to the target to be inspected, that is, the computer-aided design wiring data corresponding to the circuit board component under test. Through discretized grid mapping, the geometric wiring in the spatial topology design data is compared with the reference structure. The prior density tensor D with spatial topology alignment is generated by projecting the geometric wiring and the reference structure into the coordinate space of the feature tensor X. In this process, the spatial coordinate set of the geometric wiring and the reference structure is converted into a wiring density function, and the wiring density function is resampled according to the geometric transformation parameters of the image data during sampling. This makes the generated prior density tensor D and the feature tensor X pixel-level aligned in spatial position. Four reference marker points are selected on the edge of the circuit board assembly, and the pixel coordinates of the reference marker points in the image data and the vector coordinates in the spatial topology design data are extracted. The affine transformation matrix between coordinates is calculated using the least squares method. The coordinate set of the geometric wiring and the reference structure is projected into a 512×512 discrete grid space to generate a binary distribution map. The binary distribution map is subjected to 8×8 average pooling to make the grid dimension after downsampling match the spatial dimension of the feature tensor X to generate the prior density tensor D.

[0044] The feature tensor X is traversed using a sliding window, and the local standard deviation σ of the feature tensor X within the sliding window is calculated. The sliding window is selected with a pixel size of 3×3 or 5×5 to match the local statistical feature distribution of micron-level defects. The processor determines the gain weight based on the value of the prior density tensor D within the sliding window. Gain weight The determination of follows the calculation rules below: ,in, For the gain weights at coordinates i,j in the corresponding feature tensor X; Let be the value of the prior density tensor D corresponding to coordinates i,j, which is used to characterize the deterministic metal coverage area ratio within the corresponding spatial grid; λ is the preset damping coefficient; the value of the damping coefficient λ is set according to the ambient illumination parameter of the image data, and the damping coefficient λ is positively correlated with the ambient illumination parameter, using gain weights. A product operation is performed on the local standard deviation σ to reduce the response intensity of regions in the prior density tensor D with values ​​greater than a preset threshold in the subsequently generated contrast excitation mask M. The activation amplitude of high-reflectivity regions under ambient illumination L is collected, and the damping coefficient formula λ = 0.0012·L + 0.45 is determined based on linear regression fitting. When generating the contrast excitation mask M, the mean μ of the feature tensor X within the sliding window and the absolute deviation of the pixel value from the mean μ are calculated and compared with the gain-weighted... The corrected local standard deviations σ are summed and normalized, and the resulting values ​​are used as mask values ​​at the coordinates to represent local significance. Simultaneously, the mean μ of the feature tensor X within the sliding window is extracted, and the relative deviation of the feature tensor X from the mean μ is calculated and compared with the gain-weighted values. The corrected local standard deviation σ is logically fused to generate a contrast excitation mask M representing local saliency. During this logical fusion operation, the system performs element-wise division with the relative deviation as the numerator and the sum of the corrected local standard deviation σ and the zero constant as the denominator. Then, an activation function is used to map the division result to a continuous real number space from 0 to 1, thereby replacing the simple summation and normalization calculation, and finally obtaining the steady-state contrast excitation mask M representing local saliency.

[0045] Using the prior density tensor D as a spatial distribution constraint, the feature tensor X is subjected to element-wise weighted correction through a contrast excitation mask M, outputting an enhanced feature tensor. During this process, the system utilizes the attenuation operator of the contrast excitation mask M in the corresponding high-density prior region to suppress the activation intensity of high-reflectivity artifact components, and uses the enhancement operator in the non-high-density prior region to compensate for the response amplitude of edge feature components. This deterministic logic hedging across data dimensions cuts off the evolution path of false detection storms caused by extreme ambient light noise, maintaining the constancy of feature representation across illumination fluctuation ranges. Finally, the enhanced feature tensor is input into the classification prediction layer to extract semantic features representing geometric anomalies, outputting a structured defect recognition result containing defect category, coordinates, and confidence level. The recognition result covers geometric defects of reflective area boundaries, edge cracks, and baseline structures, achieving accurate feature extraction based on physical constraints. In the training and optimization phase, the pixel mean of the preset defect annotation region is extracted from the enhanced feature tensor. Extract the average value of the background neighboring pixels within an 8-pixel span on the outer perimeter. The absolute value of the mean difference is integrated as a contrast perception constraint into the loss function of the deep neural network. The network weights are updated through backpropagation to maximize the absolute value of the difference. In the specific integration operation, the processor constructs a joint loss function that is equal to the weighted difference between the binary cross-entropy classification loss used for geometric defect classification and the absolute value of the mean difference. The penalty weight coefficient of the absolute value of the mean difference is initially set to 0.1 and gradually decays with each training iteration using a cosine annealing strategy. This forces the network weights to evolve in a direction that actively increases the difference between highly reflective backgrounds and minor defect features, while ensuring the smooth convergence of the main classification task.

[0046] Example 2: In an automated optical inspection platform integrating a 20-megapixel industrial area array camera, the experimental data was taken from a standardized dataset containing 500 sets of high-resolution circuit board assembly images. The camera has a 60fps acquisition frequency and a 0.1mm measurement resolution to simulate the micron-level defect capture requirements in a production line. During the acquisition process, Gaussian white noise with a signal-to-noise ratio of 20dB and a 50Hz power frequency interference voltage were superimposed. The damping coefficient λ needed to balance the reflection suppression intensity and signal retention rate. The main technical factors affecting this parameter value included the ambient illuminance parameter and the reflectivity of the metal wiring. To establish specific parameter benchmarks for the linear fitting equation, an ambient light gradient test matrix ranging from 0 lux to 2000 lux in 100 lux increments was constructed during the development process. Images were acquired from standard test targets containing 12 different reflectivity steps. The activation overflow rate of the feature tensor in the high-reflectivity region was extracted as the dependent variable. The extracted activation overflow rate was compared with the number of scatter points of the corresponding ambient illuminance parameter. The slope of the optimal fitted line was calculated to be 0.0012 and the basic suppression intercept on the Y-axis was 0.45 by performing least squares operations on the set. When the ambient illuminance parameter is above 1000 lux, to prevent signal annihilation of the feature tensor X in the reflective area, the damping coefficient λ tends to the upper limit of its range, i.e., the attenuation slope of the exponential function is increased. In the detection condition, the illuminance parameter is calibrated to 1200 lux, and based on the linear mapping relationship between ambient illuminance and the damping coefficient, the damping coefficient λ is determined to be 1.2. The experiment consisted of three sample groups. The control group used a convolutional neural network without spatial topology design data. The second control group introduced a prior density tensor D but set the damping coefficient λ to 0. The experimental group used the complete technical method with a damping coefficient λ set to 1.2. For a sample containing a metal shield and a 5.0 μm wide edge crack, the control group exhibited high-frequency noise points caused by reflection, with a defect recall rate of 62.4% and a false alarm rate of 15.6%. The second control group located the metal wiring area, but lacked gain weights. The exponential decay of the feature map resulted in residual artifact features and a defect recall rate of 78.5%. The experimental group used the prior density tensor D to generate a contrast excitation mask M, which generated a damping penalty in the high-density region corresponding to the feature tensor X. The actual defect recall rate was 98.2% and the false alarm rate was 1.1%.

[0047] To verify the performance inflection point and numerical range, an out-of-range sample group was set up in the experiment. When the damping coefficient λ increased to 2.5, the suppression strength of the prior density tensor D on the feature tensor X exceeded the signal extraction threshold, resulting in the simultaneous filtering out of effective defect features within a 1.0 pixel range of the metal edge, and the defect recall rate decreased from 98.2% to 81.4%. When the damping coefficient λ decreased to 0.2, the gain weight... Approaching 1.0, the system did not remove the reflected background; within the damping coefficient λ range of 0.8 to 1.5, the detection accuracy and false alarm rate exhibited a stable trade-off; for defect sizes of 2.0μm, 5.0μm, and 10.0μm, the experimental group achieved recognition accuracies of 92.6%, 97.8%, and 99.4% respectively under a signal-to-noise ratio of 15dB, while the control group achieved a recognition accuracy of only 41.2% for a 2.0μm defect under the same conditions. The gain weights were determined using the prior density tensor D. The local standard deviation σ is applied to enable the contrast excitation mask M to identify and suppress physical artifacts generated by metal reflection; the feature expression consistency index of the experimental group under different illuminance gradients is improved from 0.72 in the control group to 0.96, and the system outputs an enhanced feature tensor.

[0048] Example 3: In the case of automatic identification of high-precision semiconductor wire bonding quality, due to specular reflection at the gold wire bonding points under point light source illumination, the gradient features of the wire edge are easily masked by high-brightness artifacts in the feature tensor X. The processor extracts image features by calling a specific residual module in the deep neural network, and selects a data block with a dimension of 64×64×128 output by the third residual block as the feature tensor X to ensure that the spatial resolution is sufficient to characterize micron-level defects. The processor reads the set of vector coordinates in the computer-aided design file and executes a spatial topology alignment procedure. This procedure projects the set of vector coordinates onto a 512×512 discrete grid space with the same resolution as the input image to generate a binary distribution mask. The binary distribution mask is downsampled using an 8×8 average pooling operator to match the spatial dimension of the downsampled grid with the spatial dimension of the feature tensor X, generating a priori density tensor D. The damping coefficient λ is determined according to the benchmark calibration method. During the system deployment phase, a standard reflectivity order is used. The ladder acquires characteristic response data under different illuminance levels by targeting the target. The function relationship between the ambient illuminance parameter L and the suppression weight is fitted by the least squares method. The calculation formula of the damping coefficient λ is as follows: λ=k·L+b, where λ is the calculated damping coefficient; L is the ambient illuminance parameter collected in real time by the illuminance sensor; k is the calibrated gain slope, which is 0.0012 in this embodiment; b is the basic suppression bias coefficient, which is 0.45 in this embodiment. The physical feasibility of this linear mapping relationship is that the change in macroscopic photon flux caused by the ambient illuminance parameter is converted into a proportional digital pixel gray value by the image sensor of the industrial area array camera. In the shallow feature transmission of the deep neural network without the nonlinear activation layer truncation, the increment of the initial gray value and the activation amplitude of the feature tensor maintain a strict linear homomorphic response, so that the network layer artifact activation caused by external illumination can be directly quantified and offset in the feature space through the linear equation.

[0049] During the feature correction stage, the processor uses a 3×3 sliding window to traverse the feature tensor X and calculates the local standard deviation σ within the window, while simultaneously retrieving the values ​​of the prior density tensor D under the same spatial coordinates. Since the feature tensor X has 128 depth channels, the traversal and calculation process is unfolded on each of the 128 independent channels of the feature tensor X. The sliding window independently extracts the local standard deviation on the two-dimensional plane of each single channel. At the same time, the system losslessly copies and expands the prior density tensor D of each channel along the depth dimension 128 times to construct a prior distribution with dimensions of 64×64×128, ensuring that the physical prior and high-dimensional semantic features achieve accurate three-dimensional spatial channel-by-channel alignment in subsequent processing. The processor calculates the damping coefficient λ under the current illuminance according to the aforementioned calibration formula, and then calculates the damping coefficient λ according to the formula. Determine the gain weights at coordinates i,j ,in The gain weights are the values ​​at the corresponding coordinates. Let D be the value of the prior density tensor D at that coordinate; when When the metal density threshold of 0.85 is exceeded, the exponential decay term produces a damping effect to reduce the response weight of this region in the contrast excitation mask M, by adjusting the gain weight. The contrast excitation mask M is generated by multiplying the local standard deviation σ. The processor uses the contrast excitation mask M to perform element-wise multiplication on the feature tensor X, and outputs an enhanced feature tensor. Since the physical design prior eliminates coordinate drift error in the grid mapping stage, the geometric features characterizing lead wire breakage or offset are accurately extracted under strong reflection conditions. The output includes the identification result containing the defect category and coordinates, maintaining the constant detection accuracy under cross-environmental lighting conditions.

[0050] Example 4: In an industrial vision system containing an RS-274X format design file parsing module, the processor calibrates the linear mapping relationship between the physical wiring space and the image pixel space. It extracts a vector point set containing reference coordinates and geometric contours by parsing the RS-274X format file; obtains the camera's physical pixel size and the lens's optical magnification; determines the dimensionless spatial transformation coefficient 's' used to characterize the ratio of physical size to pixel count; and uses a projection transformation matrix to map the vector point set to a 512×512 pixel grid space matching the input image resolution, where 's' is a dimensionless coefficient characterizing the ratio of physical size to pixel count. The processor calculates within each discrete grid cell... The system calculates the wiring area ratio and converts the local metal fill rate into a numerical sequence consistent with the spatial dimension of the feature tensor X through 8×8 average pooling downsampling, generating a prior density tensor D. In the process of generating the prior density tensor D, the system identifies the hierarchical metadata tags of the parsed vector point set, classifies the extracted geometric contours into exposed pads, solder mask, and silkscreen layer, and calls the material reflectivity lookup table preset in the register. It assigns a high reflectivity component weight of 1.0 based on copper metal to the exposed pads and a diffuse reflectivity component weight of 0.4 to the solder mask. Then, it multiplies the component weights with the local metal fill rate to complete the feature space encoding of the physical reflectivity corresponding to different material properties.

[0051] In an electronic manufacturing environment containing strong diffuse light from metal, the processor calibrates the brightness response to establish the numerical source of the damping coefficient λ, suppressing the influence of ambient light on the damping logic. The system acquires a target containing a reflectivity gradient under a controlled light source gradient, measures the activation amplitude fluctuation of the feature tensor X under different ambient illuminance parameters L, and uses the least squares method to fit regression parameters satisfying the linear formula λ = k·L + b, storing them in the processor's non-volatile register. Here, λ is the calculated damping coefficient, L is the ambient illuminance parameter acquired in real-time by the sensor, k is the calibrated gain slope, and b is the basic suppression bias coefficient. In the real-time detection process, the processor calculates the damping coefficient λ based on the sensor feedback, and then calculates the damping coefficient λ by analyzing the components of the prior density tensor D. By applying a nonlinear damping penalty, the processor generates gain weights that suppress reflection artifacts in high-density metal regions. This ensures that the output amplitude of the contrast excitation mask M remains within a preset steady-state range within the illumination fluctuation range.

[0052] Example 5: In an industrial vision system integrating a Gerber original design file parsing module, the processor calibrates the linear mapping relationship between the physical wiring space and the image pixel space. By parsing the RS-274X format file, it extracts the vector point set containing the reference coordinates and geometric contours of the circuit board components. It obtains the physical pixel size of the camera and the optical magnification of the lens to determine the dimensionless spatial transformation coefficient s that characterizes the ratio of physical size to pixel number. Using the projection transformation matrix, the vector point set is mapped to a 512×512 pixel grid space with the same resolution as the input image. The integrated operation is performed on the projected grid space to calculate the wiring area ratio within the grid cell. The calculation result is converted into a numerical sequence with the same spatial dimension as the feature tensor X through 8×8 average pooling downsampling, generating a spatially topologically aligned prior density tensor D.

[0053] When the detection system is in an electronic manufacturing environment with ambient illuminance varying from 500 lux to 1500 lux and including diffuse metallic light, the processor acquires a target containing a reflectivity gradient under a controlled light source gradient. It measures the activation amplitude fluctuation of the feature tensor X under different ambient illuminance parameters L, fits regression parameters satisfying the linear formula λ = k·L + b using the least squares method, and stores them in the processor's non-volatile register. The processor calculates the damping coefficient λ in real time based on the lux values ​​fed back by the sensor, and then analyzes the components of the prior density tensor D. Applying a nonlinear damping penalty based on an exponential function generates gain weights that suppress reflection artifacts in high-density metal regions. ,in Here, λ represents the gain weight at the corresponding coordinate, and λ is the calculated damping coefficient. is the value of the prior density tensor D at the corresponding coordinates, and k is the calibrated gain slope, b is the basic suppression bias coefficient, and the output amplitude of the contrast excitation mask M is within the preset steady-state range within the illumination fluctuation range.

[0054] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0055] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A deep learning-based circuit board assembly defect feature recognition method, characterized by, Includes the following steps: Step S1: Obtain image data of the target to be detected and extract the feature tensor of the image data in the deep neural network; Step S2: Read the spatial topology design data corresponding to the target to be detected, and project the geometric wiring and reference structure in the spatial topology design data to the coordinate space of the feature tensor through discretized grid mapping to generate the prior density tensor of spatial topology alignment. Step S3: Use a sliding window to traverse the feature tensors, calculate the local standard deviation of the feature tensors within the sliding window, and determine the gain weights based on the values ​​of the prior density tensors within the sliding window. wherein the determination of the gain weight follows a calculation rule as follows: wherein, is a gain weight at a coordinate i, j in the corresponding feature tensor; is a value of the prior density tensor at the corresponding coordinate i, j; λ is a preset damping coefficient; the gain weight is multiplied with the local standard deviation to obtain a modified local standard deviation, and the contrast excitation mask is generated based on the modified local standard deviation, so as to reduce the response intensity of a region with a value greater than a preset threshold in the prior density tensor in the contrast excitation mask. Step S4: Using the prior density tensor as a spatial distribution constraint, the feature tensor is modified element-wise by contrast excitation mask to suppress the activation intensity of high-reflection artifact components and compensate for the response amplitude of edge feature components, and the enhanced feature tensor is output. Step S5: Input the enhanced feature tensor into the classification prediction layer, extract the semantic features representing geometric anomalies from the enhanced feature tensor, and output the defect identification result.

2. The method for identifying circuit board assembly defect features based on deep learning according to claim 1, characterized in that, In step S2, the spatial coordinate set of the geometric wiring and the reference structure is converted into a wiring density function, and the wiring density function is resampled according to the geometric transformation parameters of the image data during sampling, so that the generated prior density tensor and the feature tensor are aligned at the pixel level in spatial position.

3. The method for identifying circuit board assembly defect features based on deep learning according to claim 1, characterized in that, In step S3, the process of generating the contrast excitation mask further includes: extracting the mean of the feature tensor within the sliding window, calculating the relative deviation between the feature tensor and the mean, and logically fusing the relative deviation with the local standard deviation after gain weight correction to generate a mask value representing local saliency.

4. The method for identifying circuit board assembly defect features based on deep learning according to claim 1, characterized in that, In step S4, the contrast excitation mask is multiplied element-wise with the feature tensor, and the physical artifact signal is stripped away by using the attenuation operator of the contrast excitation mask in the corresponding high-density prior region and the enhancement operator in the non-high-density prior region.

5. The method for identifying defect features of circuit board components based on deep learning according to claim 1, characterized in that, The method also includes a training optimization phase, the steps of which include: integrating a contrast-aware constraint term into the loss function of the deep neural network, and guiding the weights of the deep neural network to update in the direction of maximizing the mean difference by calculating the mean difference between the labeled defect region and its background neighborhood on the enhancement feature tensor.

6. The method for identifying defect features of circuit board components based on deep learning according to claim 1, characterized in that, In step S5, the defect identification results include the identified reflection area boundaries, edge cracks, and geometric defects of the reference structure; during the identification process, the feature representation is kept constant across the illumination fluctuation range by enhancing the feature tensor.

7. The method for identifying circuit board assembly defect features based on deep learning according to claim 1, characterized in that, In step S3, the value of the damping coefficient λ is set based on the ambient illumination parameter of the image data, wherein the damping coefficient... It is positively correlated with the ambient illuminance parameter.

8. The method for identifying circuit board assembly defect features based on deep learning according to claim 1, characterized in that, The process of generating the prior density tensor also includes encoding the material properties in the spatial topology design data and setting the component weights of the prior density tensor according to the physical reflectivity corresponding to different material properties, so as to distinguish the response differences of structures with different reflectivity in the feature space.

9. The method for identifying defect features of circuit board components based on deep learning according to claim 1, characterized in that, In step S5, the deep semantic features enhanced by contrast are used to classify and locate defects, and the output is structured data containing defect category, coordinates and confidence level.