A visual inspection method for solder resist ink thickness uniformity

CN123015432APending Publication Date: 2026-10-30梅州市鸿利线路板有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611157631.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本申请提供一种阻焊油墨厚度均匀性的视觉检测方法,旨在解决上述背景技术中提到的厚度判定的误检、漏检或稳定性不足的问题

Benefits of technology

本方案依据局部有效模态数量自适应切换融合策略,大幅提高了输出稳定性与物理可解释性。不同于常规加权平均或拼接操作可能引入冗余干扰,本发明根据一致性筛选后的剩余通道数智能选择中位数融合、几何平均或单通道增强模式:多模态共存时利用中位数抑制离群响应,双通道情形下采用乘积型几何平均突出协同激活效应,单一存活通道则结合空间上下文校正进行合理外推,既避免信息丢失又防止过度补偿。该过程完全摒弃全局注意力机制与参数化权重学习,极大降低了计算开销,满足高速产线实时处理需求。后续衔接的深度可分离卷积厚度映射网络进一步在不牺牲感受野的前提下压缩模型体积,配合双阈值热力图分割与PCB几何约束引导的拓扑校验流程,精准区分真实厚度不均缺陷与结构伪影,显著提升判定准确性与工业适配性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015432A_ABST
    Figure CN123015432A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of visual detection methods of solder resist ink thickness uniformity, by obtaining original RGB image data, combined with multimodal feature extraction, including edge gradient amplitude, local contrast normalization, HSV hue stability and direction sensitive light intensity gradient distribution, using local rank ordering and trend vector analysis, calculate modal consistency and remove abnormal response, generate sparse multimodal feature map.According to the effective number of modal dynamic selection aggregation strategy, fusion forms thickness feature input deep convolution network, and outputs pixel-by-pixel thickness confidence heat map.Combined with double-threshold segmentation and PCB layout geometric constraint, filter real defect connected domain and quantify area ratio, maximum deviation rate and distribution entropy, significantly improve the detection precision and automation level of solder resist ink thickness uniformity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual inspection and intelligent quality judgment technology in electronic manufacturing, and in particular to a visual inspection method for the uniformity of solder resist ink thickness. Background Technology

[0002] Currently, in the production of printed circuit boards (PCBs), the uniformity of solder resist ink thickness directly affects product quality and the reliability of subsequent processes. For non-destructive testing of ink thickness distribution, mainstream technologies in the industry mostly employ image feature extraction and defect discrimination methods based on a single visual channel. A typical process includes: high-resolution RGB or grayscale image acquisition, manually designed edge detection, contrast enhancement, or color difference segmentation methods, combined with simple thresholding or statistical regression-based defect differentiation, and supplemented by limited geometric calibration methods to achieve a preliminary determination of solder resist ink uniformity. With the upgrading of industrial automation, some research is also attempting to introduce multimodal feature fusion technology on the basis of traditional visual inspection. By combining multiple image features such as edges, textures, color, and light intensity, the sensitivity and anti-interference ability of the inspection can be improved. However, existing visual inspection systems generally face the following technical bottlenecks in actual PCB production: First, many solutions employ direct concatenation of multimodal features or channel-weighted averaging, failing to adequately distinguish the statistical consistency of each modality within its local space and only assigning fixed weights at the global scale. Consequently, influenced by factors such as external lighting variations, specular reflection, contaminant particles, and surface texture complexity, when a single modality exhibits abnormal responses in certain regions, the system cannot effectively suppress its signal. This leads to redundant information and noise in the feature fusion results, causing false positives, false negatives, or insufficient stability in thickness determination. Some studies introduce attention mechanisms or cross-modal reconstruction losses for feature selection, which, while improving network expressive power, often significantly increase computational load, parameter size, and engineering integration difficulty. Furthermore, in real-world production environments lacking sufficient labeled data, generalization robustness is difficult to guarantee.

[0003] Therefore, how to construct an adaptive modal weight sparsity fusion mechanism driven by local consistency, which can retain truly complementary and trend-consistent feature information while efficiently isolating noise and abnormal response channels, is a key technical requirement for solving the accuracy, anti-disturbance capability, and online adaptability of industrial vision thickness uniformity detection. Summary of the Invention

[0004] This application provides a visual inspection method for the uniformity of solder resist ink thickness, aiming to solve the problems of false detection, missed detection, or insufficient stability in thickness determination mentioned in the background art.

[0005] This application provides a visual inspection method for the uniformity of solder resist ink thickness, specifically including: S1: Obtain the original RGB image data of the solder resist ink surface, and simultaneously perform multi-dimensional feature extraction operation on the original RGB image data to generate an initial multimodal feature set; S2: Based on the spatial resolution of the initial multimodal feature set, a neighborhood window is defined for each pixel position, and the pixel values ​​of the initial multimodal feature set are sorted within the neighborhood window to obtain a trend vector set; S3: Construct a modal consistency matrix using a trend vector set, and dynamically adjust a preset threshold based on the texture complexity of the current neighborhood window. Generate a sparse mask identifier based on the modal consistency matrix and the preset threshold. S4: Perform a channel zeroing operation on the initial multimodal feature set according to the sparse mask identifier to obtain a sparse multimodal feature map; S5: Count the number of remaining effective modes at each position in the sparse multimodal feature map, and dynamically select an aggregation strategy based on the numerical range of the number of remaining effective modes to generate an aggregated thickness feature map; S6: Input the aggregated thickness feature map into the thickness mapping network for pixel-by-pixel inference operation to output a pixel-by-pixel thickness confidence heatmap; S7: Perform a double threshold segmentation operation on the pixel-by-pixel thickness confidence heatmap and perform topological connectivity verification in conjunction with PCB layout geometric constraints, and finally generate a uniformity judgment conclusion that includes three quantitative indicators: area ratio, maximum deviation rate and spatial distribution entropy.

[0006] The visual inspection method for the uniformity of solder resist ink thickness provided in this application has the following beneficial effects: This solution employs an adaptive switching fusion strategy based on the number of locally effective modalities, significantly improving output stability and physical interpretability. Unlike conventional weighted averaging or splicing operations that may introduce redundant interference, this invention intelligently selects median fusion, geometric average, or single-channel enhancement mode based on the number of remaining channels after consistency screening: when multiple modalities coexist, the median is used to suppress outliers; in the case of two channels, a product-type geometric average is used to highlight the synergistic activation effect; and for a single surviving channel, spatial context correction is combined for reasonable extrapolation, avoiding both information loss and overcompensation. This process completely abandons global attention mechanisms and parameterized weight learning, greatly reducing computational overhead and meeting the real-time processing requirements of high-speed production lines. The subsequent depthwise separable convolutional thickness mapping network further compresses the model volume without sacrificing the receptive field. Combined with dual-threshold heatmap segmentation and a topology verification process guided by PCB geometric constraints, it accurately distinguishes between true thickness unevenness defects and structural artifacts, significantly improving judgment accuracy and industrial adaptability. Attached Figure Description

[0007] Figure 1This is the main flowchart of a visual inspection method for the uniformity of solder resist ink thickness.

[0008] Figure 2 This is a sub-flowchart of a visual inspection method for the uniformity of solder resist ink thickness.

[0009] Figure 3 This is another sub-flowchart of a visual inspection method for the uniformity of solder resist ink thickness. Detailed Implementation

[0010] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0011] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0012] like Figure 1 As shown, this application provides a visual inspection method for the uniformity of solder resist ink thickness, specifically including: S1: Obtain the original RGB image data of the solder resist ink surface, and simultaneously perform multi-dimensional feature extraction operation on the original RGB image data to generate an initial multimodal feature set; S2: Based on the spatial resolution of the initial multimodal feature set, a neighborhood window is defined for each pixel position, and the pixel values ​​of the initial multimodal feature set are sorted within the neighborhood window to obtain a trend vector set; S3: Construct a modal consistency matrix using a trend vector set, and dynamically adjust a preset threshold based on the texture complexity of the current neighborhood window. Generate a sparse mask identifier based on the modal consistency matrix and the preset threshold. S4: Perform a channel zeroing operation on the initial multimodal feature set according to the sparse mask identifier to obtain a sparse multimodal feature map; S5: Count the number of remaining effective modes at each position in the sparse multimodal feature map, and dynamically select an aggregation strategy based on the numerical range of the number of remaining effective modes to generate an aggregated thickness feature map; S6: Input the aggregated thickness feature map into the thickness mapping network for pixel-by-pixel inference operation to output a pixel-by-pixel thickness confidence heatmap; S7: Perform a double threshold segmentation operation on the pixel-by-pixel thickness confidence heatmap and perform topological connectivity verification in conjunction with PCB layout geometric constraints, and finally generate a uniformity judgment conclusion that includes three quantitative indicators: area ratio, maximum deviation rate and spatial distribution entropy.

[0013] Step S1: Acquire the original RGB image data of the solder resist ink surface, and simultaneously perform multi-dimensional feature extraction on the original RGB image data to generate an initial multimodal feature set. Specifically, this includes: S1.1: Obtain the original RGB image data of the solder resist ink surface, and perform grayscale space conversion and Gaussian smoothing denoising processing on the original RGB image data to eliminate sensor noise interference and generate a standardized single-channel grayscale intensity map as the reference input data for subsequent edge gradient magnitude map calculation.

[0014] The raw RGB image data of the solder resist ink surface is acquired as the initial input source for multimodal feature extraction. A linear weighted grayscale conversion is performed on the raw RGB image data, and weight coefficients for the red, green, and blue channels are assigned according to human visual sensitivity, mapping the three-dimensional color space to a one-dimensional brightness space. The grayscale value of each pixel is calculated using the ITU-R BT.601 standard weighting formula.

[0015] Gaussian smoothing denoising is performed on the generated single-channel grayscale intensity image, and a two-dimensional Gaussian kernel function is constructed to suppress high-frequency sensor noise. The standard deviation parameter and kernel size of the Gaussian kernel are set to ensure effective filtering of isolated noise while preserving edge details. The Gaussian kernel is applied to each pixel neighborhood of the grayscale image through convolution operations, and a weighted average value is calculated to replace the center pixel value.

[0016] Through the above grayscale conversion and Gaussian filtering, the original RGB data is transformed into a standardized single-channel grayscale intensity map, eliminating illumination color bias and random noise interference, providing high signal-to-noise ratio benchmark input data for subsequent Sobel operator edge gradient calculation, and realizing signal purification and standardization at the feature extraction front end.

[0017] S1.2: Based on the standardized single-channel grayscale intensity map, the Sobel operator is used to perform convolution differential operations in the horizontal and vertical directions respectively, and the differential results in the two directions are processed by square root extraction to quantify the degree of abrupt change of the pixel and generate an edge gradient magnitude map that characterizes the clarity of the physical boundary of the ink layer.

[0018] S1.3: For each pixel neighborhood in the original RGB image data, calculate the ratio of the mean to the standard deviation within the local window, and perform an adaptive histogram equalization mapping operation to suppress background interference caused by uneven illumination and generate a local contrast normalized map that reflects the microscopic undulations of the ink surface.

[0019] Based on the standardized single-channel grayscale intensity map generated by S1.2, a sliding window mechanism is constructed to traverse every pixel in the image and establish the benchmark region for local statistical calculation.

[0020] The sliding window size is set to 7×7 pixels. This size balances the preservation of local texture details with the sufficiency of statistical samples, ensuring the stability of the mean and standard deviation calculations.

[0021] Within a defined local window, extract the set of grayscale values ​​of all pixels, calculate the arithmetic mean of the set, and characterize the background illumination level of the local area.

[0022] The standard deviation of the grayscale value set is calculated simultaneously to quantify the dispersion of pixel values ​​in local areas and reflect the contrast variation of the microscopic surface.

[0023] The local contrast normalization coefficient is calculated using the following formula: in, The local contrast coefficient. The standard deviation of grayscale in a local window. This represents the average grayscale value of a local window. To prevent the use of tiny constants with a denominator of zero, a value of 10 is taken. -6 .

[0024] Divide each pixel value in the original grayscale intensity image by the corresponding local contrast coefficient, perform a pixel-by-pixel division operation to eliminate absolute brightness differences caused by uneven lighting.

[0025] Adaptive histogram equalization is performed on the normalized data to remap the grayscale distribution range and enhance the visual salience of the tiny undulations on the ink surface.

[0026] Through the above-mentioned local statistical normalization and histogram equalization processing, the standardized grayscale image from the previous step is transformed into a local contrast normalized image that reflects the microscopic undulations of the ink surface, thereby achieving the technical effect of suppressing background illumination interference and highlighting surface texture features.

[0027] S1.4: Convert the original RGB image data from the RGB color space to the HSV color space, extract the hue component channels, and calculate the variance statistics of the hue values ​​within a sliding window to evaluate the dispersion of the color distribution and generate an HSV hue stability map characterizing the uniformity of ink curing.

[0028] The system receives the preprocessed raw RGB image data as input for HSV hue stability feature extraction. A color space transformation method is performed to linearly map the RGB three-channel pixel values ​​to the HSV cylindrical coordinate system, separating luminance and chromaticity information and eliminating interference from light intensity fluctuations on color interpretation. The hue H component channel is independently extracted from the transformed HSV dataset, constructing a two-dimensional grayscale matrix containing only hue information. This matrix's values ​​are normalized to the 0-360 degree range, accurately representing the intrinsic color attributes of the solder resist ink. A fixed-size sliding window is defined, covering the neighborhood of the current pixel to form a local color distribution statistical region. The hue values ​​of all pixels are traversed within the sliding window, calculating the local mean and dispersion to quantify the uniformity of ink color within the region. For hue ring characteristics, when adjacent pixel hues cross the 0 / 360 degree boundary, angle difference correction processing is performed to ensure the geometric continuity of variance calculation. The calculated variance value is assigned to the central pixel, generating a single-channel hue stability response map. The variance map is normalized, mapping high-variance regions to low-stability values ​​and low-variance regions to high-stability values, highlighting uneven ink curing or color mixing defects. Through this processing, the original RGB color data is transformed into an HSV hue stability map characterizing the microscopic color consistency of the ink. This achieves highly sensitive capture of color difference defects caused by differences in curing temperature or uneven stirring, providing a color dimension basis resistant to light interference for subsequent multimodal consistency determination.

[0029] For example, a sliding window size of 5×5 pixels is set to process a PCB solder resist image with a resolution of 1920×1080. During the RGB to HSV conversion, a linear transformation is performed using the standard ITU-R BT.601 coefficient matrix. For a local window, if a green solder resist area is detected, its hue values ​​are concentrated around 120 degrees, the calculated variance is 2.5, and the normalized stability value is 0.95, classifying it as a uniform area. If slight yellowing contamination exists, the hue values ​​are dispersed between 100 and 140 degrees, the variance rises to 45.0, and the normalized stability value drops to 0.12, marking it as a potential defect. This process effectively suppresses brightness interference caused by surface reflection and significantly improves the detection rate of minor color difference defects.

[0030] S1.5: Based on the standardized single-channel grayscale intensity map, a direction-sensitive Gaussian difference filter bank with a specific orientation angle is applied to perform multi-directional convolution filtering to capture the light intensity change rate under different orientations and generate a light intensity gradient distribution map containing directional texture information. The edge gradient magnitude map, local contrast normalization map, HSV hue stability map and light intensity gradient distribution map are aggregated and encapsulated into an initial multimodal feature set.

[0031] Based on the standardized single-channel grayscale intensity map generated in the previous steps, a direction-sensitive Gaussian difference filter bank containing eight specific orientation angles is constructed, with the angle interval set to 22.5 degrees to cover omnidirectional texture features.

[0032] For each orientation angle, a corresponding Gaussian kernel function and Laplacian operator combination template are generated to ensure that the filter has the maximum response sensitivity in a specific direction.

[0033] The standardized single-channel grayscale intensity image is sequentially subjected to two-dimensional convolution operation with filter templates in eight directions to obtain eight independent directional response component images.

[0034] The absolute values ​​of the response component maps in eight directions are calculated pixel by pixel to eliminate the interference of negative gradients on texture intensity evaluation and retain the amplitude information of light intensity changes.

[0035] A non-maximum suppression strategy is adopted, which compares the response amplitudes in eight directions within the 3x3 neighborhood of each pixel, and retains only the amplitude corresponding to the direction with the largest response as the main direction texture intensity.

[0036] Map the main direction texture intensity of all pixels to a uniform grayscale range to generate a light intensity gradient distribution map that characterizes the microstructure and roughness of the solder resist ink surface.

[0037] The generated light intensity gradient distribution map is stacked and stitched together with the edge gradient magnitude map, local contrast normalization map and HSV hue stability map output from the previous steps in the channel dimension.

[0038] By performing multimodal feature alignment processing, the multidimensional feature map is encapsulated into a four-channel initial multimodal feature set with the same spatial resolution, realizing the transformation from a single grayscale image to a multidimensional texture semantic space, and providing a complete feature basis for subsequent local consistency analysis.

[0039] Step S2: Based on the spatial resolution of the initial multimodal feature set, a neighborhood window is defined for each pixel location, and the pixel values ​​of the initial multimodal feature set are sorted within the neighborhood window to obtain a trend vector set. Specifically, this includes: S2.1: Based on the spatial resolution of the initial multimodal feature set, define a fixed-size 5×5 neighborhood window for each pixel position in the edge gradient magnitude map, local contrast normalization map, HSV hue stability map, and light intensity gradient distribution map to delineate the computational region for extracting local spatial context information.

[0040] The system receives the initial multimodal feature set output from step S1. This set contains multidimensional feature maps with consistent spatial resolution: edge gradient magnitude map, local contrast normalization map, HSV hue stability map, and light intensity gradient distribution map. For any pixel coordinate point (i, j) in the feature set, a fixed-size 5×5 sliding neighborhood window is constructed centered on this point to define the boundary of the computational region used to extract local spatial context information. Within the 5×5 neighborhood window, 25 pixel grayscale values ​​corresponding to the positions in the multidimensional feature maps are extracted, forming four independent local feature data subsets. A numerical sorting operation is performed on each local feature data subset, mapping the original absolute value of feature intensity to a rank number from 1 to 25, generating four independent local rank sequences. Through rank mapping, the absolute deviation of feature magnitude caused by uneven illumination or sensor gain differences is eliminated, preserving the relative change trend of features within the local region. The generated four local rank sequences are reorganized into structured data units according to modality category, constructing a local response trend vector characterizing the response change law of each modality within the local region. By iterating through all pixel locations in the original image, the processes of defining neighborhood windows, sorting pixel values, and recombining vectors are repeatedly performed, completely transforming the initial multimodal feature set across the entire image into a trend vector set covering all local regions. Through this processing, the absolute feature space data from the previous step is converted into relative trend rank space data, achieving immunity to illumination interference while preserving local texture structure information, thus providing standardized input for subsequent calculation of the Kendall rank correlation coefficient.

[0041] S2.2: Using the 5×5 neighborhood window, the pixel grayscale values ​​of the multidimensional feature maps covered within the window are sorted in ascending order to map the original feature intensity values ​​to the corresponding level numbers, thereby generating four independent local rank sequences to shield the absolute amplitude differences caused by uneven illumination.

[0042] Based on the 5×5 neighborhood window defined in the previous steps, the edge gradient magnitude map, local contrast normalization map, HSV hue stability map, and light intensity gradient distribution map are extracted from the gray values ​​of 25 pixels within the area covered by the window, and four independent sets of original feature values ​​are constructed.

[0043] For each type of feature map, an ascending sort method is performed to reorganize the feature intensity values ​​of pixels within the window in ascending order, thereby eliminating the interference of absolute numerical magnitude on subsequent correlation analysis.

[0044] Based on the sorted position index, each pixel in the window is assigned a corresponding rank number, with the minimum value assigned rank 1 and the maximum value assigned rank 25. If there are the same value, the average rank is taken to generate four independent local rank sequences.

[0045] Through the above-mentioned rank mapping process, the absolute feature intensity space affected by uneven illumination is transformed into a rank space that only reflects the local relative change law, effectively shielding the amplitude difference caused by global brightness fluctuations.

[0046] S2.3: Based on the four independent local rank sequences, they are reorganized into structured data units according to modality category, and a local response trend vector representing the response change law of each modality in the local region is constructed, thus completing the transformation from the absolute eigenvalue space to the relative trend rank space.

[0047] Obtain the four independent local rank sequences output from step S2.2, including edge gradient magnitude rank, local contrast normalization rank, HSV hue stability rank, and light intensity gradient distribution rank, as the original data source for constructing the trend vector.

[0048] The four rank sequences corresponding to each pixel position are re-dimensioned. The 25 rank values ​​of the same modality in the 5×5 neighborhood window are arranged in spatial scanning order to form a one-dimensional rank vector of length 25, ensuring that the spatial topology remains consistent in the vector mapping.

[0049] The one-dimensional rank vectors of the four modes are standardized and preprocessed to eliminate the numerical offset caused by the difference in physical dimensions of different features, so that the value range of each vector element is uniformly mapped to the interval [0, 1].

[0050] Based on the modality category index, the four standardized rank vectors are encapsulated into structured tensor units, each containing four parallel vector components that represent the relative change trends of edge, texture, color, and light intensity in the local neighborhood.

[0051] By performing vector recombination and standardization, the discrete rank data from the previous step is transformed into a comparable set of local response trend vectors, realizing the transformation from the absolute eigenvalue space to the relative trend rank space. This provides dimensionless standard input data for the subsequent calculation of Kendall's rank correlation coefficient, effectively shielding the absolute amplitude interference caused by uneven illumination and sensor gain fluctuations.

[0052] S2.4: Traverse all pixel locations of the original image to obtain all local response trend vectors, and completely transform the initial multimodal feature set across the entire image into a trend vector set covering all local regions, which serves as the standardized input data for subsequent calculation of Kendall's rank correlation coefficient.

[0053] Step S3: Construct a modality consistency matrix using a trend vector set, dynamically adjust a preset threshold based on the texture complexity of the current neighborhood window, and generate a sparse mask identifier based on the modality consistency matrix and the preset threshold. Specifically, this includes: S3.1: Perform Kendall's rank correlation coefficient calculation on any two different modal rank sequences in the trend vector set to quantify the statistical correlation of multimodal response trends within a local neighborhood window, thereby generating an initial correlation dataset containing the correlation values ​​of all pairwise modal combinations.

[0054] Receive the trend vector set output from step S2. This dataset contains the local rank sequence of four modalities corresponding to each pixel position in the entire image, which serves as the input basis for calculating the Kendall rank correlation coefficient.

[0055] For the currently traversed pixel position, extract the 5×5 neighborhood rank sequence of four modes: edge gradient, local contrast, HSV hue stability, and light intensity gradient. Each sequence contains 25 level values.

[0056] Pairwise modal combinations were constructed, forming a total of 6 independent pairs, including edge-contrast, edge-hue, edge-intensity, contrast-hue, contrast-intensity, and hue-intensity combinations.

[0057] For each modality pair, the consistency state of all possible pixel pairs in the two rank sequences is counted. A consistent pair is defined as a pair of points in the two sequences with the same relative size relationship, and an inconsistent pair is a pair of points with opposite relative size relationships.

[0058] Kendall's rank correlation coefficient is calculated using the following formula. : in, The total number of pixels within the neighborhood window is 25. To ensure consistency in quantity, To represent the number of non-uniform point pairs, the denominator represents the total number of all possible point pairs.

[0059] Perform a double loop to traverse 25 pixels. Compare the sign of the product of the rank difference between any two points i and j in the two modal sequences. If the product is positive, increment the count of the consistent pair by 1. If it is negative, increment the count of the inconsistent pair by 1. If it is zero, ignore it.

[0060] After completing the statistics of all point pairs, the Kendall coefficient value of the modality pair is calculated by substituting it into the formula. The value ranges from -1 to 1, which represents the strength of the monotonic correlation between the two modes in the local region.

[0061] Repeat the above calculation process until the Kendall coefficients for all 6 modality pairs are solved, generating an initial correlation dataset containing 6 correlation values.

[0062] By using the nonparametric statistical test method described above, the rank sequence from the previous step is transformed into a correlation index that quantifies the statistical correlation of multimodal response trends. This enables an accurate measurement of the consistency of local features and provides data support for the subsequent construction of the modal consistency matrix.

[0063] S3.2: Construct a four-dimensional modality consistency matrix based on the numerical distribution in the initial correlation dataset, and fill the corresponding positions of the matrix with the calculated Kendall rank correlation coefficients to form a modality consistency matrix that characterizes the degree of consistency between the four types of visual features within the current local neighborhood window.

[0064] Receive the initial correlation dataset output from step S3.1. This dataset contains the original Kendall rank correlation coefficient values ​​for pairwise combinations of the four modalities within the current 5×5 neighborhood window. Construct a 4x4 zero-initialized square matrix as the structured carrier of the modality consistency matrix. The row and column indices of the matrix correspond to the identifiers of the four feature modalities: edge gradient, local contrast, HSV hue stability, and light intensity gradient, respectively. Traverse each modality pair in the initial correlation dataset and extract its calculated Kendall rank correlation coefficient value. Fill the extracted correlation coefficient value into the element cell at the intersection of the corresponding row and column indices in the modality consistency matrix, ensuring that the matrix is ​​symmetric about the main diagonal. Perform a forced assignment operation on the elements on the main diagonal of the matrix, uniformly setting them to the value 1, representing the complete autocorrelation between the same modality and itself. Perform numerical validity checks on the off-diagonal elements, removing invalid correlation values ​​caused by the completely random rank sequence. If an anomaly is detected, set that position to 0 to block noise propagation. By using the matrix construction and filling methods described above, the scattered pairwise correlation values ​​from the previous step are transformed into a structured four-dimensional modal consistency matrix, realizing a centralized representation of the consistency of multimodal responses within a local neighborhood, and providing a standardized data structure foundation for subsequent abnormal modality determination based on dynamic thresholds.

[0065] For example, for a solder resist image with a resolution of 1920×1080, within a 5×5 neighborhood window at coordinates (500, 500), step S3.1 calculates the Kendall coefficient for edge gradient and local contrast as 0.85, the coefficient for edge gradient and HSV hue stability as -0.10, the coefficient for edge gradient and light intensity gradient as 0.78, the coefficient for local contrast and HSV hue stability as -0.05, the coefficient for local contrast and light intensity gradient as 0.80, and the coefficient for HSV hue stability and light intensity gradient as -0.08. The system constructs a 4×4 modal consistency matrix, setting the diagonal elements to 1. Fill 0.85 into the first row, second column and the second row, first column; -0.10 into the first row, third column and the third row, first column; 0.78 into the first row, fourth column and the fourth row, first column; -0.05 into the second row, third column and the third row, second column; 0.80 into the second row, fourth column and the fourth row, second column; and -0.08 into the third row, fourth column and the fourth row, third column. The generated matrix clearly shows that the HSV hue mode is negatively or weakly correlated with the other three modes, while the edge, contrast, and intensity modes are strongly positively correlated. This structured matrix accurately quantifies the consistent distribution of local features, significantly improving the efficiency and accuracy of subsequent threshold comparison operations.

[0066] S3.3: Perform local variance statistical analysis on the original pixel grayscale values ​​within the 5×5 neighborhood window to evaluate the surface texture complexity, and dynamically adjust the preset correlation judgment threshold according to the texture complexity value obtained from the analysis, thereby generating an adaptive dynamic threshold parameter that adapts to the current local working conditions.

[0067] Receive the modality consistency matrix output in step S3.2 and the original RGB image data generated in step S1, and extract the set of original pixel gray values ​​corresponding to the current 5×5 neighborhood window spatial position as the basic input data for texture complexity evaluation.

[0068] The mean value is calculated on the original set of pixel gray values ​​to obtain the average gray intensity within the local window, providing a central reference point for subsequent variance statistics.

[0069] Based on the average gray intensity, all pixels within the window are traversed, and the sum of squares of the differences between the gray value of each pixel and the average value is calculated to construct a sequence of local deviation sums of squares.

[0070] Divide the local variance sum of squares sequence by the number of degrees of freedom coefficients equal to the total number of pixels in the window minus one, perform an unbiased estimation operation, and generate a local variance value that characterizes the degree of gray-level fluctuation in the local area.

[0071] Calculate the local texture complexity index. Based on the calculated local texture complexity, query the preset nonlinear mapping function table. This function table defines the inverse adjustment relationship between texture complexity and correlation determination threshold.

[0072] When the local texture complexity is lower than the smoothness threshold, the current region is determined to be a uniform surface, and the correlation determination threshold is increased to strictly screen for consistent modes; when the local texture complexity is higher than the disorder threshold, the current region is determined to be a complex texture, and the correlation determination threshold is decreased to tolerate reasonable feature differences.

[0073] By using the aforementioned local variance statistics and nonlinear mapping processing method, the static threshold setting of the previous step is transformed into an adaptive dynamic threshold parameter that fits the current local working conditions. This achieves differentiated suppression of noise interference under different texture backgrounds and significantly improves the environmental adaptability of modal consistency determination.

[0074] S3.4: Use the adaptive dynamic threshold parameter to perform a traversal comparison operation on each row of data in the modality consistency matrix. When the average correlation value of a certain mode with other modes is lower than the adaptive dynamic threshold parameter, the mode is determined to be an abnormal response mode, thereby generating a preliminary sparsification determination result that marks the position of the abnormal mode.

[0075] Receive the adaptive dynamic threshold parameters output in step S3.3 and the modal consistency matrix constructed in step S3.2. This matrix is ​​a 4×4 symmetric matrix, with diagonal elements always being 1 and off-diagonal elements representing the Kendall rank correlation coefficients between each pair of the four visual features.

[0076] Iterate through each row of the modality consistency matrix. For the current modality to be determined, extract the three correlation values ​​in that row excluding the diagonal elements to form a local correlation vector.

[0077] Perform an arithmetic mean operation on the local correlation vectors to calculate a quantitative index of the average consistency strength between the a-th mode and all other modes, which is used as the comprehensive confidence score of the mode in the current local neighborhood.

[0078] The calculated average consistency score is compared with the adaptive dynamic threshold parameter of 0.75 generated in step S3.3. If the average consistency score is lower than the dynamic threshold, the i-th mode is determined to have an abnormal response in the current 5×5 neighborhood window and is marked as a noise channel.

[0079] If the average consistency score is greater than or equal to the dynamic threshold, the i-th modal response trend is determined to be highly consistent with other modalities, and it is marked as a valid channel, retaining its eligibility to participate in subsequent fusion calculations.

[0080] The above extraction, averaging, comparison, and labeling operations are repeated for the four rows of data in the matrix in sequence to complete the independent consistency verification of four modalities: edge gradient, local contrast, HSV hue stability, and light intensity gradient.

[0081] The verification results of the four modalities are summarized to generate a preliminary sparsed judgment vector containing four Boolean state values, where true values ​​represent valid modalities and false values ​​represent abnormal modalities, forming a pixel-level modal selection criterion.

[0082] By using a row-by-row comparison and dynamic threshold decision processing method, the modality consistency matrix of the previous step is transformed into a preliminary sparsified judgment result that identifies the validity of each modality, thereby achieving accurate removal of noisy modes based on local statistical consistency.

[0083] S3.5: Based on the preliminary sparsity determination result, perform binarization encoding processing on all pixel positions in the entire image, mark the modal channels that are determined to be normal responses as retained and mark the modal channels that are determined to be abnormal responses as discarded, and finally generate sparsity mask identifiers to guide subsequent feature channel zeroing operations.

[0084] Receive the preliminary sparsification determination result output in step S3.4, which includes abnormal state labeling data of four modalities at each pixel position in the entire image.

[0085] The initial sparsity determination results are traversed spatially. For each pixel coordinate point in the image, its corresponding four-dimensional modal state vector is extracted. This vector consists of four channels of determination indicators: edge gradient, local contrast, HSV hue stability, and light intensity gradient.

[0086] According to the preset binary encoding rules, the modal channel that is determined to be a normal response is mapped to a logic high level value 1, which means that the modality has high consistency and high reliability in the local neighborhood.

[0087] The modal channel that is determined to be an abnormal response is mapped to a logic low level value of 0, which means that the modality is significantly affected by noise interference or texture disturbance and needs to be suppressed in subsequent fusion.

[0088] Repeat the above mapping operation for all pixel positions in the entire image to construct a four-channel binary tensor structure that is completely consistent with the spatial resolution of the original image.

[0089] Perform a data type conversion on the four-channel binary tensor, converting it from Boolean or integer to a floating-point mask matrix to meet the requirements of subsequent element-wise multiplication operations with floating-point feature maps.

[0090] By using the above-mentioned binary encoding processing method, the abstract consistency judgment result of the previous step is transformed into a concrete sparse mask identifier, realizing the digital quantification of the credibility of multimodal features, and providing clear logical guidance for the accurate zeroing and noise isolation of subsequent feature channels.

[0091] like Figure 2 As shown, step S4 involves performing a channel zeroing operation on the initial multimodal feature set based on the sparse mask identifier, thereby obtaining a sparse multimodal feature map. Specifically, this includes: S4.1: Obtain the sparse mask identifier and initial multimodal feature set output from the previous steps. Based on the validity status marker in the sparse mask identifier, perform logical zeroing processing on the abnormal response modal channel at the corresponding position in the initial multimodal feature set. That is, force the pixel value of the feature channel that is determined to have inconsistent response trend to be mapped to zero value, thereby generating an intermediate transition feature map containing zero value placeholders to achieve physical isolation of noise modes.

[0092] The system receives the sparse mask identifier tensor output from step S3. This tensor contains binary state markers consistent with the spatial resolution of the original image, where 1 represents a valid modal channel and 0 represents an abnormal modal channel. Simultaneously, the system reads the initial multimodal feature set generated in step S1. This feature set consists of four independent channels: an edge gradient magnitude map, a local contrast normalization map, an HSV hue stability map, and a light intensity gradient distribution map. Each channel maintains floating-point precision to preserve subtle texture differences.

[0093] The sparse mask identifier is expanded by copying it from a single-channel binary matrix and stacking it into a four-channel Boolean tensor to ensure that the channel dimension of the mask is strictly aligned with the channel dimension of the initial multimodal feature set, thus establishing a pixel-level one-to-one mapping relationship.

[0094] The element-wise Hadamard product operation is performed, and the expanded four-channel Boolean tensor is multiplied point-to-point with the initial multimodal feature set. The logical properties of Boolean values ​​are used to selectively retain feature channels. When the mask value is 0, the feature value at the corresponding position is forced to be zero. When the mask value is 1, the feature value remains unchanged.

[0095] The data type of the operation results is validated and the memory layout is optimized. The sparse feature data containing a large number of zero values ​​is converted into a compressed sparse row format or a dense tensor format is maintained but invalid regions are marked to generate an intermediate transition feature map. This map retains all pixel positions in space, but only retains the valid feature information that has passed the consistency check in the channel dimension.

[0096] By using the above logic gating and element-wise multiplication processing, the abstract consistency judgment result generated in the previous step is transformed into concrete sparse feature data, which realizes the physical isolation of abnormal modal responses caused by surface texture interference and illumination noise, and provides a clean and high-confidence input basis for subsequent dynamic aggregation strategies.

[0097] S4.2: Utilizing the spatial distribution characteristics of non-zero pixels in the intermediate transition feature map, perform channel dimension compression and reorganization operation, align and integrate the four types of basic visual feature maps after logical zeroing according to the original spatial resolution, eliminate the redundant occupation of the data structure by all-zero channels, and generate a compact sparse multimodal feature map to be verified.

[0098] The intermediate transition feature map output from step S4.1 is received. This map contains four basic visual feature channels that have been logically zeroed out, with aberrant modality positions filled with zero-value placeholders. Non-zero element statistics are performed on the channel dimensions of the intermediate transition feature map to construct a modality validity mask consistent with the spatial resolution, identifying the index of the valid feature channel retained at each pixel position. Based on the modality validity mask, dynamic channel reorganization is performed on the multi-dimensional feature map, stripping all-zero channels from the data structure and retaining only valid feature channel data containing non-zero values. Spatial alignment verification is performed on the retained valid feature channel data to ensure that the geometric positions of each channel in the pixel coordinate system strictly correspond, eliminating index offset errors caused by channel removal. A compact tensor encapsulation strategy is adopted to integrate the aligned valid feature channel data into a sparse multi-modal feature map to be verified. This map significantly reduces the redundancy of the channel dimensions while maintaining the original spatial resolution. Through the channel-dimensional compression and recombination operation described above, the sparse intermediate data from the previous step is transformed into a compact and non-redundant feature map to be verified. This achieves the complete elimination of invalid modal information and the optimization of the data structure, providing an efficient data foundation for subsequent local connectivity verification.

[0099] S4.3: Perform local connectivity verification on the sparse multimodal feature map to be verified, check the continuity of the remaining effective modal channels in the spatial neighborhood after logical zeroing, prevent feature breakage caused by isolated noise residue, and output a pre-screened sparse multimodal feature map with connectivity optimization to ensure the spatial topological integrity of the feature data.

[0100] The system receives the sparse multimodal feature map to be verified output from step S4.2. While this map has eliminated all-zero redundancy in the channel dimension, isolated invalid pixels may still remain in the spatial dimension due to local threshold fluctuations. A binary validity mask with the same spatial resolution as the image is constructed. The number of valid modes at each pixel location in the feature map is counted. If the number of valid modes is zero, the location is marked as an invalid node; otherwise, it is marked as a valid node, forming an initial topological state map. An eight-connected neighborhood search method is used to traverse each invalid node in the initial topological state map, counting the number of valid nodes among its eight neighboring pixels to assess the spatial isolation of the invalid location. A minimum connectivity support threshold is set. When the number of valid nodes around an invalid node is lower than this threshold, the location is determined to be an isolated noise breakpoint, and its state in the binary validity mask is forcibly flipped from invalid to valid to repair minor topological breaks. Based on the corrected binary validity mask, spatial filtering is performed on the sparse multimodal feature map to be verified. Pixel positions identified as isolated noise breakpoints are replaced with the arithmetic mean of the modal features corresponding to all valid pixels in their eight-connected neighborhoods, achieving smooth feature value filling. Morphological opening is then performed on the spatially filtered feature map, using structuring elements to remove remaining disconnected small noise regions, ensuring that the retained feature regions have sufficient spatial continuity and physical meaning, generating a pre-screened sparse multimodal feature map with connectivity optimization. Through the above local connectivity verification and topology repair mechanism, the discretized feature breaks that may exist in the previous step are transformed into a spatially topologically complete continuous feature field, eliminating the interference of isolated noise points on subsequent aggregation strategies and significantly improving the spatial integrity of the feature data.

[0101] For example, in a solder resist image with a resolution of 1920×1080, the pixel at coordinates (600, 600) in the sparse multimodal feature map to be verified has all modalities set to zero due to a sudden change in local illumination, forming an isolated invalid point. Its 7 pixels within its 8-connected neighborhood are all valid nodes, with an average edge gradient of 0.75 and a local contrast of 0.68. The system detects that the number of valid neighbors around this invalid point is 7, which is higher than the minimum connectivity support threshold of 3, and determines it as an isolated breakpoint. The state of this point is flipped and the neighborhood mean is filled, updating the feature values ​​to [0.75, 0.68, 0.72, 0.70]. After full image traversal and morphological opening operations, isolated holes with a diameter less than 3 pixels are eliminated. The output pre-screened feature map, while maintaining high-frequency details, significantly improves the continuity of spatial topology, ensuring the stability of the subsequent thickness mapping network input.

[0102] S4.4: Based on the pre-screened sparse multimodal feature map with connectivity optimization, perform final data encapsulation and format standardization processing, uniformly map the retained effective modal channel data into a standard tensor format, and generate a sparse multimodal feature map that retains only the highly consistent response trend features in the local spatial region, which serves as the direct input object for subsequent dynamic aggregation strategies.

[0103] The system receives the pre-screened sparse multimodal feature map output from step S4.3, which has undergone connectivity optimization. While the map has repaired isolated breakpoints in its spatial topology, it still retains dynamically changing channel dimensions and floating-point precision differences in its data structure. Channel dimension alignment is checked at each pixel position of the pre-screened feature map to identify the number and type index of the current effective modalities. A structured metadata header containing effective channel identifiers is constructed to ensure that subsequent processing modules can accurately parse non-fixed-dimensional feature data. Based on the structured metadata header, different numbers of effective modal data are mapped to a unified standard tensor space. For cases where the number of effective modalities is less than four, specific null values ​​are filled at missing channel positions instead of zero values ​​to distinguish between "removed noise" and "naturally missing information," maintaining the regularity of the tensor shape. Data type standardization is performed on the mapped standard tensor to normalize the feature values ​​of all channels to the [0,1] interval, eliminating numerical distribution deviations in edge gradients, contrast, hue stability, and light intensity gradients caused by different units, generating feature data blocks with a unified metric. A row-first storage strategy is employed to reorganize the memory layout of the standardized feature data blocks, storing feature vectors of spatially adjacent pixels contiguously. This optimizes CPU cache hit rate and results in a sparse multimodal feature map that retains only features with highly consistent response trends within local spatial regions. Through the aforementioned data encapsulation and format standardization processes, the topology optimization results from the previous step are transformed into standardized tensor data that conforms to the input specifications of deep learning networks. This achieves unification and alignment of multimodal features at the data structure level, providing a highly compatible and information-pure direct input object for the efficient execution of subsequent dynamic aggregation strategies.

[0104] Step S5: Count the number of remaining effective modes at each position in the sparse multimodal feature map, and dynamically select an aggregation strategy based on the numerical range of the number of remaining effective modes to generate an aggregated thickness feature map. Specifically, this includes: S5.1: Perform a traversal scan of the channel state at each pixel position in the sparse multimodal feature map, and count the number of non-zero feature channels remaining after the channel zeroing operation to generate an effective modality number matrix, where non-zero feature channels represent feature data with highly consistent response trends in the local neighborhood.

[0105] Receive the sparsed multimodal feature map output from step S4.4. This map is in standard tensor format and includes four channels: edge gradient, local contrast, HSV hue stability, and light intensity gradient. The abnormal mode positions have been marked with specific null values ​​or zero values.

[0106] A pixel-by-pixel traversal operation is performed on the sparse multimodal feature map, and for each coordinate point in the image spatial resolution, its corresponding four-dimensional channel data vector is extracted.

[0107] The extracted four-dimensional channel data vector is subjected to a non-zero validity check. The number of valid channels marked with non-zero and non-null values ​​is counted to quantify the modal richness of the pixel location in the local neighborhood that passes the consistency check.

[0108] Construct an effective modality number matrix that is completely consistent with the spatial resolution of the original image, and fill the corresponding coordinate positions of the matrix with the statistically obtained effective channel number to form a quantitative distribution map representing the feature confidence of each pixel in the whole image.

[0109] By using the above-mentioned traversal scanning and counting processing method, the sparse feature data of the previous step is transformed into an effective modality number matrix that intuitively reflects the strength of local feature consistency. This enables a preliminary quantitative assessment of the reliability of multimodal fusion and provides an accurate quantitative basis for the subsequent dynamic selection of aggregation strategies.

[0110] S5.2: Based on the numerical distribution in the effective modality number matrix, execute interval determination logic to map the effective modality number of each pixel position to the first interval, the second interval, or the third interval, thereby generating a dynamic strategy selection graph containing the aggregation strategy type identifier. The first interval corresponds to the case where the effective modality number is greater than or equal to three, the second interval corresponds to the case where the effective modality number is equal to two, and the third interval corresponds to the case where the effective modality number is equal to one.

[0111] Receive the effective modality count matrix generated in step S5.1. This matrix is ​​strictly aligned with the original image spatial resolution. Each pixel location stores the remaining non-zero feature channel count value after sparsification, with the value ranging from 0 to 4.

[0112] A policy mapping logic containing three discrete numerical intervals is constructed. The first interval is defined as the set with an effective number of modes greater than or equal to 3, corresponding to the high-confidence multimodal collaboration region; the second interval is defined as the set with an effective number of modes equal to 2, corresponding to the medium-confidence bimodal complementarity region; and the third interval is defined as the set with an effective number of modes equal to 1, corresponding to the low-confidence single-modal retention region.

[0113] Initialize a null dynamic strategy selection map with the same resolution as the image, using an 8-bit unsigned integer data format, with a default value of 0 to identify invalid or background areas.

[0114] Iterate through each pixel coordinate in the effective modality count matrix and read the effective modality count value M at the current position.

[0115] Determine if the count value M satisfies If the condition is met, then write the policy identifier 1 at the corresponding position in the dynamic policy selection graph to mark that the median fusion policy needs to be executed at that position, and use the majority voting mechanism to suppress outlier noise.

[0116] If the count value M does not meet the above conditions, further determine whether it meets the conditions. If the condition is met, then write strategy identifier 2 at the corresponding position in the dynamic strategy selection graph to mark that the geometric mean fusion strategy needs to be executed at that position, emphasizing the synergistic enhancement effect between the two modes.

[0117] If the count value M satisfies neither the first interval nor the second interval, then determine whether it satisfies the condition. If the condition is met, then write strategy identifier 3 at the corresponding position in the dynamic strategy selection graph to mark that the position needs to implement the retention strategy of superimposed spatial context correction factor, and compensate for the lack of information of a single mode through neighborhood information.

[0118] For extreme abnormal locations where the number of effective modes is 0, keep the default value of 0 in the dynamic strategy selection graph unchanged, or mark it as an invalid node to be repaired in subsequent steps to avoid introducing erroneous features that interfere with thickness determination.

[0119] After completing the full pixel traversal, morphological closing operations are performed on the dynamic policy selection graph to eliminate policy jump spots caused by misjudgment of isolated pixels and ensure the spatial continuity of aggregation policies between adjacent pixels.

[0120] By using the above interval determination and label mapping processing method, the statistical results of the discrete modality quantity in the previous step are transformed into a dynamic strategy selection graph with clear semantic guidance, realizing differentiated aggregation path planning for regions with different confidence levels, and significantly improving the adaptability and robustness of multimodal feature fusion.

[0121] S5.3: For the pixel positions marked as the first quantity interval in the dynamic strategy selection map, extract the corresponding multiple non-zero feature channel data and perform median sorting operation to obtain the median feature value. At the same time, for the pixel positions marked as the second quantity interval, extract the corresponding two non-zero feature channel data and perform product square root operation to obtain the geometric mean feature value, thereby generating a preliminary aggregated feature map.

[0122] Read the set of pixel coordinates marked as the first interval in the dynamic strategy selection map, extract the non-zero feature channel data of the corresponding position from the sparse multimodal feature map, and construct a multidimensional feature vector group containing edge gradient, local contrast, hue stability and light intensity gradient.

[0123] Numerical sorting is performed on the extracted multidimensional feature vector group to determine the rank relationship of each mode in the local response based on the size of the feature values, thereby eliminating the influence of numerical deviation caused by the difference in the dimensions of different modes.

[0124] Based on the sorted feature sequence, the value in the middle position is selected as the median feature. The statistical properties of the median are used to suppress the interference of extreme outliers that may exist in a single mode, thus ensuring the robustness of the fusion result.

[0125] The set of pixel coordinates marked as the second quantity interval in the dynamic strategy selection map is read synchronously, and the corresponding two non-zero feature channel data are extracted from the sparse multimodal feature map to form a bimodal cooperative response pair.

[0126] The product of two non-zero feature channel data is calculated, and the square root operation is performed on the product result to generate a geometric mean feature quantity. The geometric mean mechanism is used to enhance the synergistic enhancement effect between two consistent modes.

[0127] The generated median and geometric mean features are mapped and filled according to the original pixel spatial locations to construct the basic data layer of the preliminary aggregated feature map.

[0128] Through the aforementioned differentiated aggregation processing method, the sparse multimodal features from the previous step are transformed into preliminary aggregated feature data with noise resistance and synergistic enhancement characteristics, thereby achieving the expected technical effect of effective fusion of multimodal information and noise suppression.

[0129] S5.4: For the pixel position marked as the third quantity interval in the dynamic strategy selection graph, extract the unique non-zero feature channel data as the basic retained value, and call the mean value of the pixel features that have passed the consistency test in the neighboring eight connected domains to construct the spatial context correction factor. Perform linear superposition processing on the basic retained value and the spatial context correction factor to generate the corrected upright feature quantity.

[0130] Read the set of pixel coordinates marked as the third quantity interval in the dynamic strategy selection map, extract the unique non-zero feature channel data of the corresponding position from the sparse multimodal feature map, and define it as the basic reserved value of the pixel.

[0131] Construct a 3×3 eight-connected neighborhood search window centered on the current pixel, traverse the sparse mask labels of all pixel positions within the neighborhood, and filter out the set of neighbor pixels marked as valid.

[0132] From the selected set of effective neighbor pixels, extract the corresponding pre-aggregation multimodal feature values, calculate the arithmetic mean of these feature values, and construct a spatial context correction factor that characterizes the local spatial smoothing trend.

[0133] A linear weighted superposition method is adopted to fuse the basic retained value with the spatial context correction factor. By introducing neighborhood consistency constraints to compensate for the uncertainty of the single-mode response, a corrected upright feature quantity is generated.

[0134] By using the above spatial context correction processing method, the isolated pixel data that only has a single feature due to multimodal failure in the previous step is transformed into a robust feature index that integrates local spatial topological information, thus achieving the expected technical effect of complete thickness feature expression under extremely sparse conditions.

[0135] S5.5: Perform spatial location reorganization operation on the median feature, geometric mean feature, and corrected upright feature in the preliminary aggregated feature map, and integrate the differential aggregation results of all pixel positions into a single-channel aggregated thickness feature map to complete the complete conversion from sparse multimodal feature map to aggregated thickness feature map.

[0136] Read the preliminary aggregated feature map generated in step S5.3. This map contains the median feature and geometric mean feature corresponding to the pixel positions marked as the first and second quantity intervals, as well as the corrected upright feature corresponding to the pixel positions marked as the third quantity interval generated in step S5.4.

[0137] A global index mapping matrix with the same spatial resolution as the original image is constructed. Based on a dynamic strategy, the interval identifiers in the image are selected, and the median feature, geometric mean feature, and corrected upright feature in the preliminary aggregated feature map are mapped to the corresponding coordinate positions in the global index matrix.

[0138] Perform hole-filling verification on the global index matrix to check for undefined pixels caused by complete modality loss. If any exist, use bilinear interpolation of neighboring valid pixels to fill in the gaps and ensure the spatial continuity of the feature map.

[0139] The completed global index matrix is ​​converted into a single-channel floating-point tensor, and data type standardization is performed to eliminate the dimensional differences caused by different aggregation strategies, generating an aggregated thickness feature map with a unified structure.

[0140] Through the above spatial location reorganization and data standardization processing, the differentiated aggregation results generated in the previous step based on different effective modal numbers are integrated into a single-channel aggregated thickness feature map, realizing the complete transformation from sparse multimodal features to unified thickness representation data, providing a standardized and complete input foundation for pixel-by-pixel inference of subsequent depth-separable convolutional networks.

[0141] like Figure 3 As shown, step S6 involves inputting the aggregated thickness feature map into a thickness mapping network for pixel-by-pixel inference operations to output a pixel-by-pixel thickness confidence heatmap. Specifically, this includes: S6.1: Based on the aggregated thickness feature map generated in the previous steps, the channel rearrangement operator is used to perform dimensionality transformation processing before depthwise convolution. The multi-channel feature data is grouped and reorganized in the channel dimension to generate a grouped feature tensor with enhanced spatial local correlation, thereby reducing parameter redundancy in subsequent convolution operations and retaining key modality fusion information.

[0142] Receive the aggregated thickness feature map generated by step S5. This feature map is a single-channel floating-point matrix that retains the highly robust visual feature information after sparse filtering and dynamic aggregation.

[0143] The aggregated thickness feature map is subjected to a channel dimension expansion operation. The single-channel data is expanded into a multi-channel tensor structure through a copy mapping mechanism to adapt to the input dimension requirements of depth-separable convolutional networks, ensuring the integrity of the feature data in the spatial dimension and the operability of the channel dimension.

[0144] The Channel Shuffle Operator is introduced to group and reorganize the expanded multi-channel tensor along the channel dimension according to the preset rearrangement factor, breaking the local correlation dependence of the original modal features in the channel arrangement and promoting cross-channel interaction and fusion of feature information from different sources.

[0145] The rearranged channel data is divided into several fixed-size subgroups, each containing feature fragments from different original modalities or aggregation strategies. This structured grouping method enhances the ability of subsequent convolutional kernels to capture local spatial context information during channel-by-channel filtering.

[0146] Memory layout optimization is performed on the grouped feature tensors to ensure the continuity of adjacent channel data in physical storage, reduce GPU memory access latency, improve computational efficiency in the deep learning inference stage, and generate grouped feature tensors with enhanced spatial local correlation.

[0147] By using channel rearrangement and grouping reorganization, the single-channel aggregated thickness feature map from the previous step is transformed into multi-dimensional grouped feature tensor data, achieving decorrelation and information mixing of feature channels. This lays the data structure foundation for efficient feature extraction of subsequent depthwise separable convolutions and significantly improves the network's sensitivity to subtle thickness changes in complex texture backgrounds.

[0148] S6.2: For the grouped feature tensor, multi-level depthwise separable convolution kernels are applied to perform channel-wise spatial filtering and point-wise feature fusion operations. By extracting the texture gradient response and hue stability correlation under different receptive fields, a multi-scale deep feature map containing high-frequency details and low-frequency trends is generated to achieve efficient mapping from composite visual features to thickness-implied semantics.

[0149] Receive the grouped feature tensor output from step S6.1, which contains multimodal fusion feature data after channel rearrangement, as the input reference for the depthwise separable convolutional network.

[0150] A first-level depthwise separable convolutional module is constructed. A 3×3 spatial convolutional kernel is used to perform spatial filtering operations independently for each input channel to extract edge gradient response and texture detail information in the local neighborhood and generate a high-frequency feature map.

[0151] By applying a 1×1 pointwise convolution kernel to the high-frequency feature map, linear combination and nonlinear activation are performed in the channel dimension to achieve preliminary interaction and fusion between different modal features, thereby enhancing the discriminative power of feature representation.

[0152] A second-level dilated convolution module is introduced, with a 3×3 convolution kernel set to dilation rate of 2, to expand the receptive field range to capture larger-scale hue stability correlations and light intensity distribution trends, generating a low-frequency global context feature map.

[0153] The high-frequency feature map and the low-frequency global context feature map are concatenated along the channel dimension to form a composite feature tensor containing multi-scale information, ensuring the complete preservation of micro-texture and macro-uniformity information.

[0154] Batch normalization is performed on the composite feature tensor to standardize the mean and variance of each channel feature, accelerate network convergence, suppress internal covariate bias, and improve model training stability.

[0155] By performing a nonlinear transformation on the normalized features using the ReLU activation function, negative responses are filtered out, and the sparse representation of effective thickness features is enhanced, generating a multi-scale deep feature map containing high-frequency details and low-frequency trends.

[0156] By using multi-level deep separable convolution and multi-scale feature fusion processing, the grouped feature tensor of the previous step is transformed into a multi-scale deep feature map with rich semantic information, realizing an efficient mapping from composite visual features to thickness implicit semantics, and significantly improving the robustness and accuracy of thickness determination.

[0157] S6.3: Based on the multi-scale deep feature map, a pixel-wise regression head with residual connection mechanism is introduced to perform nonlinear activation and weighted calculation, eliminate the signal attenuation effect in the deep network transmission process, and generate the original thickness response matrix containing the absolute thickness deviation estimate and the relative uncertainty measure, so as to ensure the linear separability of small thickness changes in the feature space.

[0158] Receive the multi-scale deep feature map output from step S6.2. This feature map is multi-channel tensor data containing high-frequency texture details and low-frequency thickness trends, and serves as the input object for the pixel-by-pixel regression head.

[0159] A pixel-wise regression network branch with residual connection mechanism is constructed, and the multi-scale deep feature maps are mapped to the channel dimension reduction through 1x1 convolutional layers to generate intermediate embedding vectors with uniform dimensionality features, so as to eliminate the dimensionality differences caused by different receptive fields.

[0160] Nonlinear activation processing is performed on the intermediate embedded vectors, and the ReLU activation function is used to introduce nonlinear transformation capability, thereby enhancing the model's sensitivity to capturing feature fluctuations caused by minute thickness changes in solder resist ink.

[0161] Based on the activated feature vectors, a weighted calculation is performed through a fully connected layer to establish a linear mapping relationship from abstract visual features to physical thickness deviation values, and a preliminary thickness deviation estimate is output.

[0162] An uncertainty measurement branch is introduced to compute the variance statistics of the feature vectors in parallel, generating a relative uncertainty measure that characterizes the reliability of the prediction results. This measure is used to quantify the confidence fluctuations in local areas caused by uneven illumination or texture interference.

[0163] The thickness deviation estimate and the relative uncertainty measure are concatenated to construct the original thickness response matrix, which contains both absolute deviation information and relative confidence information.

[0164] By utilizing the residual connection mechanism, the input multi-scale deep feature maps are directly superimposed onto the original thickness response matrix to compensate for the signal attenuation effect caused by pooling or convolution operations during deep network transmission, ensuring the linear separability of small thickness changes in the feature space.

[0165] By using the pixel-by-pixel regression processing method with residual connections described above, the multi-scale deep feature map of the previous step is transformed into an original thickness response matrix containing absolute thickness deviation estimates and relative uncertainty measures. This enables high-precision pixel-by-pixel inference of the solder resist ink thickness distribution state and significantly improves the detection system's ability to identify minor thickness unevenness defects.

[0166] S6.4: Perform spatial smoothing correction processing based on Gaussian kernel function on the original thickness response matrix to suppress single-pixel jump interference caused by sensor noise or sudden changes in local illumination, and generate a smooth thickness distribution field with spatial continuity and physical consistency, providing intermediate data that conforms to the laws of industrial surface morphology for the final thermal map visualization.

[0167] S6.5: Based on the smooth thickness distribution field, an adaptive normalization mapping method is used to perform numerical interval compression and pseudo-color encoding conversion, mapping continuous thickness deviation values ​​into standardized confidence probability values, and finally outputting a pixel-by-pixel thickness confidence heatmap characterizing the uniformity of the solder resist ink thickness across the entire surface, thus completing the final transformation from abstract features to intuitive judgment criteria.

[0168] Receive the smoothed thickness distribution field output by step S6.4. This data is a single-channel floating-point matrix, and the numerical value represents the relative thickness deviation amplitude of the local region.

[0169] A global extreme value retrieval operation is performed on the smooth thickness distribution field, traversing all pixels in the image to extract the maximum and minimum thickness deviation values, and constructing the dynamic numerical interval boundary of the original data.

[0170] Based on the extracted maximum and minimum values, a linear normalization method is used to map the continuous thickness deviation values ​​to a standard probability range of 0 to 1, thereby eliminating the problem of inconsistent dimensions caused by differences in the thickness of the base ink in different batches of PCB boards.

[0171] For the normalized numerical matrix, an adaptive contrast enhancement mechanism is introduced to calculate the mean and standard deviation of the pixel values ​​of the entire image, and set a dynamic truncation threshold based on the Gaussian distribution characteristics to suppress the stretching effect of extreme outliers on the overall mapping range.

[0172] Normalized data that has undergone dynamic truncation is input into a pseudo-color coding mapping table, which is pre-defined with a gradient color index from blue (representing normal thickness) to red (representing abnormal thickness).

[0173] Based on the standardized confidence value of each pixel, the corresponding RGB color component value is looked up in the mapping table, and the single-channel grayscale data is converted into three-channel pseudo-color visualization data.

[0174] The generated pseudo-color data is subjected to gamma correction to adjust the contrast of the midtones, ensuring that the human eye or subsequent image processing can clearly identify areas with minute thickness gradient changes.

[0175] Through the aforementioned adaptive normalization and pseudo-color coding processing methods, the abstract smooth thickness distribution field of the previous step is transformed into an intuitive and standardized pixel-by-pixel thickness confidence heatmap, achieving an efficient transformation from physical quantity to visual judgment basis, and significantly improving the interpretability and detection accuracy of defect identification.

[0176] Step S7: Perform a double-threshold segmentation operation on the pixel-by-pixel thickness confidence heatmap and perform topological connectivity verification in conjunction with PCB layout geometric constraints, ultimately generating a uniformity judgment conclusion that includes three quantitative indicators: area ratio, maximum deviation rate, and spatial distribution entropy. Specifically, this includes: S7.1: Perform high-threshold segmentation and low-threshold segmentation on the pixel-by-pixel thickness confidence heatmap to generate a binary mask with significant thickness deviation and a binary mask with potential gradient inhomogeneity, thereby constructing a two-level defect candidate region set.

[0177] Receive the pixel-by-pixel thickness confidence heatmap output by step S6. This heatmap is a single-channel floating-point matrix with values ​​normalized to between 0 and 1, representing the confidence probability that the solder resist ink thickness at each pixel deviates from the standard value.

[0178] A global histogram statistical analysis is performed on the pixel-by-pixel thickness confidence heatmap to calculate the mean and standard deviation of the confidence scores of all pixels in the image. Based on the principle of three times the standard deviation, a high threshold of 0.3 and a low threshold of 0.225 are set, where the high threshold is used to capture significant thickness abrupt changes and the low threshold is used to capture subtle gradual unevenness.

[0179] By using a high threshold to binarize the heatmap, pixels with a confidence level greater than the high threshold are marked as 1, and the rest are marked as 0, generating a binary mask with significant thickness deviation. This mask can accurately locate high-confidence areas where ink is accumulated or severely missing.

[0180] By using a low threshold to binarize the same heatmap, pixels with a confidence level greater than the low threshold and less than or equal to the high threshold are marked as 1, and the rest are marked as 0, generating a potential gradient non-uniform binary mask that covers transition regions with slowly changing or slightly uneven thickness.

[0181] Perform logical AND or spatial superposition operations on binary masks with significant thickness deviations and binary masks with potential gradient inhomogeneity to construct a two-level set of defect candidate regions containing high-confidence defect cores and low-confidence diffusion edges.

[0182] By using a dual-threshold segmentation method, the continuous confidence heatmap from the previous step is transformed into hierarchical binary spatial mask data, which enables the initial separation and full-coverage capture of thickness unevenness defects of different severity, significantly reducing the false negative and false positive rates caused by a single threshold.

[0183] S7.2: Perform morphological fusion operation based on the binary mask with significant thickness deviation and the binary mask with potential gradient non-uniformity to generate an initial defect connected domain map, thereby establishing the basis of the original defect spatial distribution to be verified.

[0184] Receive the significant thickness deviation binary mask and the potential gradient non-uniformity binary mask output from step S7.1. Both are single-channel binary matrices with the same spatial resolution as the original image.

[0185] Morphological closing operations are performed on the binary mask with significant thickness deviations. A 3×3 rectangular structuring element is used for dilation and erosion to fill the micro-holes inside the high-confidence defect area and smooth the boundary jaggedness.

[0186] Morphological opening operations are performed on the potentially gradient-uniform binary mask, and erosion followed by dilation is performed using rectangular structuring elements of the same size to eliminate isolated noise pixels in the low-confidence transition region.

[0187] A pixel-by-pixel logical OR operation is performed between the significant deviation mask processed by the closing operation and the potential gradient mask processed by the opening operation to generate a preliminary fused binary map containing defect information at all levels.

[0188] An eight-connected-domain labeling algorithm is applied to the preliminary fused binary map. The entire map pixels are traversed and a unique integer identifier ID is assigned to each independent defect region based on the adjacency relationship, thus constructing an initial defect connected-domain index table.

[0189] Calculate the bounding rectangle coordinates and centroid position of each connected region, eliminate extremely small connected regions with an area smaller than the preset minimum noise threshold (e.g., 5 pixels), and retain candidate defect regions with actual physical significance.

[0190] By using morphological fusion and connected component labeling, the previous two-level binary mask was transformed into structured initial defect connected component map data, thus establishing a complete basis for the spatial distribution of uneven solder resist ink thickness defects.

[0191] For example, a significant deviation mask is set to contain a ring-shaped high-confidence region formed by ink accumulation, with a 2-pixel-sized hole inside; a potential gradient mask contains several scattered single-pixel noise points. After performing a 3×3 closing operation, the hole inside the ring-shaped region is filled, and the boundary becomes smooth; after performing a 3×3 opening operation, the scattered noise points are completely removed. After a logical OR operation, the two are merged into a complete connected region. After being marked with eight connectivity, this region is assigned ID=1, its bounding rectangle is (100,100) to (120,120), and its area is 350 pixels, which is greater than the minimum threshold of 5 pixels. Therefore, it is retained in the initial defect connected region map as a valid input object for subsequent geometric constraint verification.

[0192] S7.3: Obtain PCB layout geometric constraint data, and use the PCB layout geometric constraint data to perform spatial mapping matching operation on the initial defect connectivity map to eliminate false connectivity located outside the pad boundary or in areas with non-compliant trace spacing, thereby obtaining a set of geometrically compliant defect connectivity.

[0193] Obtain the initial defect connected component map generated in the previous steps. This map contains several binary mask regions and their corresponding pixel coordinate sets. Load the CAD layout data from the PCB design stage, and parse the pad geometric boundary polygons, solder mask opening areas, and trace spacing constraint parameters to construct a high-precision geometric constraint reference layer. Perform an affine transformation to align the pixel coordinate system of the initial defect connected component map with the physical coordinate system of the CAD layout data to eliminate spatial position deviations caused by imaging perspective or mechanical transmission. Traverse each independent connected component in the initial defect connected component map and extract its minimum bounding rectangle to narrow the calculation search range for geometric matching. For all foreground pixels within each connected component, query their attribute labels in the geometric constraint reference layer to identify pixel subsets located in the pad copper foil area or non-detection blind zone. Calculate the proportion of pixels belonging to the effective detection area in the connected component to the total number of pixels. If this proportion is lower than a preset compliance threshold, the connected component is determined to be a false edge response caused by pad boundary interference. For connected regions that cross trace spacing constraints, their aspect ratio and orientation consistency are analyzed to eliminate non-thickness anomalies caused by bridging effects or reflections. Connected regions that are completely within the solder resist ink coverage area and far from the pad edge safety distance are retained and marked as geometrically compliant candidates. Through the above spatial mapping matching and geometric attribute filtering operations, the initial defect connected region map is transformed into a set of geometrically compliant defect connected regions after removing structural interference, achieving accurate location and false alarm suppression of actual ink thickness unevenness defects.

[0194] For example, the PCB board size is 200mm × 150mm, and the image resolution is set to 20μm / pixel. CAD data parsing determines that the pad boundaries extend outward by 0.1mm as a safety buffer. An initial connected component contains 120 pixels, of which 85 pixels fall within the pad copper foil area. The effective solder mask pixel ratio is only 29.2%, lower than the set compliance threshold of 60%. The system determines this to be a false defect caused by reflection from the pad edge and discards it. Another connected component contains 200 pixels, all located in the insulation area between solder mask openings, and is 0.5mm from the nearest pad edge, satisfying geometric constraints. It is retained as a geometrically compliant defect connected component, significantly improving the accuracy of subsequent judgments.

[0195] S7.4: Perform topological connectivity verification and shape regularity analysis on the set of geometrically compliant defect connected domains to filter out noise spots that do not meet the minimum area threshold or spatial continuity requirements, thereby screening out the true thickness uneven defect connected domains.

[0196] Obtain the set of connected regions of geometric compliance defects output by step S7.3. This set contains several independently connected candidate defect regions and their corresponding pixel coordinate indices.

[0197] Perform an eight-neighbor topological traversal on each connected region in the set, and calculate the Euler number of its internal pixels and the number of holes to quantify the topological complexity of the region.

[0198] If isolated pixels or non-closed hole structures exist within a connected region, they are determined to be artifacts caused by noise interference and are directly removed.

[0199] For connected components that pass topological verification, extract their minimum bounding rectangle bounding box and calculate the aspect ratio of the bounding box and the fill rate of the actual area of ​​the connected component relative to the area of ​​the bounding box.

[0200] Set a shape regularity threshold. When the fill rate is lower than the preset lower limit or the aspect ratio is outside the reasonable range, the area is determined to be an irregular noise spot and a filtering operation is performed.

[0201] Calculate the distance distribution from all pixels in the connected domain to their geometric centroids, construct a radial density histogram, and evaluate the spatial aggregation characteristics of defect morphology.

[0202] The compactness index formula is used to quantitatively evaluate connected components: in, As a compactness indicator, The area of ​​the connected region. Let be the perimeter of the connected region.

[0203] If the calculated compactness index is less than the preset threshold, it indicates that the edge of the area is extremely broken or irregular, which does not conform to the physical diffusion law of the actual ink thickness unevenness defect, and it is marked as an invalid area.

[0204] The verification results of topological integrity, shape regularity and compactness indicators are integrated, and only connected components that simultaneously satisfy all three constraints are retained.

[0205] By using the above-mentioned multi-dimensional geometric feature verification processing method, the geometrically compliant connected domain of the previous step is transformed into a physically realistic thickness unevenness defect connected domain, which effectively filters out small noise spots and atypical artifacts, and significantly improves the accuracy and robustness of defect judgment.

[0206] For example, a geometrically compliant connected region detected on a PCB board surface contains 200 pixels and has a perimeter of 65 pixels. The compactness index is calculated to be approximately 0.59. A compactness threshold of 0.4 and a shape fill rate threshold of 0.6 are set. The connected region has a fill rate of 0.75 and an aspect ratio of 1.2, both meeting the regularity requirements. Because the S-value of 0.59 is greater than the threshold of 0.4, and the topology has no holes, it is determined to be a genuine defect. Another noisy connected region has an area of ​​10 pixels and a perimeter of 40 pixels; its calculated C-value is much less than 0.1, and it is automatically filtered out by the system. This process effectively eliminates more than 95% of isolated noise interference.

[0207] S7.5: Based on the actual thickness unevenness defect connected domain, calculate the area ratio parameter, maximum deviation rate parameter, and spatial distribution entropy parameter to generate a uniformity judgment conclusion containing three quantitative indicators, thereby completing the final comprehensive evaluation of the solder resist ink thickness uniformity.

[0208] Obtain the set of connected regions of true thickness unevenness defects after filtering in step S7.4. This set contains several independent connected defect regions and their corresponding pixel coordinate indices and original confidence scores.

[0209] Traverse each connected region of the real thickness unevenness defect, count the total number of valid pixels contained in the connected region, and define it as the absolute area pixel value of the defect region.

[0210] Calculate the total number of pixels in the effective detection area of ​​the entire image, divide the absolute area pixel value of the defect area by the total number of pixels in the effective detection area of ​​the entire image to obtain the area ratio parameter, and quantify the degree of defect coverage on the overall board surface.

[0211] Extract the original confidence scores of all pixels in the connected domain from the pixel-by-pixel thickness confidence heatmap output in step S6, and construct a local confidence distribution sequence.

[0212] A maximum value retrieval operation is performed on the local confidence distribution sequence to identify the highest confidence pixel in the connected region. This highest confidence value is then mapped to the maximum deviation rate parameter, which characterizes the extreme degree to which the ink thickness deviates from the standard value at that location.

[0213] Based on the local confidence distribution sequence, calculate the discrete probability distribution of the confidence value of each pixel relative to the average confidence of the connected component.

[0214] The information entropy value of the discrete probability distribution is calculated using the Shannon entropy formula and used as a spatial distribution entropy parameter to measure the degree of disorder and spatial aggregation characteristics of the uneven thickness inside the defect.

[0215] The calculated area percentage parameter, maximum deviation rate parameter, and spatial distribution entropy parameter are combined into a three-dimensional quantization vector, which serves as the final feature descriptor for the connected domain.

[0216] If any parameter exceeds the allowable range by comparing it with the preset quality judgment threshold matrix, the PCB board is marked as unqualified, and an inspection report containing the specific defect location and quantitative indicators is generated.

[0217] Through the above multi-dimensional parameter quantification process, the binary connected domain of the previous step is transformed into a quantifiable quality evaluation index, thereby realizing a refined comprehensive evaluation of the uniformity of solder resist ink thickness.

[0218] For example, in a high-density interconnect PCB board, a real defective connected region located in the trace gap was detected. This connected region contains 500 effective pixels, and the effective detection area of ​​the entire image is 2,000,000 pixels, with a calculated area ratio of 0.025%. The highest built-in confidence value of this region is 0.85, which maps to a maximum deviation rate of 85%, indicating a severe ink deficiency. The Shannon entropy value of the built-in confidence distribution of the region is 3.2 bits, which is higher than the preset threshold of 2.5 bits, indicating that the thickness variation inside the defect is drastic and irregular. Based on this, the system determines that the region is a high-risk defect, triggers an alarm, and records the coordinates, significantly improving the traceability and accuracy of quality inspection.

[0219] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.

[0220] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the elements or objects preceding “comprising” or “including” encompass the elements or objects listed following “comprising” or “including” and their equivalents, and do not exclude other elements or objects. The “multiple” mentioned in the embodiments of this application refers to two or more. A and / or B indicate three possibilities: A; B; and A and B.

[0221] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A visual inspection method for the uniformity of solder resist ink thickness, characterized in that, Specifically, it includes: S1: Obtain the original RGB image data of the solder resist ink surface, and simultaneously perform multi-dimensional feature extraction operation on the original RGB image data to generate an initial multimodal feature set; S2: Based on the spatial resolution of the initial multimodal feature set, a neighborhood window is defined for each pixel position, and the pixel values ​​of the initial multimodal feature set are sorted within the neighborhood window to obtain a trend vector set; S3: Construct a modal consistency matrix using a trend vector set, and dynamically adjust a preset threshold based on the texture complexity of the current neighborhood window. Generate a sparse mask identifier based on the modal consistency matrix and the preset threshold. S4: Perform a channel zeroing operation on the initial multimodal feature set according to the sparse mask identifier to obtain a sparse multimodal feature map; S5: Count the number of remaining effective modes at each position in the sparse multimodal feature map, and dynamically select an aggregation strategy based on the numerical range of the number of remaining effective modes to generate an aggregated thickness feature map; S6: Input the aggregated thickness feature map into the thickness mapping network for pixel-by-pixel inference operation to output a pixel-by-pixel thickness confidence heatmap; S7: Perform a double threshold segmentation operation on the pixel-by-pixel thickness confidence heatmap and perform topological connectivity verification in conjunction with PCB layout geometric constraints, and finally generate a uniformity judgment conclusion that includes three quantitative indicators: area ratio, maximum deviation rate and spatial distribution entropy.

2. The visual inspection method for the uniformity of solder resist ink thickness according to claim 1, characterized in that, The multidimensional feature extraction operation to generate an initial multimodal feature set includes at least two of the following: calculating an edge gradient magnitude map, generating a local contrast normalization map, constructing an HSV hue stability map, and applying a direction-sensitive Gaussian difference filter to generate a light intensity gradient distribution map.

3. The visual inspection method for the uniformity of solder resist ink thickness according to claim 1, characterized in that, The construction of the modal consistency matrix using the trend vector set includes: The Kendall rank correlation coefficient between any pair of modal trend vectors is calculated using the trend vector set to construct a modal consistency matrix.

4. The visual inspection method for the uniformity of solder resist ink thickness according to claim 1, characterized in that, The thickness mapping network is composed of depth-separable convolutional stacks.

5. The visual inspection method for the uniformity of solder resist ink thickness according to claim 2, characterized in that, S2 specifically includes: Based on the spatial resolution of the initial multimodal feature set, a fixed-size neighborhood window is defined for each pixel position in the edge gradient magnitude map, local contrast normalization map, HSV hue stability map, and light intensity gradient distribution map. Using the neighborhood window, the pixel grayscale values ​​of the multidimensional feature maps covered within the window are sorted in ascending order, and the original feature intensity values ​​are mapped to the corresponding level numbers, thereby generating four independent local rank sequences. Based on the four independent local rank sequences, they are reorganized into structured data units according to modal categories to construct local response trend vectors; By traversing all pixel locations in the original image, all local response trend vectors are obtained, and the initial multimodal feature set covering the entire image is completely transformed into a trend vector set covering all local regions.

6. The visual inspection method for the uniformity of solder resist ink thickness according to claim 1, characterized in that, S3 specifically includes: Perform Kendall's rank correlation coefficient calculation on any two different modal rank sequences in the trend vector set to generate an initial correlation dataset containing the correlation values ​​of all pairwise modal combinations. A four-dimensional modality consistency matrix is ​​constructed based on the numerical distribution in the initial correlation dataset, and the calculated Kendall rank correlation coefficients are filled into the corresponding positions in the matrix to form the modality consistency matrix. Local variance statistical analysis is performed on the original pixel grayscale values ​​within the neighborhood window to evaluate the surface texture complexity, and the preset correlation judgment threshold is dynamically adjusted based on the texture complexity value obtained from the analysis, thereby generating an adaptive dynamic threshold parameter. Preliminary sparsity determination results are obtained based on adaptive dynamic threshold parameters and modal consistency matrix; Based on the preliminary sparsity determination results, binarization encoding is performed on all pixel positions in the entire image to obtain sparsity mask identifiers.

7. The visual inspection method for the uniformity of solder resist ink thickness according to claim 6, characterized in that, The preliminary sparsity determination result obtained based on the adaptive dynamic threshold parameter and the modal consistency matrix includes: The adaptive dynamic threshold parameter is used to traverse and compare each row of data in the modality consistency matrix. When the average correlation value of a certain mode with other modes is lower than the adaptive dynamic threshold parameter, the mode is determined to be an abnormal response mode, thereby generating a preliminary sparsification determination result that marks the location of the abnormal mode.

8. The visual inspection method for the uniformity of solder resist ink thickness according to claim 7, characterized in that, The step of performing binary encoding processing on all pixel positions in the entire image based on the preliminary sparsity determination result to obtain sparsity mask identifiers includes: Based on the preliminary sparsity determination result, binary encoding processing is performed on all pixel positions in the entire image. Modal channels that are determined to be normal responses are marked as retained, and modal channels that are determined to be abnormal responses are marked as discarded, thus generating sparsity mask identifiers.

9. The visual inspection method for the uniformity of solder resist ink thickness according to claim 6, characterized in that, The local variance statistical analysis employs unbiased estimation and uses dynamic threshold adjustment based on texture complexity, increasing the correlation threshold in low-complexity regions and decreasing the threshold in high-complexity regions.

10. The visual inspection method for the uniformity of solder resist ink thickness according to claim 1, characterized in that, The dynamic selection aggregation strategy is based on the number of effective modes. For three or more modes, the median is used; for two modes, the geometric mean is used; and for a single mode, the mean of the neighborhood is linearly superimposed and corrected.