Circuit board defect identification method and system based on artificial intelligence

By acquiring infrared radiation energy distribution data of circuit boards and performing gradient field reconstruction and topology mapping, combined with feature sparse coding and wiring rule base matching, the accuracy and reliability problems of circuit board defect detection in existing technologies are solved, and effective identification of subtle structural anomalies and latent defects is achieved.

CN121656265APending Publication Date: 2026-03-13GUIZHOU INST OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511848541.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing machine vision inspection methods are insufficient to meet the requirements of high-precision circuit board inspection for comprehensive and accurate defect features. They are prone to misjudgment, especially under environmental interference or feature similarity conditions, and are difficult to identify subtle structural anomalies or hidden defects.

Method used

By acquiring infrared radiation energy distribution data on the surface of the circuit board under preset temperature excitation conditions, gradient field reconstruction is performed to generate a heat flux vector field, which is then associated and mapped with the circuit topology. Combined with feature sparse coding processing and constraint optimization, enhanced vector field data is generated. This data is then matched with the circuit board layout and routing rule library to identify defect types and locations.

Benefits of technology

It improves the accuracy and reliability of circuit board defect detection, and can identify subtle structural anomalies and latent defects that are difficult to detect by traditional methods, providing more comprehensive quality control support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121656265A_ABST
    Figure CN121656265A_ABST
Patent Text Reader

Abstract

The invention provides a circuit board defect identification method and system based on artificial intelligence, and the method comprises the steps: obtaining the infrared radiation energy distribution data of the surface of a circuit board under a preset temperature excitation condition, and carrying out the gradient field reconstruction operation of the infrared radiation energy distribution data; a heat flux vector field of the defect area is generated by calculating the radiation intensity change rate of adjacent pixel points, correlation mapping is carried out on the heat flux vector field and a circuit topological structure of the circuit board, and enhanced vector field data containing a circuit connection relation is generated through vector field fusion under topological constraints; performing feature sparse coding processing on the enhanced vector field data, constructing an association constraint matrix between defect features and circuit design specifications, and performing constraint optimization solution to obtain a defect type characterization value; and matching the defect type characterization value with a circuit board layout and wiring rule base to generate a detection result containing a defect type identifier and a defect positioning coordinate. According to the invention, the accuracy and reliability of circuit board defect detection are comprehensively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and more specifically, to a method and system for identifying circuit board defects based on artificial intelligence. Background Technology

[0002] In the electronics manufacturing industry, circuit boards, as core components of electronic devices, require rigorous quality inspection to ensure product reliability. Machine vision inspection technology, with its advantages of non-contact operation and high efficiency, is widely used in circuit board defect detection. Currently, machine vision has long surpassed the scope of simply "taking photos with a camera." Its core definition is the automatic reception and processing of images of real objects through optical devices and non-contact sensors to obtain necessary information or control machine movement.

[0003] Currently, conventional machine vision inspection methods primarily acquire visible light or static infrared images of the circuit board surface using optical imaging equipment. Algorithms such as edge detection and template matching are then used to extract morphological or grayscale distribution features from the images, which are then compared with preset standard templates to identify defects. These methods focus on analyzing the geometric shape or local grayscale differences of the circuit board surface, but have limited ability to characterize subtle structural anomalies or latent defects. They are prone to misjudgment due to environmental interference or feature similarity, making it difficult to meet the requirements of high-precision circuit board inspection for comprehensive and accurate defect features. Summary of the Invention

[0004] Based on this, the present invention provides an artificial intelligence-based circuit board defect identification method and system. By applying machine vision technology to the field of thermophysical defect detection, and integrating physical field characteristics, topological structure information and design specification requirements, the accuracy and reliability of circuit board defect detection are improved.

[0005] In a first aspect, embodiments of the present invention provide an artificial intelligence-based method for identifying circuit board defects. The method includes: acquiring infrared radiation energy distribution data of the circuit board surface under a preset temperature excitation condition, wherein the infrared radiation energy distribution data includes response curves of radiation intensity changes over time in different regions; performing gradient field reconstruction on the infrared radiation energy distribution data, generating a heat flux vector field of the defect region by calculating the rate of change of radiation intensity of adjacent pixels, wherein the heat flux vector field includes spatial distribution information of directional and magnitude components; associating and mapping the heat flux vector field with the circuit topology of the circuit board, generating enhanced vector field data containing circuit connection relationships through vector field fusion under topological constraints; performing feature sparse coding processing on the enhanced vector field data, constructing an association constraint matrix between defect features and circuit design specifications, obtaining a defect type characterization value through constraint optimization; and matching the defect type characterization value with a circuit board layout and routing rule library to generate a circuit board detection result containing defect type identifiers and defect location coordinates.

[0006] Secondly, embodiments of the present invention provide a computer system, including: a memory storing a computer program; and a processor for loading the computer program to implement the artificial intelligence-based circuit board defect identification method described above.

[0007] This invention upgrades traditional static detection to dynamic thermal response feature acquisition by acquiring infrared radiation energy distribution data of a circuit board surface under preset temperature excitation conditions, enabling the capture of dynamic physical characteristics of defect areas as temperature changes. A heat flux vector field generated by gradient field reconstruction of the infrared radiation energy distribution data achieves the transformation from numerical radiation intensity to spatial vector features, simultaneously characterizing the directional distribution and size variation of the defect area. The heat flux vector field is correlated and mapped with the circuit topology of the circuit board, deeply integrating physical field data with circuit design information. The enhanced vector field data generated through vector field fusion under topological constraints reflects the influence of circuit connections on defect features. An association constraint matrix constructed by performing feature sparse coding processing on the enhanced vector field data establishes a quantitative correlation between defect features and circuit design specifications. The defect type characterization value obtained through constraint optimization provides a structured expression of defect features. The detection results generated by matching defect type characterization values ​​with the circuit board layout and routing rule library can comprehensively improve the accuracy and reliability of circuit board defect detection by integrating physical field characteristics, topology information and design specification requirements. It can effectively identify subtle structural anomalies and hidden defects that are difficult to detect by traditional methods, and provide more comprehensive technical support for circuit board quality control. Attached Figure Description

[0008] Figure 1This is a flowchart of an artificial intelligence-based circuit board defect identification method provided in an embodiment of the present invention.

[0009] Figure 2 This is a schematic diagram of the composition of a computer system provided in an embodiment of the present invention. Detailed Implementation

[0010] Please see Figure 1 , Figure 1 The flowchart illustrates an artificial intelligence-based circuit board defect identification method provided in this embodiment of the invention. This method can be executed by a computer system and may include the following steps: Step S100: Obtain infrared radiation energy distribution data of the circuit board surface under preset temperature excitation conditions. The infrared radiation energy distribution data includes response curves of radiation intensity changes over time in different regions.

[0011] Preset temperature excitation conditions are temperature conditions set to generate specific infrared radiation on the surface of a circuit board. For example, the circuit board can be placed in an environment with precisely controlled temperature, and the temperature can be raised to a preset value at a certain heating rate and maintained for a period of time. Infrared radiation energy distribution data shows the distribution of infrared energy radiated from different areas of the circuit board surface. This data is presented as a response curve showing the change in radiation intensity over time in different areas. The response curve reflects the dynamic change in radiation intensity over time in different areas of the circuit board surface under preset temperature excitation. For example, in a solder joint area of ​​the circuit board, the radiation intensity may initially rise rapidly with increasing temperature, and then stabilize after reaching a certain temperature, resulting in a response curve of a specific shape. To obtain this data, a high-precision infrared thermal imager can be used, pointed at the circuit board surface, and continuously recorded at different times during the preset temperature excitation process to obtain infrared radiation energy distribution data.

[0012] Step S200: Perform gradient field reconstruction on the infrared radiation energy distribution data. Generate the heat flux vector field of the defect region by calculating the rate of change of radiation intensity of adjacent pixels. The heat flux vector field contains the spatial distribution information of the direction component and the magnitude component.

[0013] Gradient field reconstruction aims to construct a vector field reflecting the heat flux distribution on the circuit board surface by analyzing the changes in radiation intensity between adjacent pixels in the data. The rate of change of radiation intensity is the degree of change in radiation intensity between adjacent pixels; by calculating this rate, the trend and intensity of heat transfer on the circuit board surface can be understood. The heat flux vector field of the defect region is a vector field describing the heat flux distribution in the defect region of the circuit board surface, where the direction component represents the direction of the heat flux, and the magnitude component represents the magnitude of the heat flux. Spatial distribution information helps us locate and identify defects on the circuit board surface. For example, in areas with short-circuit defects on the circuit board, the direction and magnitude of the heat flux may differ significantly from normal areas. In practice, image processing algorithms can be used to analyze the infrared radiation energy distribution data pixel by pixel, calculate the difference in radiation intensity between adjacent pixels to obtain the rate of change of radiation intensity, and then generate the heat flux vector field based on these rates of change.

[0014] As one implementation method, step S200 can be specifically implemented as the following steps S210~S260: Step S210: Perform spatiotemporal alignment processing on the infrared radiation energy distribution data according to the temperature excitation time series, map the radiation intensity data of different timestamps to a unified spatial grid, and generate a spatiotemporally correlated radiation intensity matrix. Each element of the radiation intensity matrix contains the spatial horizontal coordinate, the spatial vertical coordinate, and the radiation intensity value corresponding to the timestamp. The coordinate interpolation algorithm ensures that the data of different timestamps correspond one-to-one in spatial location.

[0015] Temperature excitation time series is a series of time points recorded sequentially during a pre-set temperature excitation process. Spatiotemporal alignment processing integrates infrared radiation energy distribution data from different time stamps, ensuring spatial and temporal consistency. A unified spatial grid is a predefined spatial coordinate system used to uniformly map radiation intensity data from different time stamps. The spatiotemporally correlated radiation intensity matrix is ​​a three-dimensional matrix where each element contains a spatial horizontal coordinate, a spatial vertical coordinate, and the radiation intensity value corresponding to the time stamp, integrating radiation intensity information from different times and spaces. The coordinate interpolation algorithm is used to fill in missing values ​​in the spatial location of data from different time stamps, ensuring a one-to-one correspondence between data from different time stamps. For example, at a certain time stamp, if the radiation intensity data for a pixel is missing due to measurement errors or other reasons, the coordinate interpolation algorithm can estimate the radiation intensity value of that pixel based on data from adjacent pixels and other time stamps. A commonly used coordinate interpolation algorithm is bilinear interpolation. In its implementation, for a pixel with a missing value, it first finds its four neighboring known pixels. Based on the radiance values ​​of these four pixels and their distances from the missing pixel, it calculates the radiance value of the missing pixel using the bilinear interpolation formula. In this way, radiance data from different timestamps are mapped onto a unified spatial grid, generating a spatiotemporally correlated radiance matrix.

[0016] Step S220: Perform multi-scale Gaussian filtering on the spatiotemporally correlated radiation intensity matrix. Convolve the matrix sequentially based on Gaussian kernels corresponding to different defect types to obtain three filtering matrices corresponding to different defect types. Extract radiation intensity detail features by subtracting the filtering matrices of adjacent defect types to generate a detail enhancement matrix. Among them, pad micro-defects correspond to the first-scale Gaussian kernel, wire fine defects correspond to the second-scale Gaussian kernel, and region defects correspond to the third-scale Gaussian kernel.

[0017] Multi-scale Gaussian filtering is a method for filtering spatiotemporally correlated radiation intensity matrices. It extracts feature information at different scales by convolving the matrix with Gaussian kernels of varying scales. Gaussian kernels are filters based on the Gaussian function; different scales can be used to detect defects of different sizes. By convolving the Gaussian kernel with the spatiotemporally correlated radiation intensity matrix, the data in the matrix is ​​smoothed while highlighting features at specific scales. The filtering matrix, obtained after the convolution operation, reflects the feature information of different defect types within the matrix. Radiation intensity detail features are features in the matrix that reflect the details of defects on the circuit board surface. These detail features can be extracted by subtracting the filtering matrices of adjacent defect types. The detail enhancement matrix is ​​a processed matrix that highlights the detail features of radiation intensity, providing clearer feature input for subsequent gradient calculations. Micro-defects on solder pads are minute structural anomalies in the solder pad area of ​​a circuit board, such as tiny cracks or cold solder joints. Fine defects on conductors are minute structural anomalies in the conductor area, such as minor breaks or short circuits. Regional defects are structural anomalies covering a larger area, such as overall overheating or short circuits in a specific area of ​​the circuit board. First-scale Gaussian kernels, second-scale Gaussian kernels, and third-scale Gaussian kernels correspond to defects of different sizes. The first-scale Gaussian kernel is used to detect micro-defects on solder pads, and its size is relatively small; the second-scale Gaussian kernel is used to detect fine defects on conductors, and its size is medium; the third-scale Gaussian kernel is used to detect regional defects, and its size is larger. In practice, the scale of the Gaussian kernel is first determined based on the characteristics of different defect types. Then, these Gaussian kernels are used to sequentially convolve the spatiotemporally correlated radiation intensity matrix to obtain three filter matrices. The difference between adjacent filter matrices is then calculated to extract detail features and generate a detail enhancement matrix.

[0018] As one implementation method, step S220 can be specifically implemented as the following steps S221~S225: Step S221: Determine the Gaussian filter scale sequence based on the characteristics of the surface defects on the circuit board. The pad micro-defects correspond to the first scale Gaussian kernel, the conductor fine defects correspond to the second scale Gaussian kernel, and the area defects correspond to the third scale Gaussian kernel. The pad micro-defects correspond to the small structural anomalies in the pad area of ​​the circuit board, the conductor fine defects correspond to the small structural anomalies in the conductor area, and the area defects correspond to the structural anomalies in a larger area.

[0019] A Gaussian filter scale sequence is a set of Gaussian kernel scales determined according to the characteristics of different defect types. It specifies the size of the Gaussian kernel used in multi-scale Gaussian filtering. Circuit board surface defect type characteristics are the physical features of different types of defects, such as size and shape. Based on these characteristics, a suitable Gaussian kernel scale for detecting each defect type can be determined. Micro-defects on solder pads are typically small structural anomalies in the circuit board pad area, and their small size requires a smaller-scale Gaussian kernel for detection. Fine defects on conductors are small structural anomalies in the conductor area, with a medium size, requiring a medium-scale Gaussian kernel. Area defects are structural anomalies covering a large area, requiring a larger-scale Gaussian kernel. The most suitable scale sequence can be determined by experimenting with a large number of circuit boards with known defect types and observing the detection effects of different-scale Gaussian kernels on different defect types.

[0020] Step S222: Generate three Gaussian kernel matrices based on the scale sequence. The size of each Gaussian kernel matrix is ​​determined according to the characteristic size of the corresponding defect type. Smaller kernel matrices correspond to micro-defects on pads, medium-sized kernel matrices correspond to fine defects on wires, and larger kernel matrices correspond to regional defects. The matrix element values ​​are calculated using a Gaussian function and then normalized.

[0021] A Gaussian kernel matrix is ​​a matrix generated based on a Gaussian function, where the element values ​​reflect the weights of the Gaussian kernel at different locations. The size of each Gaussian kernel matrix is ​​determined according to the feature size of the corresponding defect type to ensure effective detection of that type of defect. The matrix element values ​​are calculated using the Gaussian function, and normalization is performed to adjust the matrix element values ​​so that the sum of the element values ​​is 1. This ensures that the convolution operation does not change the energy of the original matrix. For example, for a first-scale Gaussian kernel matrix with a size of 3×3, the value of each element is calculated using the Gaussian function, and then these values ​​are normalized so that the sum of the matrix element values ​​is 1. In practice, mathematical libraries in programming languages ​​can be used to calculate the matrix element values ​​based on the expression of the Gaussian function and perform normalization.

[0022] Step S223: Convolve the spatiotemporally correlated radiation intensity matrix with the three Gaussian kernel matrices respectively. During the convolution process, the matrix boundaries are processed based on the symmetric filling method to generate three filter matrices corresponding to pad micro-defects, wire fine defects, and region defects.

[0023] Convolution is the process of element-wise multiplying and summing the spatiotemporally correlated radiation intensity matrix with a Gaussian kernel matrix. Convolution smooths the data in the matrix while highlighting features at a specific scale. Matrix boundary processing is the method used to handle matrix boundary elements during convolution. Since convolution requires neighborhood calculations for matrix elements, the neighborhood of a boundary element may extend beyond the matrix's boundaries, necessitating special handling. Symmetric padding is a common matrix boundary processing method. It expands the matrix boundary by symmetrically copying the boundary elements, allowing the convolution operation to proceed correctly. The three filter matrices corresponding to pad micro-defects, wire fine defects, and region defects are obtained after convolution, reflecting the feature information of different defect types in the spatiotemporally correlated radiation intensity matrix. In practice, convolution functions from image processing libraries can be used, setting the matrix boundary processing method to symmetric padding, and convolving the spatiotemporally correlated radiation intensity matrix with the three Gaussian kernel matrices to generate three filter matrices.

[0024] Step S224: Calculate the difference between adjacent defect type filtering matrices. Extract minute detail features by subtracting the pad micro-defect filtering matrix from the conductor fine defect filtering matrix. Extract regular detail features by subtracting the conductor fine defect filtering matrix from the region defect filtering matrix. Add the two detail feature matrices element by element to generate a preliminary detail matrix.

[0025] The difference between adjacent defect type filter matrices is obtained by subtracting corresponding elements from two adjacent filter matrices. Calculating this difference allows for the extraction of detailed features between different defect types. Minor detail features are the subtle differences between pad micro-defects and conductor fine defects; these can be extracted by subtracting the pad micro-defect filter matrix from the conductor fine defect filter matrix. Regular detail features are the subtle differences between conductor fine defects and area defects; these can be extracted by subtracting the conductor fine defect filter matrix from the area defect filter matrix. The preliminary detail matrix is ​​obtained by element-wise addition of the minor detail feature matrix and the regular detail feature matrix, thus integrating the detailed features between different defect types.

[0026] Step S225: Perform scale-weighted fusion on the preliminary detail matrix. Based on the distribution probability of different defect types in the circuit board, assign weights to the micro-detail features and regular detail features, and generate a detail enhancement matrix after weighted summation. The detail enhancement matrix retains the radiation intensity variation features of different defect types. The detail signal-to-noise ratio of the pad micro-defect region is increased to a preset multiple of the original matrix, providing clear feature input for subsequent gradient calculation.

[0027] Scale-weighted fusion is a method that fuses detail features at different scales. By assigning different weights to minute and regular detail features based on the distribution probability of different defect types on the circuit board, a weighted sum is performed to obtain a comprehensive detail feature matrix. The distribution probability of different defect types on the circuit board represents the frequency of occurrence of different defect types during extensive circuit board inspection. For example, statistical analysis reveals that the probability of a pad micro-defect occurring on a circuit board is 30%, the probability of a wire fine defect is 50%, and the probability of a region defect is 20%. Based on these probabilities, corresponding weights can be assigned to minute and regular detail features, such as a weight of 0.3 for minute details and 0.7 for regular details. Weighted summation involves multiplying the minute and regular detail feature matrices according to their respective weights and then summing the results to obtain the detail enhancement matrix. The detail enhancement matrix retains the radiation intensity variation characteristics of different defect types. Through scale-weighted fusion, it highlights the feature information of different defect types, particularly improving the signal-to-noise ratio of details in the pad micro-defect region, providing clearer feature input for subsequent gradient calculations. For example, assuming the minute detail feature matrix is ​​M, the regular detail feature matrix is ​​N, the weight of the minute detail feature is w1, and the weight of the regular detail feature is w2, then the detail enhancement matrix is ​​w1M + w2N. In practice, matrix operation functions in programming languages ​​can be used to perform scale-weight fusion on the initial detail matrix to generate the detail enhancement matrix.

[0028] Step S230: Perform neighborhood gradient calculation on the detail enhancement matrix. Calculate the difference in radiance intensity between adjacent pixels in the horizontal and vertical directions within the preset neighborhood window, and introduce the radiance intensity change rate in the time dimension. The time dimension change rate is obtained by calculating the difference in radiance intensity between the current timestamp and the previous timestamp, generating a set of spatiotemporal gradient components containing spatial horizontal gradient, spatial vertical gradient, and time gradient.

[0029] Neighborhood gradient calculation is the process of calculating the gradient of the neighborhood of each pixel in the detail enhancement matrix. By calculating the difference in radiance intensity between adjacent pixels, the gradient information of that pixel in different directions can be obtained. The preset neighborhood window is the range of the pixel's neighborhood considered when calculating the gradient; for example, it can be set to a 3×3 neighborhood window. The difference in radiance intensity between adjacent pixels in the horizontal and vertical directions is the difference in radiance intensity between adjacent pixels in the horizontal and vertical directions. By calculating these differences, the spatial horizontal gradient and spatial vertical gradient can be obtained. The rate of change of radiance intensity in the time dimension is the difference in radiance intensity between the current timestamp and the previous timestamp, reflecting how radiance intensity changes over time. The spatiotemporal gradient component set is a collection containing spatial horizontal gradient, spatial vertical gradient, and temporal gradient, integrating gradient information in both spatial and temporal dimensions, providing more comprehensive features for subsequent defect detection. For example, for a pixel, within a 3×3 neighborhood window, the difference in radiance intensity between its adjacent pixels in the horizontal and vertical directions is calculated to obtain the spatial horizontal gradient and spatial vertical gradient. At the same time, the difference in radiance intensity between the current timestamp and the previous timestamp is calculated to obtain the temporal gradient. These gradient information are then integrated into a set of spatiotemporal gradient components.

[0030] As one implementation method, step S230 can be specifically implemented as the following steps S231~S236: Step S231: Perform boundary expansion processing on the detail enhancement matrix, supplement the neighborhood information of the edge pixels of the matrix based on the mirror filling method, and generate the expanded detail matrix after boundary expansion. The number of edge pixels of the expanded detail matrix matches the preset neighborhood window size.

[0031] Boundary expansion is a method used in neighborhood gradient calculation to process the boundary elements of the detail enhancement matrix. Since neighborhood gradient calculation requires calculating the neighborhood of each matrix element, the neighborhood of a boundary element may exceed the matrix's boundaries, necessitating boundary expansion. Mirror filling is a commonly used boundary expansion method. It expands the matrix boundary by symmetrically copying the edge pixels, allowing neighborhood gradient calculation to proceed normally. The expanded detail matrix is ​​the matrix obtained after boundary expansion. The number of edge pixels matches the preset neighborhood window size, ensuring that each pixel has complete neighborhood information during neighborhood gradient calculation. For example, for a 5×5 detail enhancement matrix with a preset neighborhood window size of 3×3, mirror filling expands the matrix boundary, resulting in a 7×7 expanded detail matrix. In practice, matrix operation functions in programming languages ​​can be used to perform boundary expansion on the detail enhancement matrix to generate the expanded detail matrix.

[0032] Step S232: Slide the preset neighborhood window in the extended detail matrix, and extract the radiation intensity value of the center pixel and its horizontal and vertical adjacent pixels in each window to obtain the radiation intensity value of the center pixel, the radiation intensity value of the horizontal neighborhood and the radiation intensity value of the vertical neighborhood.

[0033] In the expanded detail matrix (EDM), a preset neighborhood window slides according to predefined rules, with the sliding step size adjustable as needed. Each slide covers a portion of the pixels in the EDM. The center pixel is the pixel at the exact center of the neighborhood window; horizontally adjacent pixels are those horizontally adjacent to the center pixel; and vertically adjacent pixels are those vertically adjacent to the center pixel. By extracting the radiance values ​​of these pixels, the radiance values ​​of the center pixel, the horizontally adjacent pixels, and the vertically adjacent pixels can be obtained. For example, in a large EDM, the neighborhood window can start from the top left corner of the matrix and slide to the right with a fixed step size. When it reaches the right boundary of the matrix, it moves down one row and continues sliding from left to right until the entire EDM has been traversed. Within each neighborhood window, a corresponding indexing algorithm is used to determine the positions of the center pixel, horizontally adjacent pixels, and vertically adjacent pixels, and then the radiance values ​​corresponding to these pixels are extracted from the EDM.

[0034] Step S233: Calculate the difference between the radiation intensity value of the center pixel and the radiation intensity value of the horizontal neighborhood as the horizontal gradient contribution value, and calculate the difference between the radiation intensity value of the center pixel and the radiation intensity value of the vertical neighborhood as the vertical gradient contribution value.

[0035] The lateral gradient contribution reflects the change in radiation intensity in the lateral direction, and is obtained by calculating the difference between the radiation intensity value of the center pixel and the radiation intensity value of its lateral neighbors. The vertical gradient contribution reflects the change in radiation intensity in the vertical direction, and is determined by the difference between the radiation intensity value of the center pixel and the radiation intensity value of its vertical neighbors. Specifically, for each pixel within a neighborhood window, the radiation intensity value of the center pixel is subtracted from the radiation intensity values ​​of its lateral and vertical neighbors. If the lateral neighborhood radiation intensity value is greater than the center pixel radiation intensity value, the lateral gradient contribution is negative, indicating that the radiation intensity is decreasing in the lateral direction; conversely, it is positive, meaning that the radiation intensity is increasing. The calculation of the vertical gradient contribution is similar. For example, in a certain neighborhood window, if the radiation intensity value of the center pixel is at a specific intensity level, and the radiation intensity values ​​of its lateral neighbors are higher, then the calculated lateral gradient contribution is negative, indicating that the lateral radiation intensity gradually decreases from the center to the lateral neighbors within that neighborhood.

[0036] Step S234: Extract the radiation intensity values ​​at the corresponding positions of the current timestamp and the previous timestamp, and calculate the difference between the two as the radiation intensity change rate in the time dimension. The radiation intensity change rate reflects the dynamic response speed of radiation intensity with temperature excitation.

[0037] Throughout the detection process, radiation intensity data is recorded at different timestamps. The current timestamp is the point in time currently being processed, and the previous timestamp is the point in time preceding the current timestamp. By extracting the radiation intensity values ​​at corresponding positions between these two timestamps and calculating their difference, the rate of change of radiation intensity over time can be obtained. This rate of change reflects the dynamic response speed of radiation intensity to temperature excitation. If the difference is large, it indicates that the radiation intensity changes rapidly between these two times, meaning that the radiation intensity responds quickly to temperature excitation; conversely, if the difference is small, it indicates that the radiation intensity changes slowly, and the response speed to temperature excitation is slow. For example, in the initial stage of temperature excitation, the radiation intensity may rise rapidly, resulting in a large rate of change of radiation intensity over time; while after the temperature reaches a stable state, the change in radiation intensity is relatively small, and the rate of change of radiation intensity over time will correspondingly decrease.

[0038] Step S235: Arrange the lateral gradient contribution values ​​of all pixels according to the spatial position of the original detail enhancement matrix to generate a spatial lateral gradient matrix; arrange the vertical gradient contribution values ​​of all pixels according to the same spatial position to generate a spatial vertical gradient matrix; arrange the temporal gradient rate of all pixels according to the same spatial position to generate a temporal gradient matrix.

[0039] After calculating the lateral gradient contribution, longitudinal gradient contribution, and temporal rate of change for all pixels, these values ​​need to be arranged according to their spatial positions in the original detail enhancement matrix. The spatial lateral gradient matrix is ​​a matrix composed of the lateral gradient contribution values ​​of all pixels, with each element positioned in the same position as the corresponding pixel in the original detail enhancement matrix. Similarly, the spatial longitudinal gradient matrix is ​​formed by arranging the longitudinal gradient contribution values ​​according to the same rules, and the temporal gradient matrix is ​​obtained by arranging the temporal rate of change. The purpose of this is to integrate the gradient information of each pixel in different directions and time dimensions into the corresponding matrices for subsequent processing and analysis. For example, after calculating the neighborhood gradient, a pixel in the original detail enhancement matrix obtains its lateral gradient contribution, longitudinal gradient contribution, and temporal rate of change. When generating the corresponding matrices, these values ​​are placed in the elements corresponding to the pixel's position in the spatial lateral gradient matrix, spatial longitudinal gradient matrix, and temporal gradient matrix, respectively.

[0040] Step S236: Integrate the spatial horizontal gradient matrix, spatial vertical gradient matrix, and temporal gradient matrix to generate a set of spatiotemporal gradient components containing spatial horizontal gradient, spatial vertical gradient, and temporal gradient. The dimension of each component gradient matrix is ​​consistent with the detail enhancement matrix.

[0041] The integration operation combines the spatial horizontal gradient matrix, spatial vertical gradient matrix, and temporal gradient matrix to obtain a set of spatiotemporal gradient components containing these three gradients. To ensure consistency and accuracy in subsequent processing, the dimension of each component gradient matrix needs to be consistent with the detail enhancement matrix. This ensures that it accurately corresponds to each pixel in the original data during subsequent analysis and processing. For example, a three-dimensional data structure can be created, storing the spatial horizontal gradient matrix, spatial vertical gradient matrix, and temporal gradient matrix as different dimensions of the three-dimensional structure, thus forming the set of spatiotemporal gradient components.

[0042] Step S240: Perform orientation consistency verification on the spatiotemporal gradient component set. By calculating the gradient orientation angle deviation of adjacent pixels, isolated gradient components with deviations exceeding a preset angle threshold are removed, and gradient components with spatial continuity are retained to generate a valid gradient component set after verification. Spatial continuity is determined by checking whether the gradient orientation angle change rate of multiple consecutive pixels is within the allowable range.

[0043] The purpose of orientation consistency verification is to filter out gradient components with spatial continuity and remove isolated gradient components that do not meet the orientation consistency requirements. The gradient orientation angle deviation between adjacent pixels is the difference between the gradient orientation angles of adjacent pixels. By calculating this deviation value, it can be determined whether the gradient directions of adjacent pixels are consistent. A preset angle threshold is a pre-defined angle value. When the gradient orientation angle deviation between adjacent pixels exceeds this threshold, it indicates that the gradient component may be isolated and does not meet the spatial continuity requirement, and it needs to be removed. Spatial continuity is determined by examining the rate of change of the gradient orientation angles of multiple consecutive pixels. If the rate of change of the gradient orientation angles of multiple consecutive pixels is within the allowable range, it indicates that the gradient directions of these pixels are continuous. For example, within a region, if the gradient orientation angles of multiple consecutive pixels change relatively smoothly without sudden large changes, then the gradients of these pixels can be considered to have spatial continuity. By performing such verification and filtering on the spatiotemporal gradient component set, a valid gradient component set after verification is finally generated, providing more reliable data for subsequent analysis.

[0044] Step S250: Vector synthesize the spatial transverse gradient and spatial longitudinal gradient in the effective gradient component set, calculate the gradient direction angle and gradient magnitude. The gradient direction angle is obtained by processing the ratio of the transverse and longitudinal gradients using the arctangent function. The gradient magnitude is obtained by processing the sum of squares of the transverse and longitudinal gradients using the square root operation. The time gradient is introduced as a weighting coefficient to correct the magnitude value. The time gradient reflects the rate of change of radiation intensity with temperature excitation.

[0045] Vector synthesis is the process of combining the spatial transverse and longitudinal gradients from the effective gradient component set to obtain a comprehensive gradient vector. The gradient direction angle represents the direction of this comprehensive gradient vector and is calculated by processing the ratio of the transverse to longitudinal gradients using the arctangent function. The arctangent function accurately determines the direction angle of the gradient vector based on the relative magnitudes of the transverse and longitudinal gradients. The gradient magnitude represents the magnitude of the gradient vector and is obtained by taking the square root of the sum of the squares of the transverse and longitudinal gradients. The time gradient reflects the rate of change of radiation intensity with temperature excitation and is introduced as a weighting coefficient into the calculation of the gradient magnitude, applying a weighted correction. This is done to account for the impact of changes in radiation intensity over time on the gradient, making the calculated gradient information more accurately reflect the actual situation. For example, if the time gradient is large, it indicates a rapid change in radiation intensity, and the gradient magnitude will be weighted accordingly to highlight the impact of this rapid change; conversely, if the time gradient is small, the radiation intensity changes slowly, and the degree of weighting correction will be reduced accordingly.

[0046] Step S260: Based on the vector synthesis results, according to the spatial position correspondence of the spatiotemporally related radiation intensity matrix, the gradient direction angle is used as the direction component and the corrected gradient magnitude value is used as the magnitude component to generate a heat flux vector field containing a spatial distribution map of the direction component, a spatial distribution map of the magnitude component, and a time change trend label. The time change trend label uses different colors to indicate the change of the gradient magnitude value over time.

[0047] Based on the gradient direction angle obtained from vector synthesis and the corrected gradient magnitude, combined with the spatial correspondence of the spatiotemporally correlated radiation intensity matrix, a heat flux vector field is generated. The spatial distribution map of the direction component shows the distribution of the gradient direction angle throughout space. By mapping the gradient direction angle according to spatial location, the directional changes of heat flux at different locations can be visually observed. The spatial distribution map of the magnitude component presents the spatial distribution of the corrected gradient magnitude, reflecting the magnitude differences of heat flux at different locations. The temporal trend annotation uses different colors to indicate the change of gradient magnitude over time; for example, warm colors can represent an increase in gradient magnitude over time, and cool colors can represent a decrease. Based on this, the heat flux vector field integrates information on direction, magnitude, and temporal changes, providing more comprehensive and intuitive data for subsequent analysis of circuit board defects. For example, in the heat flux vector field, the changing trends of the direction and magnitude of heat flux over time in certain areas of the circuit board can be clearly seen, thus determining whether there are any anomalies in these areas.

[0048] Step S300: Associate and map the heat flux vector field with the circuit topology of the circuit board, and generate enhanced vector field data containing circuit connection relationships through vector field fusion under topological constraints.

[0049] Association mapping is the process of mapping and combining the heat flux vector field with the circuit topology of a circuit board. This mapping links heat flux information with the actual connections in the circuit. The circuit topology describes the connection relationships and layout information between various electrical components on the circuit board. Vector field fusion under topological constraints fuses the heat flux vector field while considering the constraints of the circuit topology, ensuring that the fused vector field reflects the impact of circuit connections on heat flux. Enhanced vector field data is the fused result, containing information about circuit connections. Compared to the original heat flux vector field, it provides richer and more accurate information for circuit board defect detection. For example, in a circuit board, the connection lines between certain components may affect the direction and magnitude of heat flux transfer; through association mapping and vector field fusion, these influencing factors can be reflected in the enhanced vector field data.

[0050] As one implementation method, step S300 can be specifically implemented as the following steps S310~S360: Step S310: Obtain the circuit topology data of the circuit board, parse the functional layer information in the data, and separate the three electrical functional layers: component layer, conductor layer, and pad layer. Each electrical functional layer contains the corresponding geometric contour coordinates, connection relationships, and design parameters.

[0051] Obtaining the circuit topology data of a circuit board can be achieved by reading the board's design files, which contain detailed information about the board. Parsing the functional layer information involves analyzing and processing the acquired data to extract information related to the electrical functional layers. The component layer contains information about each component on the board, such as its type and location; the conductor layer describes the layout and routing of the conductors connecting the components; and the pad layer contains information about the pads connecting the components to the conductors. Each electrical functional layer has corresponding geometric contour coordinates to determine its specific location on the board; the connection relationships describe the electrical connections between layers and between components within a layer; and the design parameters include parameters related to electrical performance, such as conductor width and pad size. For example, by parsing the design files, information such as the package contour coordinates and pin position coordinates of each component in the component layer, and the start and end coordinates of each conductor in the conductor layer, can be obtained.

[0052] As one implementation method, step S310 can be specifically implemented as the following steps S311~S316: Step S311: Obtain the circuit board design file, parse the layer description information, identify the layers containing electrical functions, and filter out the three core electrical function layers: component layer, conductor layer, and pad layer.

[0053] Circuit board design documents contain detailed design information, such as Gerber files and ODB++ files. Parsing layer description information involves analyzing and processing layer-related information in the design documents to identify layers containing electrical functions. These layers may contain information such as component drawings, conductor layouts, and pad designs. Filtering out the three core electrical function layers—component layers, conductor layers, and pad layers—involves selecting layers related to these three key layers from the identified electrical function layers. For example, a design document may contain multiple layers; some may be used for dimensioning, while others are used for drawing electrical components. By parsing and filtering the layer description information, the corresponding layers for component layers, conductor layers, and pad layers can be accurately identified.

[0054] Step S312: Extract data from the component layer to obtain the package outline coordinates, pin position coordinates and component number of each component. The package outline coordinates are represented by a polygon vertex sequence and the pin position coordinates are represented by two-dimensional coordinate points.

[0055] Data extraction from the component layer involves extracting key information related to the selected component layers from their corresponding layers. Package outline coordinates describe the outer boundary of the component package, represented by a sequence of polygon vertices. The coordinates of these vertices accurately delineate the component's shape. Pin position coordinates represent the specific locations of the component pins on the circuit board, expressed as two-dimensional coordinate points. Component numbers are unique identifiers assigned to distinguish different components. For example, for an integrated circuit chip, data extraction can yield the sequence of polygonal vertex coordinates of its package outline, the two-dimensional coordinates of each pin, and the chip's component number.

[0056] Step S313: Extract data from the conductor layer to obtain the starting point coordinates, ending point coordinates, intermediate inflection point coordinate sequence, and conductor width parameter for each conductor. The intermediate inflection point coordinate sequence constitutes the connection path of the conductor, and the conductor width parameter reflects the physical size characteristics of the conductor.

[0057] Data extraction from the conductor layer involves retrieving detailed information related to the conductor from its corresponding layer. The start and end coordinates determine the conductor's initial and final positions, while the sequence of intermediate inflection point coordinates describes the conductor's bends and turns during the connection process. Connecting these coordinates sequentially forms the complete connection path of the conductor. The conductor width parameter reflects the conductor's physical dimensions; conductors of different widths may exhibit different electrical performance. For example, when extracting conductor layer data, we can obtain the starting coordinates of a conductor as a two-dimensional coordinate point, the ending coordinates as another two-dimensional coordinate point, and several inflection point coordinates in between. These coordinate points, arranged sequentially, form the conductor's connection path, and we can also obtain the conductor's width parameter.

[0058] Step S314: Extract data from the pad layer to obtain the shape parameters, geometric center coordinates, and pin number of each component for each pad. The shape parameters include the pad's contour type and contour size parameters.

[0059] Data extraction from the pad layer involves retrieving information related to the pad from the corresponding layer. Shape parameters describe the pad's external features, including its outline type (e.g., circular, square) and outline dimensions (e.g., radius, side length). Geometric center coordinates determine the pad's center position on the circuit board, while the corresponding component pin number indicates which component's pin the pad is connected to. For example, for a circular pad, data extraction can obtain its radius as an outline dimension parameter, the two-dimensional coordinates of its center as its geometric center coordinates, and the corresponding component pin number.

[0060] Step S315: Establish the relationship between the three functional layers. Associate the component layer with the pad layer by the component pin number and associate the wire layer with the pad layer by the wire connection path, and clarify the electrical connection relationship between each layer structure.

[0061] Establishing the relationships between the three functional layers is to organically link the component layer, conductor layer, and pad layer to obtain a complete circuit topology. Component pin numbers allow us to associate components in the component layer with pads in the pad layer, as each pad is connected to a component pin; pin numbers accurately establish this association. Conductor connection paths connect conductors in the conductor layer to pads in the pad layer, since the start and end points of conductors typically connect to pads; the connection paths clearly define the relationship between conductors and pads. Based on this, the electrical connections between each layer are clarified, providing a foundation for subsequent analysis and processing. For example, component pin numbers indicate which pad a specific pin of a component is connected to, and conductor connection paths indicate which pads a specific conductor is connected to, thus constructing a complete circuit connection structure.

[0062] Step S316: Integrate the geometric contour coordinates, connection relationships, and design parameters of the component layer, conductor layer, and pad layer to obtain the circuit topology data.

[0063] Integrating the geometric contour coordinates, connection relationships, and design parameters of component layers, conductor layers, and pad layers is a process of summarizing and unifying the information extracted and established in the previous steps. Through this integration, relevant information from each functional layer can be combined to obtain complete circuit topology data. This data contains crucial information such as the location, connection relationships, and design parameters of each electrical component on the circuit board, providing a comprehensive and accurate data foundation for subsequent mapping with the heat flux vector field. For example, integrating the package contour coordinates and pin position coordinates of the component layer, the start coordinates, end coordinates, intermediate inflection point coordinate sequences, and conductor width parameters of the conductor layer, and the shape parameters, geometric center coordinates, and pin numbers of the component belonging to the pad layer according to certain rules yields a dataset containing all this information—the circuit topology data.

[0064] Step S320: Establish the spatial coordinate transformation relationship between the heat flux vector field and the circuit topology. By identifying the positioning markers on the edge of the circuit board, the physical coordinates of the topology are mapped to the pixel coordinate system of the heat flux vector field based on the affine transformation algorithm. The positioning markers have clear corresponding positions in both the topology and the heat flux vector field.

[0065] Establishing a spatial coordinate transformation relationship between the heat flux vector field and the circuit topology is to unify their coordinate systems, enabling accurate subsequent mapping. Positioning markers on the circuit board edge are special marks pre-set on the board edge; these markers have clear corresponding positions in both the circuit topology and the heat flux vector field. Affine transformation algorithms are commonly used coordinate transformation algorithms. They can map the physical coordinates of the topology to the pixel coordinate system of the heat flux vector field through a series of linear transformations and translations. For example, during circuit board design, positioning holes or special shapes are set on the edges as positioning markers. When acquiring heat flux vector field and circuit topology data, the positions of these positioning markers can be accurately identified. Through affine transformation algorithms, based on the correspondence of these positioning markers, the physical coordinates of each element in the circuit topology are converted to pixel coordinates in the heat flux vector field, thus achieving the unification of their coordinate systems.

[0066] Step S330: Extract the coordinate sequence of the center line of the conductor in the conductor layer of the circuit topology, smooth the center line, calculate the tangent direction angle of each point on the curve as the reference direction of the conductor, and generate a conductor direction reference vector field. The reference vector field contains the reference direction angle and reference magnitude of each conductor position.

[0067] Extracting the centerline coordinate sequence of conductors in the conductor layer of a circuit topology involves extracting the coordinate information of each conductor's centerline from the conductor layer data. The conductor centerline is a curve located at the midpoint of the conductor, and its coordinate sequence accurately describes the conductor's direction. Smoothing the centerline removes noise and irregular fluctuations from the coordinate sequence, making the curve smoother and more continuous. By calculating the tangent direction angle at each point on the curve, the reference direction of the conductor at each location can be obtained. The tangent direction angle reflects the instantaneous direction of the conductor at that point. Generating the conductor direction reference vector field combines the reference direction angle and reference magnitude at each conductor location. The reference magnitude can be determined based on conductor characteristics, such as the conductor's width. For example, for a curved conductor, by extracting its centerline coordinate sequence, smoothing it, calculating the tangent direction angle at each point on the curve, and determining the reference magnitude based on factors such as the conductor's width, the direction reference vector field for that conductor is generated.

[0068] Step S340: Compare the heat flux vector field with the conductor direction reference vector field point by point, calculate the direction angle deviation between the gradient direction angle and the reference direction angle at the corresponding position, and calculate the gradient magnitude value and the magnitude ratio of the reference magnitude. The direction angle deviation value is obtained by calculating the angle difference, and the magnitude ratio is obtained by calculating the magnitude value and the reference magnitude ratio.

[0069] Comparing the heat flux vector field with the conductor direction reference vector field point by point involves comparing elements at corresponding positions in both vector fields. Corresponding positions are points with the same spatial location in both the heat flux vector field and the conductor direction reference vector field. The deviation between the gradient direction angle and the reference direction angle at the corresponding position is calculated by calculating the difference between the two direction angles. This deviation reflects the degree of difference between the direction of the heat flux at that position and the conductor reference direction. The ratio of the gradient magnitude to the reference magnitude is calculated by dividing the gradient magnitude at that position in the heat flux vector field by the reference magnitude at the corresponding position in the conductor direction reference vector field. This ratio reflects the relative relationship between the magnitude of the heat flux and the conductor reference magnitude. For example, at the same position in both the heat flux vector field and the conductor direction reference vector field, the gradient direction angle of the heat flux is one angle, and the reference direction angle of the conductor is another angle. The difference between these two angles yields the direction angle deviation; simultaneously, the gradient magnitude of the heat flux is divided by the reference magnitude of the conductor to obtain the magnitude ratio.

[0070] As one implementation method, step S340 can be specifically implemented as the following steps S341~S345: Step S341: Traverse each pixel of the heat flux vector field, find the physical region corresponding to the position in the circuit topology through coordinate transformation relationship, and determine whether the region belongs to the conductor area, pad area or blank area. Only the conductor area and pad area are compared.

[0071] Traversing each pixel of the heat flux vector field is a process of visiting all pixels in the heat flux vector field in a specific order. Using the previously established coordinate transformation relationships, the coordinates of each pixel in the heat flux vector field can be converted into physical coordinates within the circuit topology, thus finding the physical region corresponding to that pixel's location within the circuit topology. Determining whether this region belongs to a conductor area, pad area, or blank area is based on the characteristics and relevant information of that physical region. A conductor area is the region where conductors are located in the circuit topology, a pad area is the region where pads are located, and a blank area is a region that belongs to neither a conductor area nor a pad area. Only conductor areas and pad areas are compared because these two areas are closely related to the electrical performance and defect detection of the circuit board; comparing these two areas can more effectively identify potential problems. For example, when traversing the heat flux vector field, for each pixel, its corresponding physical region in the circuit topology is found through coordinate transformation. If this region is a conductor area, the heat flux information of that pixel is compared with the conductor direction reference vector field.

[0072] Step S342: For a pixel in the conductor region, obtain the reference orientation angle and reference magnitude of the corresponding conductor position from the conductor direction reference vector field. The reference orientation angle is the tangent orientation angle of the conductor centerline, and the reference magnitude is positively correlated with the conductor width. Extract the gradient orientation angle and gradient magnitude of the pixel from the heat flux vector field, calculate the orientation angle deviation value, and if the deviation value exceeds half a circle angle, subtract the deviation value from the whole circle angle to obtain the actual deviation, and calculate the magnitude ratio.

[0073] For pixels in the conductor region, obtaining the reference orientation angle and reference magnitude of the corresponding conductor position from the conductor direction reference vector field involves finding relevant information about the conductor position in the conductor direction reference vector field based on the pixel's location. The reference orientation angle is the tangent orientation angle of the conductor's centerline, representing the conductor's direction at that location. The reference magnitude is positively correlated with the conductor width; that is, the wider the conductor, the larger the reference magnitude. Extracting the gradient orientation angle and gradient magnitude of the pixel from the heat flux vector field is crucial for obtaining the pixel's information within the heat flux vector field. Calculating the orientation angle deviation involves subtracting the reference orientation angle from the pixel's gradient orientation angle. If this difference exceeds half a circle, it is subtracted from the full circle to obtain the actual deviation, ensuring the deviation remains within a reasonable range. Calculating the magnitude ratio involves dividing the pixel's gradient magnitude by the reference magnitude. For example, for a pixel in the conductor region, the reference orientation angle and reference magnitude of the corresponding conductor position are obtained from the conductor direction reference vector field, and the gradient orientation angle and gradient magnitude of the pixel are extracted from the heat flux vector field. The orientation angle deviation and magnitude ratio of the two are calculated. If the orientation angle deviation exceeds half a circle angle, the corresponding adjustment is made.

[0074] Step S343: For a pixel in the pad area, set the reference direction angle as the radial direction of the pad, with the geometric center of the pad as the origin, and the direction angle of the line connecting the pixel and the center as the reference direction angle. The reference modulus is positively correlated with the pad size. Extract the gradient direction angle and gradient modulus value of the pixel from the heat flux vector field, and calculate the direction angle deviation value and modulus ratio value in the same way as the conductor area.

[0075] For pixels in the pad area, setting the reference orientation angle to the radial direction of the pad is determined based on the pad's geometry. The orientation angle of the line connecting the pixel to the center is taken as the reference orientation angle, with the pad's geometric center as the origin. The reference modulus is positively correlated with the pad size; that is, the larger the pad size, the larger the reference modulus. Extracting the gradient orientation angle and gradient modulus of the pixel from the heat flux vector field is crucial for obtaining information about the pixel within the heat flux vector field. The orientation angle deviation and modulus ratio are calculated using the same method as in the conductor area. This involves calculating the difference between the pixel's gradient orientation angle and the reference orientation angle; if the deviation exceeds half a circumference, adjustments are made. Simultaneously, the pixel's gradient modulus value is divided by the reference modulus to obtain the modulus ratio. For example, for a pixel in the pad area, the reference orientation angle and reference modulus are determined with the pad's geometric center as the origin. The gradient orientation angle and gradient modulus of the pixel are extracted from the heat flux vector field, and then the orientation angle deviation and modulus ratio are calculated in the same way as in the conductor area.

[0076] Step S344: For pixels in the curved area of ​​the conductor, the reference direction angle is calculated based on the tangent direction angle of the conductor's centerline at that location using the first derivative of the curve fitting.

[0077] For pixels in the curved region of a conductor, the reference orientation angle needs to be determined based on the tangent orientation angle of the conductor's centerline at that location. Calculating the tangent orientation angle using the first derivative of curve fitting is a method to accurately determine the conductor's orientation at the curved location. Curve fitting involves fitting the coordinate sequence of the conductor's centerline to obtain a curve function that approximates the conductor's centerline. The first derivative is the derivative of this curve function; its value at a given point represents the tangent slope at that point. By converting the tangent slope into an angle, the tangent orientation angle at that location can be obtained. For example, for a curved conductor, curve fitting is performed on the coordinate sequence of its centerline to obtain a polynomial function. The first derivative of this function is then calculated, and the x-coordinate of the pixel corresponding to the curved region of the conductor is substituted into the first derivative to obtain the tangent slope at that point. Converting the tangent slope into an angle gives the reference orientation angle for that pixel.

[0078] Step S345: Record the calculated orientation angle deviation value and magnitude ratio value, and generate a deviation value matrix and a ratio matrix. The deviation value matrix records the orientation angle deviation value of each pixel, and the ratio matrix records the magnitude ratio of each pixel. The deviation value matrix and the ratio matrix provide a quantitative basis for subsequent topology constraint correction. Each element value in the matrix reflects the degree of matching between the heat flux vector at the corresponding position and the topology.

[0079] Recording the calculated orientation angle deviation and modulus ratio values ​​involves storing the calculation results for each pixel, generating a deviation value matrix and a ratio matrix. Each element in the deviation value matrix corresponds to the orientation angle deviation value of a pixel, and each element in the ratio matrix corresponds to the modulus ratio of a pixel. These two matrices provide a quantitative basis for subsequent topology constraint correction, as the value of each element reflects the degree of matching between the heat flux vector at the corresponding location and the topology. If the orientation angle deviation value of a pixel is large, it indicates that the heat flux direction at that location differs significantly from the reference direction of the conductors or pads in the topology; if the modulus ratio deviates from the normal range, it indicates that the magnitude of the heat flux does not match the reference modulus of the topology. For example, after calculating the orientation angle deviation and modulus ratio values ​​for all pixels, these values ​​are stored in the deviation value matrix and the ratio matrix respectively. During subsequent topology constraint correction, the element values ​​in these matrices can be used to determine which locations require correction.

[0080] Step S350: Determine the topology constraint rules based on the orientation angle deviation value and the module length ratio value. When the orientation angle deviation value is within the allowable range and the module length ratio value is within the normal range, it is determined to be a normal region. When the orientation angle deviation value exceeds the allowable range or the module length ratio value exceeds the normal range, it is determined to be an abnormal region, and the topology constraint correction is performed on the gradient orientation angle and module length value.

[0081] Determining topology constraint rules based on orientation angle deviation and module-to-length ratio is to determine whether each area on the circuit board is normal and to correct abnormal areas. The allowable range and normal range are pre-set standard values ​​used to determine whether the orientation angle deviation and module-to-length ratio are within reasonable ranges. When the orientation angle deviation is within the allowable range and the module-to-length ratio is within the normal range, it indicates that the heat flux vector of that area matches the topology well, and it is determined to be a normal area. When the orientation angle deviation exceeds the allowable range or the module-to-length ratio exceeds the normal range, it indicates that the heat flux vector of that area does not match the topology, and it is determined to be an abnormal area. Topology constraint correction for the gradient orientation angle and module-to-length values ​​of abnormal areas involves adjusting these values ​​based on topology information to better conform to the actual circuit conditions. For example, for a certain area, if its orientation angle deviation exceeds the allowable range, it indicates that the direction of the heat flux differs significantly from the reference direction of the conductor or pad, and the gradient orientation angle needs to be corrected according to the reference direction of the topology; if the module-to-length ratio exceeds the normal range, it indicates that the magnitude of the heat flux does not match the reference module-to-length, and the gradient module-to-length value needs to be adjusted.

[0082] Step S360: Associate and label the corrected heat flux vector field with the key connection node positions in the circuit topology. Key connection nodes include component pin connection points and wire cross connection points, generating enhanced vector field data containing circuit connection relationships and topology constraint correction information.

[0083] Associating the corrected heat flux vector field with the locations of key connection nodes in the circuit topology involves mapping and marking the corrected heat flux information with the positions of these key connection nodes. Key connection nodes include component pin connections and wire crossings. Through association and annotation, the heat flux vector field can be combined with the location information of these key nodes, allowing the heat flux information to more accurately reflect the actual state of the circuit. Generating enhanced vector field data that includes circuit connection relationships and topology constraint correction information involves integrating the results of the association and annotation to obtain a new vector field data. This enhanced vector field data not only contains heat flux information but also information on circuit connection relationships and topology constraint corrections, providing richer and more accurate data for subsequent defect detection. For example, in the corrected heat flux vector field, the location of each key connection node is marked, and the heat flux information at that location is associated with the node information, ultimately generating enhanced vector field data containing all this information.

[0084] Step S400: Perform feature sparse coding processing on the enhanced vector field data, construct the correlation constraint matrix between defect features and circuit design specifications, and obtain the defect type characterization value through constraint optimization.

[0085] Performing sparse feature encoding on enhanced vector field data involves encoding the data to extract key features. Sparse encoding represents data as a linear combination of a small number of basis vectors, resulting in a sparse representation that highlights important features. Constructing a constraint matrix linking defect features to circuit design specifications involves associating and constraining defect features with the requirements of the circuit design specifications. The elements in the matrix represent the degree of matching between the defect features and the circuit design specifications. Obtaining the defect type characterization value through constraint optimization involves solving for a numerical value that characterizes the defect type while satisfying the constraint matrix. This value reflects the possible defect types present on the circuit board. For example, for enhanced vector field data, a sparse encoding algorithm is used to convert it into a sparse representation, then an constraint matrix is ​​constructed according to the circuit design specifications, and a constraint optimization algorithm is used to solve for the defect type characterization value.

[0086] As one implementation method, step S400 can be specifically implemented as the following steps S410~S460: Step S410: Divide the enhanced vector field data into three detection sub-regions according to the circuit topology: conductor region, pad region, and component pin region. Extract the vector field data of the conductor region and pad region as the defect detection objects.

[0087] Partitioning enhanced vector field data according to circuit topology involves dividing the data into different regions based on the circuit topology information. The conductor region is the area where conductors are located in the circuit, the pad region is the area where pads are located, and the component pin region is the area where component pins are located. Extracting vector field data from the conductor and pad regions is crucial for defect detection because these two areas are prone to defects on the circuit board. Analyzing the vector field data from these areas can more effectively detect circuit board defects. For example, based on the positional information of conductors and pads in the circuit topology, the enhanced vector field data can be divided into corresponding conductor, pad, and component pin regions, and the vector field data from these regions can be extracted for subsequent defect detection.

[0088] Step S420: Perform feature vectorization processing on the vector field data of each detection sub-region, arrange the orientation component and magnitude component of each pixel in the region in row priority order, and generate a region feature vector containing the orientation angle sequence and the magnitude value sequence, each occupying one dimension.

[0089] Feature vectorization of the vector field data for each detection sub-region converts the vector field data into feature vectors for subsequent processing and analysis. Arranging the orientation and magnitude components of each pixel within the region in row-major order combines the orientation angle and magnitude values ​​of the pixels in a specific order. Generating a region feature vector containing both the orientation angle and magnitude value sequences involves assembling the arranged orientation angle and magnitude value sequences into separate sequences, resulting in a two-dimensional feature vector, where each sequence occupies one dimension. For example, for the vector field data of a detection sub-region, arranging the orientation and magnitude components of each pixel in row-major order yields the orientation angle and magnitude value sequences; combining these two sequences forms the feature vector for that region.

[0090] Step S430: Construct an overcomplete sparse coding dictionary. The dictionary training samples are from the enhanced vector field data of multiple defect-free circuit boards. They are classified into wire regions and pad regions. A preset number of dictionary atoms are trained for each type of sample to generate an overcomplete dictionary containing two types of atoms. The dictionary atoms represent the normal vector field features of the corresponding regions.

[0091] Constructing an overcomplete sparse coding dictionary is for sparse representation of the feature vectors of the detection sub-regions. The dictionary training samples come from enhanced vector field data of multiple defect-free circuit boards, which represent the vector field features of the circuit boards under normal conditions. Classification by conductor and pad regions divides the training samples according to region type, as the vector field features of conductor and pad regions may differ. Training a predetermined number of dictionary atoms for each class of samples involves training a certain number of basis vectors, which serve as dictionary atoms. Generating an overcomplete dictionary containing both types of atoms involves integrating the dictionary atoms trained for conductor and pad regions to obtain an overcomplete dictionary containing both types of atoms. Dictionary atoms represent the normal vector field features of the corresponding region, and these atoms allow for sparse representation of the feature vectors of the detection sub-regions. For example, enhanced vector field data from multiple defect-free circuit boards can be collected, classified by conductor and pad regions, and a predetermined number of dictionary atoms can be trained for each class using a sparse coding algorithm. Finally, the two types of atoms can be integrated to form an overcomplete dictionary.

[0092] As one implementation method, step S430 can be specifically implemented as the following steps S431~S436: Step S431: Collect enhanced vector field data of multiple defect-free circuit boards as a training sample set, so that the samples cover the normal conductor area and pad area of ​​different batches and models of circuit boards.

[0093] Collecting enhanced vector field data from multiple defect-free circuit boards as a training sample set is to obtain a sufficiently large and diverse sample data set to ensure that the dictionary can accurately represent the vector field characteristics of normal circuit boards. Ensuring that the samples cover the normal conductor and pad areas of circuit boards from different batches and models is to improve the dictionary's generalization ability, as different batches and models of circuit boards may have design and manufacturing differences; covering these differences makes the dictionary more universal. For example, defect-free circuit boards can be selected from different production batches and models, their enhanced vector field data can be obtained, and this data can be collected to form the training sample set.

[0094] Step S432: Classify the training sample set into conductor regions and pad regions. The conductor region samples contain normal conductor vector field data with different widths and directions, and the pad region samples contain normal pad vector field data with different shapes and sizes.

[0095] Classifying the training sample set into conductor regions and pad regions is based on the region type to which the sample data belongs. Conductor region samples contain normal conductor vector field data of different widths and orientations. This is because different conductors may differ in width and orientation, and including these differences allows the dictionary to better represent the normal characteristics of conductor regions. Pad region samples contain normal pad vector field data of different shapes and sizes. Similarly, this is to account for the diversity of pads and enable the dictionary to accurately represent the normal characteristics of pad regions. For example, for each sample in the training sample set, it is classified according to whether its corresponding region is a conductor region or a pad region. Conductor region samples are further subdivided according to conductor width and orientation, while pad region samples are subdivided according to pad shape and size.

[0096] Step S433: Extract features for each type of sample, arrange the direction and magnitude components in the vector field data in row priority order, and generate sample feature vectors.

[0097] Feature extraction for each type of sample involves extracting key features from the sample's vector field data. Arranging the orientation and magnitude components of the vector field data in row-major order means sequentially arranging the orientation angle and magnitude values ​​of each pixel in each sample in row-major order, resulting in a one-dimensional vector, i.e., the sample feature vector. For example, for a sample in a conductor region, arranging the orientation and magnitude components of each pixel in row-major order yields the feature vector of that sample.

[0098] Step S434: Initialize the sparse coding dictionary parameters. The dictionary contains a preset number of dictionary atoms, with wire regions and pad regions each occupying half. The dimension of each dictionary atom is consistent with the feature dimension of the sample feature vector.

[0099] Initializing the sparse coding dictionary parameters prepares the dictionary for training. The dictionary contains a predetermined number of dictionary atoms, which are basis vectors used to sparsely represent the sample feature vectors. Allocating half to the wire region and half to the pad region ensures a balanced representation of features across both regions. The dimension of each dictionary atom matches the feature dimension of the sample feature vector, guaranteeing that the dictionary atoms can effectively perform a linear combination representation of the sample feature vectors.

[0100] Step S435: Train the dictionary for the feature vector of each type of sample through an iterative optimization algorithm, and alternately update the dictionary atoms and sparse coefficients so that the dictionary can accurately represent the normal vector field features of the corresponding region. The iteration stops when the reconstruction error is less than a preset threshold.

[0101] Iterative optimization of the dictionary training algorithm for the feature vectors of each class of samples involves continuously adjusting the dictionary atoms and sparse coefficients. Alternating updates to the dictionary atoms and sparse coefficients occur in each iteration: first, the sparse coefficients are updated to ensure the sample feature vector can be optimally represented using the current dictionary atoms; then, the dictionary atoms are updated to better represent the sample feature vector. The iteration stops when the reconstruction error is less than a preset threshold. The reconstruction error is the error when reconstructing the sample feature vector using the dictionary atoms and sparse coefficients. When this error is less than the preset threshold, it indicates that the dictionary can represent the sample feature vector well, and the iteration can stop. For example, using the K-SVD algorithm for dictionary training, in each iteration, the dictionary atoms are fixed, the sparse coefficients are calculated, the sparse coefficients are fixed, and the dictionary atoms are updated until the reconstruction error is less than the preset threshold.

[0102] Step S436: Integrate the dictionary atoms trained on the conductor region and the pad region to generate an overcomplete sparse coding dictionary containing features of the two types of regions. The dictionary can cover the vector field distribution pattern of the normal area of ​​the circuit board.

[0103] Integrating the dictionary atoms trained on the conductor and pad regions involves combining the dictionary atoms trained on the two regions to obtain an overcomplete sparse coding dictionary containing features from both types of regions. This dictionary can cover the vector field distribution pattern of normal areas on the circuit board because it contains normal feature information from both conductor and pad regions. For example, integrating 50 dictionary atoms trained on the conductor region and 50 dictionary atoms trained on the pad region yields an overcomplete sparse coding dictionary containing 100 dictionary atoms. This dictionary can be used to sparsely represent the feature vectors of the conductor and pad regions on the circuit board to detect anomalies.

[0104] Step S440: Sparsely encode the region feature vector, solve the sparse coefficient matrix based on the matching pursuit algorithm, add topological constraints during the encoding process, the atoms in the conductor region must satisfy the continuous change of direction angle, the atoms in the pad region must satisfy the linear decrease of the modulus value from the center to the edge, and the non-zero coefficients correspond to the activated defect candidate atoms.

[0105] Sparse encoding of region feature vectors represents them as linear combinations of dictionary atoms. Solving the sparse coefficient matrix using the matching pursuit algorithm involves determining the coefficient of each dictionary atom in the combination. The matching pursuit algorithm is a greedy algorithm that iteratively selects the dictionary atom that best matches the region feature vector and determines its coefficient. Topological constraints are added during the encoding process to account for the circuit board's topology, constraining the atoms in the conductor and pad regions. Conductor region atoms must satisfy a continuous change in direction angle, as the conductor's path on the circuit board should be continuous, without sudden jumps in direction angle. Pad region atoms must satisfy a linear decrease in magnitude from the center to the edge, consistent with the physical characteristics of pads. Non-zero coefficients correspond to activated defect candidate atoms; that is, when the coefficient of a dictionary atom is not zero, it indicates that the atom plays a role in the representation of the region feature vector and may correspond to a potential defect. For example, for a feature vector of a conductor region, a matching pursuit algorithm is used for sparse coding. During the coding process, it is checked whether each selected dictionary atom satisfies the constraint condition of continuous change of direction angle, and the sparse coefficient matrix is ​​determined. The dictionary atom corresponding to the non-zero coefficient is the defect candidate atom.

[0106] In one implementation, step S440 can be specifically implemented as steps S441 to S445: Step S441: Take the region feature vector as input, initialize the residual vector as the region feature vector, set the sparse coefficient matrix to zero, and set the iteration count counter to zero.

[0107] Using the region feature vector as input means providing the region feature vector, which needs to be sparsely encoded, to the matching pursuit algorithm. Initializing the residual vector to be the same as the region feature vector means initializing the residual vector to be the same as the region feature vector. The residual vector represents the part that has not yet been represented by dictionary atoms in each iteration. The sparse coefficient matrix is ​​initialized to a zero matrix because the coefficients of any dictionary atoms have not been determined at the beginning. The iteration counter is initialized to zero to record the number of iterations. For example, for the feature vector of a wire region, it is used as input, the residual vector is initialized to that feature vector, the sparse coefficient matrix is ​​initialized to an all-zero matrix, and the iteration counter is set to 0.

[0108] Step S442: During the iteration process, select the dictionary atom with the highest correlation to the current residual vector from the overcomplete sparse coding dictionary. The correlation is obtained by calculating the vector inner product.

[0109] During the iteration process, selecting the dictionary atom with the highest relevance to the current residual vector from the overcomplete sparse coding dictionary aims to find the dictionary atom that best represents the residual vector. Relevance is obtained through vector dot products, which measure the similarity between two vectors; a larger dot product value indicates greater similarity. For example, in each iteration, the vector dot product between the current residual vector and each dictionary atom in the overcomplete sparse coding dictionary is calculated, and the dictionary atom with the largest dot product value is selected as the dictionary atom with the highest relevance to the current residual vector.

[0110] Step S443: Update the coefficients corresponding to the selected dictionary atoms to the sparse coefficient matrix, and update the residual vector to the current residual vector minus the product of the selected atom and its corresponding coefficient.

[0111] Updating the coefficients of the selected dictionary atom in the sparse coefficient matrix involves recording the coefficients of that dictionary atom in the region feature vector representation. Updating the residual vector by subtracting the product of the selected atom and its corresponding coefficient from the current residual vector is to update the residual vector so that it represents the portion not yet represented by the dictionary atom. For example, assuming the selected dictionary atom is d, its corresponding coefficient is c, and the current residual vector is r, then updating the position of d in the sparse coefficient matrix to c, and updating the residual vector to rc×d.

[0112] Step S444: Add topological constraints and perform spatial continuity verification on the selected dictionary atoms. Atoms in the wire region must satisfy the requirement that the rate of change of the direction angle of continuous pixels is within the allowable range. Atoms in the pad region must satisfy the requirement that the modulus value decreases linearly from the center to the edge and the rate of change is within the allowable range. Atoms that do not meet the constraints are removed.

[0113] Incorporating topological constraints involves considering the circuit board's topological structure during sparse coding and performing spatial continuity checks on selected dictionary atoms. For atoms in the conductor region, the rate of change of the orientation angle of consecutive pixels must be within an allowable range to ensure the continuity of the conductor's path. For atoms in the pad region, the magnitude value must decrease linearly from the center to the edge, and the rate of change must be within an allowable range, conforming to the physical characteristics of pads. Atoms that do not meet the constraints are discarded; that is, if a selected dictionary atom does not satisfy these constraints, it will not be used to represent the region feature vector. For example, for a selected conductor region dictionary atom, the rate of change of the orientation angle of its consecutive pixels is checked; if the rate of change exceeds the allowable range, the atom is discarded.

[0114] Step S445: Repeat the process of selecting atoms, updating coefficients and residuals until the energy of the residual vector is less than the preset threshold or the number of iterations reaches the maximum limit.

[0115] The process of repeatedly selecting atoms, updating coefficients, and regressing is iterative until a stopping condition is met. The stopping condition is that the energy of the residual vector is less than a preset threshold or the maximum number of iterations is reached. The energy of the residual vector represents its magnitude. When the energy is less than the preset threshold, it indicates that the region's feature vector has been well represented. When the maximum number of iterations is reached, the iteration process stops to avoid infinite iteration. For example, in each iteration, the dictionary atom with the highest correlation to the current residual vector is selected, the sparse coefficient matrix and residual vector are updated, and the energy of the residual vector and the number of iterations are checked until the energy of the residual vector is less than the preset threshold or the maximum number of iterations is reached.

[0116] Step S450: Extract the dictionary atoms corresponding to the non-zero coefficients in the sparse coefficient matrix, and use the dictionary atoms as candidate features for defects. Each candidate feature contains a direction feature vector, a size feature vector, and spatial position coordinates in the detection sub-region, and constructs a set of candidate features for defects.

[0117] Extracting dictionary atoms corresponding to non-zero coefficients in the sparse coefficient matrix involves identifying these atoms with non-zero coefficients. These dictionary atoms are used as candidate defect features because they play a role in the representation of the region feature vector and may correspond to potential defects. Each candidate feature includes a direction feature vector, a size feature vector, and spatial coordinates within the detection sub-region. The direction and size feature vectors represent the direction and size characteristics of the dictionary atom, respectively, while the spatial coordinates indicate the specific location of the candidate feature within the detection sub-region. Constructing a set of candidate defect features involves collecting all candidate defect features into a single set, providing a foundation for subsequent analysis. For example, in the sparse coefficient matrix, all dictionary atoms corresponding to non-zero coefficients are identified, and the direction, size, and spatial coordinates of each atom are extracted. This information is then combined to form candidate defect features, and all candidate defect features are collected into a single set.

[0118] Step S460: Obtain the circuit design specification data of the circuit board, including the allowable range of orientation angle, allowable range of modulus value, and spatial continuity requirements of the normal area. Construct an association constraint matrix based on the defect candidate feature set and the design specification data. Rows correspond to candidate features, columns correspond to specification constraints, and matrix elements represent the deviation between features and constraints. Calculate the comprehensive deviation score of each candidate feature through an optimization algorithm that minimizes the deviation, which serves as the defect type characterization value.

[0119] Obtaining circuit design specification data for a circuit board involves extracting various specification requirements for normal areas from the circuit board's design documents, including allowable ranges for orientation angles, allowable ranges for module lengths, and spatial continuity requirements. Constructing an association constraint matrix based on the defect candidate feature set and design specification data associates the defect candidate features with the design specification constraints. Rows in the matrix correspond to candidate features, columns to specification constraints, and matrix elements represent the deviation degree between the feature and the constraint. The deviation degree indicates the degree of non-compliance of the candidate feature under a certain specification constraint. An optimization algorithm that minimizes the deviation degree is used to calculate the comprehensive deviation score for each candidate feature. This optimization algorithm can use methods such as linear programming to determine the comprehensive deviation score for each candidate feature by minimizing the deviation degree. This score serves as a defect type characterization value, used to determine whether a defect exists in the area corresponding to the candidate feature and the type of defect. For example, given a defect candidate feature set and circuit board design specification data, an association constraint matrix is ​​constructed, and a linear programming algorithm is used to minimize the deviation degree of the matrix elements to calculate the comprehensive deviation score for each candidate feature, which is then used as the defect type characterization value.

[0120] Step S500: Match the defect type characterization value with the circuit board layout and routing rule library to generate circuit board inspection results containing defect type identifiers and defect location coordinates.

[0121] Matching defect type representation values ​​with the PCB layout and routing rule base involves comparing the calculated defect type representation values ​​with the standards in the PCB layout and routing rule base to identify matching defect types. The PCB layout and routing rule base contains information such as the standard representation value ranges and defect type identifier codes for various defect types. Through matching, the defect type corresponding to each defect type representation value can be determined. Generating the PCB inspection result, which includes the defect type identifier and defect location coordinates, involves combining the matched defect type identifier and the corresponding defect location coordinates to obtain the final inspection result. The defect location coordinates can be obtained through previous processing and represent the specific location of the defect on the PCB. For example, for each defect type representation value, the matching standard representation value range is searched in the PCB layout and routing rule base to determine the corresponding defect type identifier, and then combined with the previously obtained defect location coordinates to generate the PCB inspection result.

[0122] As one implementation method, step S500 can be specifically implemented as the following steps S510~S560: Step S510: Obtain the circuit board layout and routing rule library, which contains the standard characterization value range, defect type identification code and defect severity level classification standard corresponding to different defect types.

[0123] Retrieving the circuit board layout and routing rule base involves obtaining relevant data from the location where the rule base is stored. The rule base contains standard characterization value ranges corresponding to different defect types. These ranges are used to determine whether the characterization value of a defect type conforms to the standard for that defect type. A defect type identifier code is a unique code assigned to each defect type to identify different defect types. Defect severity grading standards are used to classify the severity level of a defect based on the degree to which its characterization value exceeds the standard characterization value range. For example, retrieving the circuit board layout and routing rule base from the database includes standard characterization value ranges corresponding to different defect types such as short circuit defects and open circuit defects, as well as the identifier code and severity grading standards for each defect type.

[0124] Step S520: Perform threshold comparison on the defect type characterization value, compare each defect type characterization value with the standard characterization value range of different defect types in the layout and routing rule library, and determine the target standard characterization value range that matches the defect type characterization value.

[0125] Threshold comparison of defect type representation values ​​involves comparing each defect type representation value with the standard representation value range for different defect types in the place-and-route rule base. This comparison identifies the standard representation value range that best matches the defect type representation value, i.e., the target standard representation value range. For example, for a given defect type representation value, the standard representation value range for each defect type is checked sequentially in the place-and-route rule base to see if the value falls within a certain range. If it does, that range is determined as the target standard representation value range.

[0126] As one implementation method, step S520 can be specifically implemented as the following steps S521~S525: Step S521: Discretize the standard representation value range in the layout and routing rule base, divide each standard representation value range into multiple continuous sub-intervals, each sub-interval corresponds to an interval identifier, and establish a standard representation value interval index table.

[0127] Discretizing the standard representation value range in the layout and routing rule base involves dividing each standard representation value range into multiple consecutive sub-intervals for more precise matching. Each sub-interval corresponds to an interval identifier, which allows for quick location of the specific sub-interval. Creating a standard representation value interval index table involves organizing these sub-intervals and their corresponding interval identifiers into an index table for convenient subsequent queries. For example, a standard representation value range [a, b] can be divided into multiple sub-intervals such as [a, a+d], [a+d, a+2d], etc., assigning each sub-interval a unique interval identifier, and then organizing this information into a standard representation value interval index table.

[0128] Step S522: Using the defect type characterization value as the search keyword, perform an interval matching query in the standard characterization value interval index table to find the target sub-interval segment containing the defect type characterization value.

[0129] Using the defect type characteristic value as the search keyword, a range matching query in the standard characteristic value range index table searches for the sub-range segment containing that characteristic value. This query allows for quick location of the sub-range segment that best matches the defect type characteristic value.

[0130] Step S523: Trace the corresponding standard characterization value range according to the interval identifier of the target sub-interval segment, and determine the standard characterization value range as the target standard characterization value range that matches the defect type characterization value.

[0131] After identifying the target sub-interval, a reverse lookup is performed in the standard characterization value interval index table using its corresponding interval identifier to trace back to the standard characterization value range to which the sub-interval belongs. This process ensures that the standard range that best matches the defect type characterization value is accurately identified. Since the standard characterization value range was previously discretized into multiple sub-intervals, and these sub-intervals were derived from the original standard characterization value range, their corresponding original standard characterization value range can be accurately located using the interval identifier of the sub-interval. Once this range is found, it is determined as the target standard characterization value range that matches the current defect type characterization value.

[0132] Step S524: When the defect type characterization value matches multiple standard characterization value ranges at the same time, calculate the distance between the defect type characterization value and the center value of each standard characterization value range, and select the standard characterization value range with the smallest distance as the final target standard characterization value range.

[0133] In some cases, a defect type characteristic value may fall within multiple standard characteristic value ranges simultaneously. In such cases, further filtering is needed to identify the best-matching range. The distance between the defect type characteristic value and the center value of each matching standard characteristic value range is calculated. This distance reflects how close the defect type characteristic value is to the center of the standard range. The center value is the middle value of the standard characteristic value range and represents the typical characteristics of that range. By comparing these distances, the standard characteristic value range with the smallest distance is selected as the final target standard characteristic value range. This is because a smaller distance indicates that the defect type characteristic value is closer to the center of the standard range, meaning a higher degree of matching between the standard range and the defect type characteristic value, and a more accurate reflection of the defect type characteristics.

[0134] Step S525: Perform a second verification on the matching results to check whether the defect type corresponding to the target standard characterization value range is consistent with the region type of the defect candidate feature. If they are inconsistent, re-matching is performed.

[0135] To ensure the accuracy of the matching results, a secondary verification of the initially determined target standard characterization value range is required. This involves checking whether the defect type corresponding to the target standard characterization value range matches the region type where the defect candidate feature is located. Different region types, such as conductor regions and pad regions, may contain different types of defects, and each defect type has its own manifestations and characteristics in its corresponding region. If the defect type corresponding to the target standard characterization value range does not match the region type of the defect candidate feature, the current matching result may be inaccurate, and a rematch is necessary. By searching for a suitable standard characterization value range again in the layout and routing rule base, the final determined target standard characterization value range is matched with the region type of the defect candidate feature and the actual defect situation, thus improving the reliability of defect detection.

[0136] Step S530: Generate a defect type identifier based on the defect type identifier code corresponding to the target standard characterization value range, and determine the defect severity level based on the degree to which the defect type characterization value exceeds the standard characterization value range, combined with the defect severity level classification standard.

[0137] After determining the target standard representation value range, a specific defect type identifier is generated based on the defect type identifier code corresponding to that range. The defect type identifier code is a unique code that identifies different defect types, allowing for accurate identification of the specific defect type. Simultaneously, the severity level of the defect is determined based on the degree to which the defect type representation value exceeds the target standard representation value range, combined with the defect severity level classification standard in the circuit board layout and routing rule base. If the defect type representation value deviates slightly from the standard range, it may correspond to a milder defect severity level; conversely, if the deviation is significant, it may correspond to a more severe level.

[0138] Step S540: Trace the spatial coordinates of the candidate features of the defect type characterization value in the enhanced vector field data, and map the spatial coordinates of the enhanced vector field data to the physical coordinate system of the circuit board through coordinate transformation to generate defect location coordinates.

[0139] To accurately determine the actual location of a defect on the circuit board, it is necessary to trace the spatial coordinates of the candidate defect features corresponding to the defect type characterization value in the enhancement vector field data. These coordinates record the relative position information of the candidate defect features in the enhancement vector field. Then, using a pre-defined coordinate transformation method, the spatial coordinates of the enhancement vector field data are mapped to the physical coordinate system of the circuit board. The physical coordinate system of the circuit board is established based on the actual physical dimensions and layout of the circuit board and can accurately reflect the actual location of the defect on the circuit board. Through coordinate transformation, the relative position information in the enhancement vector field can be converted into absolute position information in the physical space of the circuit board, thereby generating defect location coordinates. This enables the rapid and accurate location of the defect during subsequent repair or quality assessment processes.

[0140] As one implementation method, step S540 can be specifically implemented as the following steps S541~S546: Step S541: Obtain the non-zero sparse coefficient position index of the defect candidate feature corresponding to the defect type characterization value in the sparse coding result, and trace the corresponding dictionary atom in the sparse coding dictionary based on the non-zero sparse coefficient position index.

[0141] In the sparse coding result, each defect candidate feature corresponds to a non-zero coefficient in the sparse coefficient matrix. By obtaining the position index of these non-zero coefficients, the specific position of the defect candidate feature corresponding to the defect type representation value in the sparse coding result can be determined. Then, based on these non-zero sparse coefficient position indices, the atomic index of the corresponding dictionary atom is traced in the sparse coding dictionary. The sparse coding dictionary is constructed in the previous processing and contains a series of dictionary atoms, each atom representing a feature pattern.

[0142] Step S542: Find the sample space position coordinates corresponding to the dictionary atom during the training process by using the atom index. The sample space position coordinates are relative coordinates in the augmented vector field data, including horizontal and vertical coordinates.

[0143] Based on the atom index obtained in the previous step, the sample space coordinates corresponding to the dictionary atom are searched in the training data of the sparse coding dictionary. During dictionary training, each dictionary atom is associated with its corresponding sample data, and its position information in the sample space is recorded. These sample space coordinates are relative coordinates in the augmented vector field data, represented in the form of horizontal and vertical coordinates. They reflect the relative position of the feature represented by the dictionary atom in the augmented vector field data, providing a starting point for subsequently converting it to coordinates in the circuit board physical coordinate system.

[0144] Step S543: Obtain the transformation parameters between the spatial coordinate system of the enhanced vector field data and the physical coordinate system of the circuit board. The transformation parameters are predetermined through calibration experiments and include scaling factors and offsets.

[0145] To accurately map the spatial coordinates of the augmented vector field data to the physical coordinate system of the circuit board, transformation parameters between the two are required. These transformation parameters are predetermined through calibration experiments. Calibration experiments typically use reference points with known locations to measure the coordinates of the augmented vector field data in both the spatial coordinate system and the circuit board's physical coordinate system. The transformation relationship between the two is then calculated mathematically. The transformation parameters mainly include a scaling factor and an offset. The scaling factor adjusts the scale of the coordinates to accommodate the difference in scale between the two coordinate systems; the offset adjusts the origin position of the coordinates to align the origins of the two coordinate systems. Using these transformation parameters, an accurate transformation from the spatial coordinate system of the augmented vector field data to the physical coordinate system of the circuit board can be achieved.

[0146] Step S544: Multiply the sample space position coordinates by the scaling factor and add the offset, then perform coordinate transformation calculation to obtain the absolute coordinate values ​​in the physical coordinate system of the circuit board.

[0147] After obtaining the sample space location coordinates and transformation parameters, calculations are performed according to the coordinate transformation rules. First, the sample space location coordinates are multiplied by a scaling factor. This step is to adjust the scale of the coordinates to match the scale of the circuit board's physical coordinate system. Then, an offset is added to adjust the origin of the coordinates so that it aligns with the origin of the circuit board's physical coordinate system. Through this calculation process, the relative coordinates in the enhanced vector field data are converted into absolute coordinate values ​​in the circuit board's physical coordinate system. These absolute coordinate values ​​can accurately represent the actual location of the defect on the circuit board.

[0148] Step S545: Perform precision processing on the absolute coordinate values, retain the coordinate precision of the preset number of decimal places, and remove noise interference in the coordinate values.

[0149] After obtaining the absolute coordinate values ​​in the physical coordinate system of the circuit board, these coordinate values ​​need to be processed for precision due to potential errors and noise during measurement and calculation. By retaining a preset number of decimal places, the accuracy of the coordinate values ​​can be controlled, avoiding unnecessary interference caused by excessive decimal places. Simultaneously, noise interference in the coordinate values ​​needs to be removed. This noise may be caused by errors in the measuring equipment, rounding errors during data processing, and other factors. Through filtering, smoothing, and other processing methods, this noise can be removed from the coordinate values, making the final coordinate values ​​more accurate and reliable, and more precisely indicating the physical location of defects on the circuit board surface.

[0150] Step S546: Use the processed absolute coordinate values ​​as defect location coordinates. The defect location coordinates can accurately indicate the physical location of the defect on the circuit board surface.

[0151] The absolute coordinates, after precision processing and noise removal, are determined as the defect location coordinates. These coordinates undergo a series of processing and transformations to accurately reflect the actual physical location of the defect on the circuit board surface. In subsequent defect repair or quality assessment processes, these coordinates can be used to quickly locate the defect, improving repair efficiency and the accuracy of quality assessment. Whether manual repair or automated repair equipment is used, these precise coordinates ensure effective defect handling.

[0152] Step S550: Integrate and encapsulate the defect type identifier, defect severity level, and defect location coordinates according to a preset data format. The data format includes a defect type field, a severity field, and a location coordinate field.

[0153] To facilitate subsequent data management and use, the defect type identifier, defect severity level, and defect location coordinates need to be integrated and encapsulated according to a preset data format. This preset data format is predefined and includes a defect type field, a severity field, and a location coordinate field. The defect type identifier is placed in the defect type field, which clearly indicates the specific type of defect; the defect severity level is placed in the severity field to describe the severity of the defect; and the defect location coordinates are placed in the location coordinate field to accurately indicate the location of the defect. Through this integration and encapsulation, important defect-related information is organized into a unified data structure, facilitating storage, transmission, and processing.

[0154] Step S560: Generate circuit board inspection results containing defect type identifiers and defect location coordinates. The inspection results can be directly used for subsequent defect repair or quality assessment.

[0155] After a series of processing and integration steps, the final circuit board inspection result, including defect type identification and defect location coordinates, is generated. This inspection result is the final output of the entire circuit board inspection method, which integrates defect type and location information, providing a direct basis for subsequent defect repair or quality assessment.

[0156] The various algorithms involved in the above descriptions of the embodiments of this invention can all be obtained from relevant content in the prior art, and will not be elaborated upon further in the embodiments of this invention. Furthermore, those skilled in the art can supplement the details based on common knowledge in the field when implementing the solutions of this invention. For example, based on common knowledge in the field, they can use normalization to eliminate dimensional conflicts before feature fusion, use interpolation to eliminate dimensional differences, reasonably set thresholds based on historical data, experience, or business scenario requirements, train the model based on a general model training method, set the number of layers in the model structure based on actual needs, select activation functions, etc. This invention will not provide redundant descriptions of overly detailed implementation processes. For example, in the vector synthesis step, when introducing the time gradient as a weighting coefficient to weight and correct the magnitude value, those skilled in the art can calculate the time-varying weight factor based on the time gradient, which is obtained through the normalized value of the time gradient and reflects the rate of change of radiation intensity with temperature excitation; the time-varying weight factor is used to weight and correct the magnitude value to generate a weighted magnitude value.

[0157] Please see Figure 2 , Figure 2 This is a schematic diagram of a computer system provided in an embodiment of the present invention. The computer system includes at least a processor 101, a communication interface 102, and a memory 103. The processor 101, communication interface 102, and memory 103 can be connected via a bus or other means. The processor 101 (or Central Processing Unit, CPU) is the computing and control core of the computer system, capable of parsing various instructions and processing various data within the computer system. The communication interface 102 may optionally include a standard wired interface or a wireless interface (such as Wi-Fi, mobile communication interface, etc.), and can be used to send and receive data under the control of the processor 101; the communication interface 102 can also be used for data transmission and interaction within the computer system. The memory 103 is a storage device in the computer system used to store programs and data. It is understood that the memory 103 here can include the computer system's built-in memory, or it can include extended memory supported by the computer system. The memory 103 provides storage space, which stores the computer system's operating system; this invention does not limit this storage space.

[0158] In one embodiment, the processor 101 executes the artificial intelligence-based circuit board defect identification method provided above in the embodiments of the present invention by running a computer program in the memory 103.

Claims

1. A method for identifying circuit board defects based on artificial intelligence, characterized in that, The method includes: The infrared radiation energy distribution data of the circuit board surface under a preset temperature excitation condition is obtained, and the infrared radiation energy distribution data includes the response curves of the radiation intensity of different regions changing with time. A gradient field reconstruction operation is performed on the infrared radiation energy distribution data. The heat flux vector field of the defect region is generated by calculating the rate of change of radiation intensity of adjacent pixels. The heat flux vector field contains spatial distribution information of directional and magnitude components. The heat flux vector field is associated with the circuit topology of the circuit board and mapped. Enhanced vector field data containing circuit connection relationships is generated by vector field fusion under topological constraints. The enhanced vector field data is subjected to feature sparse coding processing to construct the correlation constraint matrix between defect features and circuit design specifications, and the defect type characterization value is obtained by constraint optimization. The defect type characterization value is matched with the circuit board layout and routing rule library to generate circuit board inspection results containing defect type identifiers and defect location coordinates.

2. The method according to claim 1, characterized in that, The gradient field reconstruction operation on the infrared radiation energy distribution data generates a heat flux vector field for the defect region by calculating the rate of change of radiation intensity of adjacent pixels. This heat flux vector field includes spatial distribution information of its direction and magnitude components, including: The infrared radiation energy distribution data is spatiotemporally aligned according to the temperature excitation time series, and the radiation intensity data of different timestamps are mapped to a unified spatial grid to generate a spatiotemporally correlated radiation intensity matrix. Each element of the radiation intensity matrix contains a spatial horizontal coordinate, a spatial vertical coordinate, and a radiation intensity value corresponding to the timestamp. Multi-scale Gaussian filtering is performed on the spatiotemporally correlated radiation intensity matrix. Convolution operations are then performed on the matrices based on Gaussian kernels corresponding to different defect types to obtain three filter matrices corresponding to different defect types. The difference between the filter matrices of adjacent defect types is used to extract radiation intensity detail features and generate a detail enhancement matrix. The detail enhancement matrix is ​​subjected to neighborhood gradient calculation. Within a preset neighborhood window, the difference in radiation intensity between adjacent pixels in the horizontal and vertical directions is calculated respectively. The radiation intensity change rate in the time dimension is introduced. The time dimension change rate is obtained by calculating the difference in radiation intensity between the current timestamp and the previous timestamp, generating a set of spatiotemporal gradient components including spatial horizontal gradient, spatial vertical gradient, and time gradient. The spatiotemporal gradient component set is subjected to orientation consistency verification. By calculating the gradient orientation angle deviation of adjacent pixels, isolated gradient components with deviations exceeding a preset angle threshold are removed, and gradient components with spatial continuity are retained to generate a valid gradient component set after verification. The spatial transverse gradient and spatial longitudinal gradient in the effective gradient component set are vector synthesized to calculate the gradient direction angle and gradient magnitude. The time gradient is introduced as a weighting coefficient to correct the magnitude value. The time gradient reflects the rate of change of radiation intensity with temperature excitation. Based on the vector synthesis results, according to the spatial position correspondence of the spatiotemporally correlated radiation intensity matrix, the gradient direction angle is used as the direction component and the corrected gradient magnitude value is used as the magnitude component to generate a heat flux vector field containing a spatial distribution map of the direction component, a spatial distribution map of the magnitude component, and a time change trend label. The time change trend label uses different colors to indicate the change of the gradient magnitude value over time.

3. The method according to claim 2, characterized in that, The process involves performing multi-scale Gaussian filtering on the spatiotemporally correlated radiation intensity matrix, sequentially convolving the matrices based on Gaussian kernels corresponding to different defect types to obtain three filter matrices for different defect types, and extracting radiation intensity detail features by subtracting the filter matrices of adjacent defect types to generate a detail enhancement matrix, including: The Gaussian filter scale sequence is determined based on the characteristics of the surface defects of the circuit board. The pad micro defects correspond to the first scale Gaussian kernel, the conductor fine defects correspond to the second scale Gaussian kernel, and the area defects correspond to the third scale Gaussian kernel. The pad micro defects correspond to the small structural anomalies in the pad area of ​​the circuit board, the conductor fine defects correspond to the small structural anomalies in the conductor area, and the area defects correspond to the structural anomalies in a larger area. Three Gaussian kernel matrices are generated based on the scale sequence. The size of each Gaussian kernel matrix is ​​determined according to the characteristic size of the corresponding defect type. Smaller kernel matrices correspond to micro defects on pads, medium-sized kernel matrices correspond to fine defects on wires, and larger kernel matrices correspond to regional defects. The matrix element values ​​are calculated using a Gaussian function and then normalized. The spatiotemporally correlated radiation intensity matrix is ​​convolved with three Gaussian kernel matrices respectively. During the convolution process, the matrix boundaries are processed based on a symmetric filling method to generate three filter matrices corresponding to pad micro-defects, wire fine defects, and region defects. Calculate the difference between adjacent defect type filtering matrices, extract minute detail features by subtracting the pad micro-defect filtering matrix from the conductor fine defect filtering matrix, extract conventional detail features by subtracting the conductor fine defect filtering matrix from the region defect filtering matrix, and add the two detail feature matrices element by element to generate a preliminary detail matrix. The initial detail matrix is ​​subjected to scale-weighted fusion. Based on the distribution probability of different defect types in the circuit board, the corresponding weights of the micro-defect features and the regular detail features are assigned. The weighted sum is then used to generate a detail enhancement matrix. The detail enhancement matrix retains the radiation intensity variation features of different defect types. The detail signal-to-noise ratio of the micro-defect region of the pad is increased to a preset multiple of the original matrix, providing clear feature input for subsequent gradient calculation.

4. The method according to claim 3, characterized in that, The detail enhancement matrix is ​​subjected to neighborhood gradient calculation. Within a preset neighborhood window, the difference in radiance intensity between adjacent pixels in the horizontal and vertical directions is calculated respectively. A radiance intensity change rate in the time dimension is introduced, which is calculated using the difference in radiance intensity between the current timestamp and the previous timestamp. This generates a set of spatiotemporal gradient components containing spatial horizontal gradient, spatial vertical gradient, and temporal gradient, including: The detail enhancement matrix is ​​subjected to boundary expansion processing. The neighborhood information of the edge pixels of the matrix is ​​supplemented based on the mirror filling method to generate an expanded detail matrix after boundary expansion. The number of edge pixels of the expanded detail matrix matches the preset neighborhood window size. Slide a preset neighborhood window in the extended detail matrix, and extract the radiation intensity value of the center pixel and its horizontal and vertical adjacent pixels in each window to obtain the radiation intensity value of the center pixel, the radiation intensity value of the horizontal neighborhood, and the radiation intensity value of the vertical neighborhood. The difference between the radiation intensity value of the center pixel and the radiation intensity value of the horizontal neighborhood is calculated as the gradient contribution value in the horizontal direction, and the difference between the radiation intensity value of the center pixel and the radiation intensity value of the vertical neighborhood is calculated as the gradient contribution value in the vertical direction. Extract the radiation intensity values ​​at the corresponding positions of the current timestamp and the previous timestamp, and calculate the difference between the two as the radiation intensity change rate in the time dimension. The radiation intensity change rate reflects the dynamic response speed of radiation intensity with temperature excitation. Arrange the lateral gradient contribution values ​​of all pixels according to the spatial position of the original detail enhancement matrix to generate a spatial lateral gradient matrix. Arrange the vertical gradient contribution values ​​of all pixels according to the same spatial position to generate a spatial vertical gradient matrix. Arrange the temporal change rate of all pixels according to the same spatial position to generate a temporal gradient matrix. The spatial horizontal gradient matrix, the spatial vertical gradient matrix, and the temporal gradient matrix are integrated to generate a set of spatiotemporal gradient components containing spatial horizontal gradient, spatial vertical gradient, and temporal gradient. The dimension of each component gradient matrix is ​​consistent with the detail enhancement matrix.

5. The method according to claim 1, characterized in that, The step of associating and mapping the heat flux vector field with the circuit topology of the circuit board, and generating enhanced vector field data containing circuit connection relationships through vector field fusion under topological constraints, includes: Obtain the circuit topology data of the circuit board, parse the functional layer information in the data, and separate three electrical functional layers: component layer, conductor layer, and pad layer. Each electrical functional layer contains the corresponding geometric contour coordinates, connection relationships and design parameters. Establish the spatial coordinate transformation relationship between the heat flux vector field and the circuit topology. By identifying the positioning markers on the edge of the circuit board, the physical coordinates of the topology are mapped to the pixel coordinate system of the heat flux vector field. The positioning markers have clear corresponding positions in both the topology and the heat flux vector field. Extract the coordinate sequence of the center line of the conductor layer in the circuit topology, smooth the center line, calculate the tangent direction angle of each point on the curve as the reference direction of the conductor, and generate a conductor direction reference vector field. The reference vector field includes the reference direction angle and reference magnitude of each conductor position. The heat flux vector field is compared point by point with the conductor direction reference vector field. The direction angle deviation between the gradient direction angle and the reference direction angle at the corresponding position is calculated, and the magnitude ratio between the gradient magnitude and the reference magnitude is calculated. The topological constraint rules are determined based on the orientation angle deviation and the module-to-length ratio. When the orientation angle deviation is within the allowable range and the module-to-length ratio is within the normal range, it is determined to be a normal region. When the orientation angle deviation exceeds the allowable range or the module-to-length ratio exceeds the normal range, it is determined to be an abnormal region, and the gradient orientation angle and module-to-length ratio are corrected by topological constraints. The corrected heat flux vector field is associated with and labeled with the locations of key connection nodes in the circuit topology, including component pin connection points and wire cross connection points, to generate enhanced vector field data containing circuit connection relationships and topology constraint correction information.

6. The method according to claim 5, characterized in that, The process involves acquiring the circuit topology data of the circuit board, parsing the functional layer information within the data, and separating three electrical functional layers: the component layer, the conductor layer, and the pad layer. Each electrical functional layer contains corresponding geometric contour coordinates, connection relationships, and design parameters, including: Obtain the circuit board design files, parse the layer description information, identify the layers containing electrical functions, and filter out the three core electrical function layers: component layer, conductor layer, and pad layer. Data is extracted from the component layer to obtain the package outline coordinates, pin position coordinates and component number of each component. The package outline coordinates are represented by a sequence of polygon vertices and the pin position coordinates are represented by two-dimensional coordinate points. Data is extracted from the conductor layer to obtain the starting point coordinates, ending point coordinates, intermediate inflection point coordinate sequence, and conductor width parameter for each conductor. The intermediate inflection point coordinate sequence constitutes the connection path of the conductor, and the conductor width parameter reflects the physical size characteristics of the conductor. Data is extracted from the pad layer to obtain the shape parameters, geometric center coordinates, and pin number of the component to which each pad belongs. The shape parameters include the outline type and outline size parameters of the pad. Establish the relationship between the three functional layers, associate the component layer with the pad layer by component pin number, and associate the wire layer with the pad layer by wire connection path, and clarify the electrical connection relationship between each layer structure; The geometric contour coordinates, connection relationships, and design parameters of the component layer, conductor layer, and pad layer are integrated to form circuit topology data.

7. The method according to claim 5, characterized in that, The step of comparing the heat flux vector field with the conductor direction reference vector field point by point, calculating the direction angle deviation between the gradient direction angle and the reference direction angle at the corresponding position, and calculating the ratio of the gradient magnitude to the reference magnitude includes: Traverse each pixel of the heat flux vector field, find the corresponding physical region in the circuit topology through coordinate transformation, and determine whether the region belongs to the conductor area, pad area or blank area. Only the conductor area and pad area are compared. For a pixel in the conductor region, the reference orientation angle and reference magnitude of the corresponding conductor position are obtained from the conductor direction reference vector field. The reference orientation angle is the tangent orientation angle of the conductor centerline, and the reference magnitude is positively correlated with the conductor width. The gradient orientation angle and gradient magnitude of the pixel are extracted from the heat flux vector field. The orientation angle deviation value is calculated. If the deviation value exceeds half a circle angle, the deviation value is subtracted from the whole circle angle to obtain the actual deviation, and the magnitude ratio is calculated. For pixels in the pad area, the reference orientation angle is set as the radial direction of the pad, with the geometric center of the pad as the origin, and the orientation angle of the line connecting the pixel and the center as the reference orientation angle. The reference modulus is positively correlated with the pad size. The gradient orientation angle and gradient modulus value of the pixel are extracted from the heat flux vector field, and the orientation angle deviation value and modulus ratio value are calculated in the same way as the conductor area. For pixels in the curved region of the conductor, the reference orientation angle is calculated based on the tangent orientation angle of the conductor's centerline at that location, using the first derivative of curve fitting. The calculated orientation angle deviation value and magnitude ratio are recorded to generate a deviation value matrix and a ratio matrix. The deviation value matrix records the orientation angle deviation value of each pixel, and the ratio matrix records the magnitude ratio of each pixel.

8. The method according to claim 1, characterized in that, The enhanced vector field data undergoes feature sparse encoding processing to construct a correlation constraint matrix between defect features and circuit design specifications. Defect type characterization values ​​are obtained through constraint optimization, including: The enhanced vector field data is partitioned according to the circuit topology, into three detection sub-regions: wire region, pad region, and component pin region. The vector field data of the wire region and pad region are extracted as defect detection objects. The vector field data of each detection sub-region is processed into feature vectorization. The orientation component and magnitude component of each pixel in the region are arranged in row priority order to generate a region feature vector containing orientation angle sequence and magnitude value sequence, with each of the orientation angle sequence and magnitude value sequence occupying one dimension. An overcomplete sparse coding dictionary is constructed. The dictionary training samples are derived from the enhanced vector field data of multiple defect-free circuit boards. The samples are classified into wire regions and pad regions. A preset number of dictionary atoms are trained for each type of sample to generate an overcomplete dictionary containing two types of atoms. The dictionary atoms represent the normal vector field features of the corresponding regions. The feature vector of the region is sparsely encoded, and the sparse coefficient matrix is ​​solved based on the matching pursuit algorithm. Topological constraints are added during the encoding process. The atoms in the conductor region must satisfy the continuous change of direction angle, and the atoms in the pad region must satisfy the linear decrease of the modulus value from the center to the edge. Non-zero coefficients correspond to activated defect candidate atoms. Extract dictionary atoms corresponding to non-zero coefficients in the sparse coefficient matrix, and use dictionary atoms as candidate features of defects. Each candidate feature contains a direction feature vector, a size feature vector, and spatial position coordinates in the detection sub-region to construct a set of candidate features of defects. Obtain circuit design specification data for the circuit board, including the allowable range of orientation angle, allowable range of modulus value, and spatial continuity requirements for the normal area. Construct an association constraint matrix based on the defect candidate feature set and the design specification data. Rows correspond to candidate features, columns correspond to specification constraints, and matrix elements represent the deviation between features and constraints. Calculate the comprehensive deviation score of each candidate feature using an optimization algorithm that minimizes the deviation, which serves as the defect type characterization value.

9. The method according to claim 8, characterized in that, The construction of the overcomplete sparse coding dictionary involves training samples from enhanced vector field data of multiple defect-free circuit boards, categorized by conductor regions and pad regions. A preset number of dictionary atoms are trained for each category, generating an overcomplete dictionary containing atoms from both categories, including: Enhanced vector field data from multiple defect-free circuit boards were collected as a training sample set, ensuring that the samples covered normal conductor areas and pad areas of circuit boards from different batches and models. The training sample set is classified into conductor region and pad region. The conductor region samples contain normal conductor vector field data with different widths and directions, while the pad region samples contain normal pad vector field data with different shapes and sizes. For each type of sample, feature extraction is performed. The direction and magnitude components in the vector field data are arranged in row priority order to generate sample feature vectors. Initialize the sparse coding dictionary parameters. The dictionary contains a preset number of dictionary atoms, with wire regions and pad regions each occupying half. The dimension of each dictionary atom is consistent with the feature dimension of the sample feature vector. The dictionary is trained on the feature vector of each class of samples by an iterative optimization algorithm, and the dictionary atoms and sparse coefficients are updated alternately. The iteration stops when the reconstruction error is less than a preset threshold. The dictionary atoms trained on the conductor region and the pad region are integrated to generate an overcomplete sparse coding dictionary containing features of both types of regions.

10. A computer system, characterized in that, include: A memory, wherein a computer program is stored; A processor for loading the computer program to implement the artificial intelligence-based circuit board defect identification method as described in any one of claims 1-9.