Image analysis-based screen printing defect detection method and system
By using image analysis to calculate the squeegee axis direction and microstructure scale, and constructing a skew field and directional convolutional network, the problem of unstable detection results in traditional screen printing inspection methods is solved. This enables adaptive defect detection, reduces false detections and missed detections, adapts to the characteristics of different screen printing products, and meets the quality control needs of industrial production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGSHAN YISHAN OPTICS CO LTD
- Filing Date
- 2026-01-20
- Publication Date
- 2026-06-05
AI Technical Summary
Traditional screen printing defect detection methods cannot adapt to the differences in characteristics of different products, resulting in unstable detection results. They are difficult to accurately distinguish between natural variations and real defects, and lack a mechanism to differentiate the essential characteristics of natural variations and real defects, which easily leads to false detections or missed detections.
By using image analysis-based methods, the scraper axis direction and microstructure scale are calculated, a skewness field and directional convolutional network are constructed, and combined with adaptive thresholding and morphological processing, a binary image is generated and defect information is output.
It achieves adaptive detection without the need for manual setting of key parameters, reduces false detections and missed detections, ensures the consistency and reliability of detection results, adapts to the characteristics of different screen-printed products, and meets the quality control needs of industrial production.
Smart Images

Figure CN122156056A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image analysis technology, and more specifically, to a method and system for detecting screen printing defects based on image analysis. Background Technology
[0002] Screen printing technology is widely used in electronic components, printed circuit boards, packaging materials and other fields. Its product quality directly affects the performance and reliability of the end products. Defect detection is a key link in the screen printing production process. It is necessary to accurately identify real defects such as pinholes, dents and breaks to ensure product qualification.
[0003] During the screen printing process, the interaction between the squeegee movement and the screen will create natural variations such as striped screen marks, splitting thick film ridges, and coffee ring edges. The grayscale distribution characteristics of these natural variations are similar to those of real defects, making it difficult to distinguish between the two directly in the image. At the same time, the mesh size, opening size, and squeegee movement direction of different screen printing products vary, resulting in diversity in the characteristic scale and direction of natural variations and defects.
[0004] Traditional screen printing defect detection methods often rely on manually setting key parameters, including the direction of squeegee movement, the size of the detection window, and thresholds. These manual parameters cannot be adapted to the characteristics of different products, easily leading to unstable detection results. Some methods use multi-feature stacking or black-box models for defect identification, but they do not take into account the physical characteristics of the screen printing process, making it difficult to establish a clear correlation between features and defects, further reducing the accuracy of detection. In addition, traditional methods lack a mechanism to distinguish between the essential characteristics of natural variations and real defects, which easily leads to false detections or false negatives, making it difficult to meet the requirements of industrial production for detection reliability and adaptability. Summary of the Invention
[0005] This invention provides a method and system for detecting screen printing defects based on image analysis, which solves the technical problems mentioned in the background.
[0006] This invention provides a screen printing defect detection method based on image analysis, comprising the following steps: Step S101: Calculate the second-order moment matrix of the gradient of the entire image for the input grayscale image, extract the eigenvector corresponding to the largest eigenvalue and perform normalization processing to determine the direction of the scraper axis; Step S102: Perform a two-dimensional Fourier transform on the grayscale image, statistically analyze the power spectrum energy distribution in the frequency domain sector perpendicular to the scraper axis, extract the frequency corresponding to the energy peak and calculate its reciprocal to determine the microstructure scale. Step S103: Calculate the directional derivative of the grayscale image along the scraper axis. Within a local window whose side length is determined by the microstructure scale, calculate the normalized third-order central moment of the directional derivative to construct the skewness field. Step S104: Construct a directional convolutional network, use a directional Gaussian derivative kernel determined analytically by the scraper axis direction and microstructure scale to convolve the grayscale image, and map the skewness field to the gating coefficient to modulate the convolution result layer by layer, and output the defect response map; Step S105: Determine an adaptive threshold based on the defect response map to generate a binary image. Perform anisotropic opening operation on the binary image along the scraper axis using line segment structuring elements whose length matches the microstructure scale to obtain a binary mask. Step S106: Perform connected component labeling on the binary mask, extract and output the centroid coordinates, pixel area and bounding box of the silkscreen defect.
[0007] This invention provides an image analysis-based screen printing defect detection system, comprising: The scraper axis direction determination module calculates the second-order moment matrix of the gradient of the entire image on the input grayscale image, extracts the feature vector corresponding to the largest eigenvalue and performs normalization processing to determine the scraper axis direction; The microstructure scale determination module performs a two-dimensional Fourier transform on the grayscale image, statistically analyzes the power spectrum energy distribution in the frequency domain sector perpendicular to the scraper axis, extracts the frequency corresponding to the energy peak and calculates its reciprocal to determine the microstructure scale. The skewness field construction module calculates the directional derivative of the grayscale image along the scraper axis, and within a local window whose side length is determined by the microstructure scale, calculates the normalized third-order central moment of the directional derivative to construct the skewness field. The defect response map construction module constructs a directional convolutional network, uses a directional Gaussian derivative kernel determined analytically by the scraper axis direction and microstructure scale to convolve the grayscale image, and maps the skewness field to gating coefficients to modulate the convolution result layer by layer, outputting the defect response map; The binary mask construction module determines an adaptive threshold based on the defect response map to generate a binary image. It then performs anisotropic opening operations on the binary image along the scraper axis using line segment structuring elements whose length matches the microstructure scale to obtain a binary mask. The screen printing defect output module performs connected component labeling on the binary mask and extracts and outputs the centroid coordinates, pixel area, and bounding box of the screen printing defect.
[0008] The beneficial effects of this invention are as follows: By automatically estimating the scraper axis direction and microstructure scale, this invention eliminates the need for manual setting of key parameters, adapting to the characteristics of different screen-printed products and avoiding detection fluctuations caused by parameter mismatches. It relies on skewness fields to capture the essential differences in natural variations and defects, combined with layer-by-layer gating modulation of directional convolutional networks, reducing false positives and false negatives and ensuring consistent detection results. Subsequently, it generates binary images through adaptive thresholding, and performs morphological processing using line segment structural elements matched to the microstructure scale, effectively removing artifact interference. Finally, it outputs standardized information such as centroid coordinates, pixel area, and bounding box through connected component quantization, meeting the needs of defect localization and assessment in industrial production. The entire detection process requires no manual intervention, balancing detection stability and efficiency, and is suitable for the actual application scenarios of screen-printed production lines, thus providing reliable support for quality control and process adjustment. Attached Figure Description
[0009] Figure 1 This is a flowchart of the image analysis-based screen printing defect detection method of the present invention; Figure 2 This is a schematic diagram of the screen printing defect detection system based on image analysis of the present invention; Figure 3 This is a schematic diagram of the scenario of the present invention.
[0010] In the figure: scraper axis direction determination module 201, microstructure scale determination module 202, skewness field construction module 203, defect response map construction module 204, binary mask construction module 205, screen printing defect output module 206. Detailed Implementation
[0011] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.
[0012] It should be noted that, unless otherwise defined, the technical or scientific terms used in one or more embodiments of the present invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in one or more embodiments of the present invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" indicate that the element or object preceding the term encompasses the elements or objects listed following the term and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0013] like Figures 1-3 As shown, the image analysis-based screen printing defect detection method includes the following steps: Step S101: Calculate the second-order moment matrix of the gradient of the entire image for the input grayscale image, extract the eigenvector corresponding to the largest eigenvalue and perform normalization processing to determine the direction of the scraper axis; Step S102: Perform a two-dimensional Fourier transform on the grayscale image, statistically analyze the power spectrum energy distribution in the frequency domain sector perpendicular to the scraper axis, extract the frequency corresponding to the energy peak and calculate its reciprocal to determine the microstructure scale. Step S103: Calculate the directional derivative of the grayscale image along the scraper axis. Within a local window whose side length is determined by the microstructure scale, calculate the normalized third-order central moment of the directional derivative to construct the skewness field. Step S104: Construct a directional convolutional network, use a directional Gaussian derivative kernel determined analytically by the scraper axis direction and microstructure scale to convolve the grayscale image, and map the skewness field to the gating coefficient to modulate the convolution result layer by layer, and output the defect response map; Step S105: Determine an adaptive threshold based on the defect response map to generate a binary image. Perform anisotropic opening operation on the binary image along the scraper axis using line segment structuring elements whose length matches the microstructure scale to obtain a binary mask. Step S106: Perform connected component labeling on the binary mask, extract and output the centroid coordinates, pixel area and bounding box of the silkscreen defect.
[0014] In one embodiment of the present invention, the process of calculating the second-order moment matrix of the gradient of the entire input grayscale image, extracting the eigenvector corresponding to the largest eigenvalue and performing normalization processing, and determining the scraper axis direction includes: Define the input grayscale image and pixel domain: Let the input grayscale image be... Define the pixel domain as ; Calculate the smooth gradient: ; in For horizontally smooth gradients, Smooth gradient in the vertical direction; The variance is Gaussian kernel; This is a convolution operation; Input grayscale image exist Partial derivatives in direction, Input grayscale image exist Partial derivatives in direction; Construct the second-order moment matrix of the gradient of the entire graph: ; in The gradient second-order moment matrix of the entire graph; Indicated in pixel domain Accumulate data across the entire map within the map; Feature vector extraction and normalization: ; in The direction of the scraper axis; For the gradient second moment matrix of the whole graph The eigenvector corresponding to the largest eigenvalue obtained after eigenvalue decomposition; For feature vectors The Euclidean norm.
[0015] It should be noted that the input grayscale image is a grayscale image used for screen printing defect detection. It can be obtained by photographing the surface of the screen-printed product using an industrial camera. During photography, uniform lighting must be ensured, and the camera resolution must match the scale of the screen printing microstructure to avoid image blurring or distortion. The pixel domain is the set of all pixel coordinates in the input grayscale image. The preferred value is the range of pixel coordinates in the input grayscale image, i.e., the horizontal coordinate from 0 to the image width minus 1, and the vertical coordinate from 0 to the image height minus 1. The Gaussian kernel with specified variance is the filtering template corresponding to a Gaussian function with a specified variance. The preferred value is a variance between 0.5 and 2.0; for example, when the image noise is low, a variance of 0.5 to 1.0 is used; when the image noise is high, a variance of 1.0 to 2.0 is used to ensure that critical gradient information is not lost while smoothing noise. The partial derivative in the horizontal direction is the rate of change of grayscale in the input grayscale image in the horizontal direction. The partial derivative in the vertical direction is the rate of change of grayscale in the input grayscale image in the vertical direction. The horizontal smoothing gradient is the gradient value obtained by convolving a Gaussian kernel with a set variance with the partial derivative in the horizontal coordinate direction. The vertical smoothing gradient is the gradient value obtained by convolving a Gaussian kernel with a set variance with the partial derivative in the vertical coordinate direction. The second-order moment matrix of the overall image gradient is a 2x2 matrix constructed by summing the squares of the horizontal smoothing gradient, the product of the horizontal and vertical smoothing gradients, and the squares of the vertical smoothing gradient across the entire image in the pixel domain. The eigenvector corresponding to the largest eigenvalue is the vector corresponding to the largest eigenvalue after eigenvalue decomposition of the overall image gradient second-order moment matrix. The scraper axis direction is the unit vector obtained by normalizing the eigenvector corresponding to the largest eigenvalue using the Euclidean norm, reflecting the main direction of scraper movement.
[0016] It should be noted that the full-image accumulation process uses equal-weight accumulation, meaning that the square of the horizontal smooth gradient, the product of the horizontal and vertical smooth gradients, and the square of the vertical smooth gradient for each pixel all have a weight of 1 during accumulation. No additional weighting coefficients are needed because the purpose of this accumulation is to statistically analyze the overall second-order information of the gradients across the entire image. Equal-weight accumulation objectively reflects the gradient distribution characteristics of the entire image. Furthermore, when multiple equal maximum eigenvalues exist, any one of the corresponding eigenvectors can be selected. The eigenvectors corresponding to multiple equal maximum eigenvalues all point in the direction of maximum gradient energy, accurately representing the scraper axis direction and not affecting the final detection result.
[0017] It should be noted that the eigenvalue decomposition method in linear algebra is used to decompose the second-order moment matrix of the gradient of the entire image, obtaining two eigenvalues and two corresponding eigenvectors. The magnitudes of the two eigenvalues are compared, and the eigenvector corresponding to the largest eigenvalue is selected. The Euclidean norm of this eigenvector is calculated, and each element of the eigenvector is divided by the Euclidean norm to obtain a unit vector. This unit vector is the direction of the scraper axis, and its direction is consistent with the direction of the maximum gradient energy in the image. Since the gradient energy of the screen printing strip marks caused by the scraper movement is most concentrated, this unit vector can accurately represent the main direction of the scraper movement. Therefore, this invention is based on the characteristics of strong gradient energy and concentrated direction of the strip marks formed by the scraper movement during screen printing. The image gradient is smoothed with a Gaussian kernel to suppress noise, the second-order moment matrix of the gradient of the entire image is constructed to statistically analyze the second-order gradient information of the entire image, and the eigenvector corresponding to the largest eigenvalue is extracted by eigenvalue decomposition and normalized to determine the direction of the scraper axis. No manual setting is required, avoiding the subjectivity of setting the direction based on experience. This ensures that the direction of the scraper axis matches the physical structure of the screen printing, providing a unified geometric reference for subsequent orientation calculations and guaranteeing the consistency and reliability of the inspection process. Further details will not be elaborated here.
[0018] In one embodiment of the present invention, a two-dimensional Fourier transform is performed on the grayscale image, and the power spectrum energy distribution is statistically analyzed in a frequency domain sector perpendicular to the scraper axis. The frequency corresponding to the energy peak is extracted and its reciprocal is calculated to determine the microstructure scale, including: Perform a two-dimensional Fourier transform: ; in It is a complex-valued function in the frequency domain; Input a grayscale image; For pixel fields; In radian frequency coordinates; The imaginary unit; Define frequency domain sectors: ; ; in For frequency domain sectors; It is a vector in the vertical direction; scraper axis direction The amount; It is the vertical polar angle; It is the arctangent function in the four quadrants; Half the width of the sector; Frequency domain orientation angle; Statistical power spectrum energy distribution: ; ; in The radial energy curve; Power spectral energy density; Radial frequency in radians; Determine the microstructure scale: ; in At the microstructure scale; This indicates the location of the energy peak. The conversion factor is 2π (approximately 6.283). This means that the radial frequency in the frequency domain is inversely proportional to the spatial period in the spatial domain. The spatial period (microstructure scale) is equal to 2π divided by the radial frequency. The conversion factor 2π (approximately 6.283) is a direct reflection of this mathematical relationship, ensuring that the conversion result accurately reflects the actual spatial period of the screen-printed microstructure.
[0019] It should be noted that the frequency domain complex-valued function is the complex form function formed in the frequency domain after the input grayscale image undergoes a two-dimensional Fourier transform. The vertical direction vector is a vector orthogonal to the scraper axis direction, derived from the horizontal and vertical components of the scraper axis direction. The vertical polar angle is the angle of the vertical direction vector in the polar coordinate system, calculated using the four-quadrant arctangent function. The set sector half-width is the half-width of the center angle set when constructing the frequency domain sector, preferably between 5 and 15 degrees. The actual value needs to be adjusted according to the directional concentration of the silkscreen texture. The more concentrated the texture direction, the more suitable the sector half-width can be between 5 and 10 degrees; the more dispersed the texture direction, the more suitable it can be between 10 and 15 degrees, ensuring that the sector can completely cover the energy distribution of the main texture frequency. The frequency domain sector is the frequency domain region centered on the vertical polar angle and within the set sector half-width. The power spectral density is the square of the modulus of the frequency domain complex-valued function in the polar coordinate system, representing the energy intensity at the corresponding position in the frequency domain. The radial energy curve is a curve showing the change of energy with radial frequency obtained by aggregating and integrating the power spectrum energy density along the direction angle within a frequency domain sector. The energy peak position is the radial frequency corresponding to the maximum energy value in the radial energy curve. The conversion factor is a constant used to convert the energy peak position (frequency) into a microstructure scale (spatial period). The microstructure scale is the spatial period of microstructures such as the edge of the screen printing mesh opening strip, which is obtained by multiplying the reciprocal of the energy peak position by the conversion factor.
[0020] It should be noted that the trapezoidal numerical integration method is used to aggregate and integrate the power spectrum energy density along the direction angle, with a fixed integration step size of 1 degree and the integration range being the direction angle interval of the frequency domain sector. During calculation, the direction angle within the interval is divided according to the step size. The power spectrum energy density corresponding to each step size is multiplied by the step size. The energy density of adjacent steps is averaged and then multiplied by the step size. All results are accumulated to obtain the integrated energy at that radial frequency. The sliding window method is used to search for the energy peak position in the radial energy curve. The window size is 5 sampling points, and the window sliding step size is 1 sampling point. The maximum energy value and the corresponding radial frequency within each window are calculated, and all local maxima are recorded. 0.5 times the global maximum energy is set as the peak value determination threshold. Local maxima less than the threshold are eliminated, and the largest of the remaining local maxima is the target peak value, and its corresponding radial frequency is the energy peak position.
[0021] It should be noted that constructing frequency domain sectors includes: first, obtaining the horizontal and vertical components along the scraper axis; the horizontal component of the vertical vector is taken as the negative value of the vertical component along the scraper axis, and the vertical component is taken as the horizontal component along the scraper axis, ensuring that the two are orthogonal; then, calculating the vertical polar angle of the vertical vector using the four-quadrant arctangent function, which accurately reflects the angle of the vector in the polar coordinate system; finally, expanding the sector half-width (5 degrees to 15 degrees) to both sides of the vertical polar angle to form frequency domain sectors, ensuring that the sectors accurately cover the main texture frequency range perpendicular to the scraper axis. The radial energy curve is calculated by first converting the rectangular coordinates (radian frequency coordinates) of the frequency domain complex-valued function to polar coordinates, where the radial frequency is the distance from the origin to that point, and the direction angle is the angle between that point and the horizontal axis; the power spectral energy density is the squared magnitude of the frequency domain complex-valued function in the converted polar coordinates; the aggregate integration adopts the trapezoidal numerical integration method with an integration step size of 1 degree, and integrates the power spectral energy density within the direction angle range corresponding to each radial frequency in the frequency domain sector, with each radial frequency corresponding to one integration result, and all results are sorted by radial frequency to form the radial energy curve.
[0022] It should be noted that this invention utilizes the periodicity of the screen-printed microstructure (the edge of the mesh opening strip) in the direction perpendicular to the squeegee axis. A two-dimensional Fourier transform maps the spatial domain grayscale distribution to the frequency domain, focusing on the statistical power spectrum energy distribution of the frequency domain sector perpendicular to the squeegee axis. The frequency corresponding to the energy peak is found, and the microstructure scale is determined through the conversion relationship between frequency and spatial period. Without manually setting scale parameters, the scale is automatically estimated from the frequency domain data based on the periodic characteristics of the screen-printed physical structure. This ensures that the microstructure scale matches the actual micro-geometry of the screen-printed material, providing an accurate scale reference for subsequent calculations such as directional derivative calculations, local window setting, and morphological structural element design. This avoids deviations caused by empirically set scales, ensures the consistency of scale parameters in the inspection process, and improves the reliability of subsequent inspection steps.
[0023] In one embodiment of the present invention, the directional derivative of the grayscale image is calculated along the scraper axis. Within a local window whose side length is determined by the microstructure scale, the normalized third-order central moment of the directional derivative is calculated to construct a skewness field, including: Calculate the directional derivative: ; in The directional derivative field is along the scraper axis. Input a grayscale image; For pixel fields; In the direction of the scraper axis, These are the transverse and longitudinal components along the scraper axis, respectively. The input grayscale images are respectively Partial derivatives in the horizontal and vertical directions; Define a local window: ; in For local windows; At the microstructure scale; The coordinates of the center pixel; For traversing pixel coordinates within the window; This represents the number of pixels within the local window. Calculate local statistics: ; ; in This is the local mean of the directional derivative; The local standard deviation of the directional derivative; Constructing the skewness field: ; in The output is the pixel-level value of the skewness field. As a gating mapping input.
[0024] It should be noted that the directional derivative field is the set of gray-level change rates along the scraper axis, reflecting the gray-level distribution characteristics of the input gray-level image along the scraper axis. The local window is a square region centered on a single pixel in the input gray-level image, with a side length equal to the microstructure scale. The third central moment is the sum of the cubes of the differences between the directional derivative values and the local mean within the local window, divided by the number of pixels, reflecting the asymmetry trend of the directional derivative distribution within the local window. The pixel-level values of the skewness field are obtained by dividing the third central moment by the cube of the local standard deviation, reflecting the skewness characteristics of the directional derivative distribution in the local region where a single pixel is located. The skewness field is a global scalar field composed of the pixel-level skewness field values of all pixels in the input gray-level image, reflecting the spatial distribution characteristics of the skewness of the directional derivative distribution in various local regions of the entire image.
[0025] It should be noted that the horizontal and vertical components of the scraper axis are components of the unit vector in that direction, and their values reflect the projection ratio of that direction in the horizontal and vertical directions. Using the components as weighting coefficients, the partial derivatives in the horizontal and vertical directions can be fused according to the projection ratio of the scraper axis, so as to accurately obtain the gray-level change rate along that direction. For example, if the horizontal component of the scraper axis is 0.8 and the vertical component is 0.6, and the horizontal partial derivative of a certain pixel is 10 and the vertical partial derivative is 5, then the directional derivative of that pixel is 0.8×10+0.6×5=11, which accurately represents the intensity of gray-level change along the scraper axis. Furthermore, the microstructure scale is the spatial period of microstructures such as screen printing mesh openings. Using this as the window side length ensures that the window covers a single microstructure unit, and the statistical results can reflect the directional derivative distribution characteristics within that microstructure unit. For example, when the microstructure scale is 10 pixels, the local window is a 10×10 pixel square, containing a complete screen printing mesh unit. The calculated local mean and standard deviation can accurately describe the grayscale variation distribution pattern within the unit, avoiding statistical biases caused by windows that are too large to contain multiple microstructures or too small to cover a single microstructure.
[0026] It should be noted that the Sobel filter operator is used to calculate the horizontal and vertical partial derivatives of the input grayscale image, with a fixed step size of 1, meaning the coordinate difference between adjacent pixels is 1. The horizontal and vertical partial derivative images are obtained by convolving the filter operator with the image. This process preserves edge information while suppressing noise, which will not be elaborated upon here. When the local window is a square region, pixels with a coordinate difference equal to half the microstructure scale are retained. When the local standard deviation is zero, it indicates that all directional derivative values within the local window are equal and the distribution is unskewed. In this case, the pixel-level value of the skewness field at that location is directly set to 0 to avoid meaningless division operations and accurately represent the local distribution characteristics. Furthermore, when the center of the local window is close to the image boundary and the window range exceeds the image boundary, only the actual number of pixels within the image boundary is counted to ensure that the statistical sample is real pixel data and avoid errors introduced by virtual pixels.
[0027] In one embodiment of the present invention, a directional convolutional network is constructed, which convolves a grayscale image using a directional Gaussian derivative kernel analytically determined by the scraper axis direction and microstructure scale, and maps the skewness field to gating coefficients to modulate the convolution result layer by layer, outputting a defect response map, including: Construction of directional Gaussian derivative kernel: ; in For the first The directional Gaussian derivative kernel of the layer; In the direction of the scraper axis, These are the transverse and longitudinal components along the scraper axis, respectively. At the microstructure scale; For kernel coordinates; This is the partial derivative with respect to the kernel coordinates; The standard deviation is equal to A two-dimensional Gaussian function; For the first The scale factor of the layer; Convolution operation: Let For each layer calculate: ; in Input a grayscale image; This is the initial input; For the first The convolution result of the layer; Output the image for the layer above; Represents spatial domain convolution; Mapping from skewness field to gating coefficients: ; in For the gated coefficient field; It is a skewness field; This is the skewness scaling constant; It is the hyperbolic tangent function; Layer-by-layer modulation: ; in For the first Layer output image after layer modulation; The gate strength constant; Defect response diagram output: Let the number of network layers be . ,definition: ; in This is a defect response diagram; Output the image for the last layer.
[0028] It should be noted that the directional convolutional network is a forward inference network composed of multiple layers of directional convolution and gating modulation. The scale coefficient is a constant set for each layer of the directional convolutional network, used to adjust the standard deviation of the directional Gaussian derivative kernel. It is preferably set to 0.5 to 2.0, and increases layer by layer (e.g., 0.5 for layer 1, 1.0 for layer 2, and 1.5 for layer 3), ensuring coverage of multi-scale features from microstructures to defects, while avoiding redundant computations caused by scale overlap. The two-dimensional Gaussian function uses a standard two-dimensional Gaussian function, in the form of a negative exponential function (the sum of the squares of the kernel coordinates horizontally and vertically) divided by twice the square of the standard deviation, and then divided by twice the product of pi and the square of the standard deviation. That is, the function value decays as the distance from the kernel coordinates to the center increases, ensuring a smooth distribution of kernel weights. The directional Gaussian derivative kernel is a filter kernel analytically aligned with the scraper axis and the microstructure scale, reflecting the ability to extract grayscale variation features along a specific direction.
[0029] It should be noted that the initial input image is the input to the first layer of the directional convolutional network, i.e., the original input grayscale image. The layer input image is the input data for a specific layer of the directional convolutional network; the previous layer uses the initial input image, and subsequent layers use the output image of the previous layer. The convolution result is obtained by spatial domain convolution of the directional Gaussian derivative kernel with the layer input image, reflecting the feature information extracted along the scraper axis. The skewness scaling constant is a constant used to adjust the numerical range of the skewness field, preferably set to 1 to 3. This setting is based on the fact that the pixel-level value of the skewness field is usually in the range of -3 to 3, which can amplify the skewness value to the sensitive range of the hyperbolic tangent function (-6 to 6), making the skewness difference between natural variations and defects more significant, and the gating modulation effect more obvious. The gating coefficient field is the coefficient field obtained after scaling the skewness field and mapping it to the hyperbolic tangent function, reflecting the spatial distribution of modulation weights based on skewness features. The gating strength constant is a constant used to adjust the influence of the gating coefficient field. A preferred value is 0.5 to 1.5. When natural variation suppression is insufficient, the value is increased (e.g., 1.2 to 1.5); when the defect response is over-suppressed, the value is decreased (e.g., 0.5 to 0.8) to ensure that defect features are not lost while suppressing natural variation. The modulation term is the result of multiplying the gating coefficient field by the gating strength constant and then adding 1, reflecting the adjustment coefficient of the convolution result. The layer output image is the image obtained by multiplying the modulation term by the convolution result point by point, reflecting the final output of each layer of directional convolution and gating modulation. The number of network layers is the total number of layers in the directional convolutional network, preferably 3 to 5 layers. The defect response map is the layer output image of the last layer of the directional convolutional network, reflecting the degree of defect suspicion for each pixel in the entire image.
[0030] It should be noted that the product of the scale coefficient and the microstructure scale determines the standard deviation of the two-dimensional Gaussian function, ensuring that the kernel scale matches the screen printing microstructure; the transverse and longitudinal components along the scraper axis serve as weighting coefficients for the directional derivative, aligning the sensitive direction of the kernel with the scraper axis. In the skewness field, the skewness value in the naturally varied region deviates from zero, while the skewness value in the defective region is close to zero; multiplying by the skewness scaling constant amplifies the skewness difference; the hyperbolic tangent function maps it to -1 to 1, with the naturally varied region corresponding to positive and negative gating coefficients, and the defective region corresponding to gating coefficients close to 0; multiplying by the gating strength constant and adding 1 causes the modulation term in the naturally varied region to deviate from 1, while the modulation term in the defective region is close to 1; when multiplied point-by-point with the convolution result, the convolution response in the naturally varied region is suppressed, while the convolution response in the defective region is preserved. Using a grayscale image as the initial input, the network undergoes multi-layer directional convolution and gated modulation iterative operations. The output of the final layer is then extracted as the defect response map. This process includes: the first layer extracts features of small components using a small-scale directional kernel, and then suppresses natural variations through gated modulation; subsequent layers use larger-scale directional kernels to extract more complex features, continuously strengthening the defect response through gated modulation; and multiple iterations allow features to accumulate gradually, amplifying the difference between defects and natural variations. For example, in a three-layer network, the first layer extracts microstructural edge features, the second layer fuses adjacent edge information, and the third layer integrates globally relevant features. In the final output defect response map, the response value of the defect region is significantly higher than that of the naturally varied region, achieving effective differentiation.
[0031] It should be noted that this invention is based on the difference in skewness characteristics between natural variations and defects in screen printing. It uses the scraper axis direction and microstructure scale to analytically determine the directional Gaussian derivative kernel, enabling the convolution operation to accurately extract features along this direction. The skewness field is mapped to a gating coefficient field, and the convolution results are modulated layer by layer to suppress the response of natural variations and retain the response of defects. By iteratively accumulating features through multiple layers, the distinguishability between defects and natural variations is enhanced. The output defect response map can clearly reflect the suspected defect area, providing a reliable basis for subsequent segmentation, which will not be elaborated here.
[0032] In one embodiment of the present invention, an adaptive threshold is determined based on the defect response map to generate a binary image, and an anisotropic opening operation is performed on the binary image along the scraper axis using line segment structuring elements whose length matches the microstructure scale to obtain a binary mask, including: Adaptive thresholding and binary image generation: ; ; ; ; in For robust scaling estimation; This is a defect response diagram; This represents the global median of the defect response map. To provide robust estimates of constants; Normalized response plot; An adaptive threshold; Threshold The probability of the next two types of pixels; Threshold The intra-class variance of the next two classes of pixels; It is a binary image; For indicator functions; Anisotropic opening operation and binary mask acquisition: ; ; in It is a line segment structure element; The direction of the scraper axis; At the microstructure scale; For range variables; This is the rounding operator; It is a binary mask; This is the morphological erosion operator; This is the morphological dilation operator.
[0033] It should be noted that the defect response map is the output image of the last layer of the directional convolutional network, reflecting the degree of defect suspicion for each pixel in the entire image. The robust estimation constant is a fixed constant used to convert the median of the absolute values of the differences into a robust scaling estimate, preferably 1.4826, reflecting the standardization transformation coefficient for the overall deviation. The robust scaling estimate is the result of multiplying the median of the absolute values of the differences by the robust estimation constant, reflecting the robustness of the pixel value distribution in the defect response map. The normalized response map is the image obtained after the defect response map has undergone exponential transformation, reflecting the mapping of defect response values to a feature distribution within a uniform range. The adaptive threshold is the value found by Otsu's method that minimizes the sum of weighted intra-class variances, reflecting the optimal boundary point for distinguishing foreground from background. The binary image is an image containing only 0s and 1s after the normalized response map has been converted according to the adaptive threshold, reflecting the initially separated suspected defect areas and background areas. The range variable is the variable used for traversal when constructing line segment structuring elements. The range of values for the range variable is defined by its boundaries, with a preferred value from -p / 2 to p / 2 (where p is the microstructure scale). This ensures that the length of the line segment structural element matches the microstructure scale, effectively removing silkscreen strip afterimages. The line segment structural element is a linear morphological template constructed along the scraper axis. The result of the morphological erosion operation is the image obtained after eroding the binary image using the line segment structural element, reflecting the initial processing result after removing elongated artifacts. The result of the morphological dilation operation is the image obtained after dilating the eroded image using the same line segment structural element, reflecting the result after restoring the original shape of the defect area. The binary mask is the final binary image obtained after the morphological opening operation, reflecting the precisely focused suspected defect area.
[0034] It should be noted that the global median is more resistant to outliers than the mean. The median of the absolute value of the difference further reduces the impact of extreme responses. The robust scaling estimate obtained by multiplying by the robust estimation constant can robustly describe the dispersion of response value distribution. The exponential operation maps the defect response value to the interval between 0 and 1, and makes defect responses close to 0 (suspected defects) correspond to larger values, while natural variation responses close to the global median correspond to smaller values, thus strengthening the distinction between defects and background. Otsu's method uses all possible gray values of the normalized response map as candidate thresholds, calculates the probability and intra-class variance of the two classes of pixels (foreground and background) corresponding to each candidate threshold, and finds the candidate threshold that minimizes the sum of weighted intra-class variances as the adaptive threshold. For example, if the gray value range of the normalized response map is 0 to 1, and candidate thresholds such as 0.1, 0.2...0.9 are traversed, when the threshold is 0.7, the sum of weighted intra-class variances is minimized, that is, 0.7 is determined as the adaptive threshold. Pixels with normalized response values greater than or equal to 0.7 are set to 1 (foreground, suspected defect area), and those less than 0.7 are set to 0 (background), thus obtaining a binary image.
[0035] It should be noted that both the erosion and dilation operations are performed only once. One erosion and one dilation operation constitute a complete morphological opening operation. This single operation removes elongated artifacts without excessively damaging the morphology of the defect region, balancing artifact removal effectiveness with defect preservation accuracy. This invention, based on the response differences between defects and natural variations in the defect response map, employs a robust estimation method to avoid the influence of extreme responses. It amplifies the defect response and suppresses natural variation responses through exponential operations. Using Otsu's method for adaptive threshold search, the normalized response map is converted into a binary image, achieving initial separation of defects from the background. Line segment structural elements are constructed based on the scraper axis direction and microstructure scale, and anisotropic opening operations are performed to remove stripe artifacts along the scraper axis direction, preserving the morphology of the defect region. Otsu's method achieves threshold adaptation, avoiding subjective bias; the line segment structural elements are aligned with the physical characteristics of the screen printing, and the anisotropic opening operation accurately removes artifacts; the final output binary mask clearly defines suspected defect regions, providing a reliable foundation for subsequent connected component localization and quantization.
[0036] In one embodiment of the present invention, connected component labeling is performed on the binary mask, and the centroid coordinates, pixel area, and bounding box of the silkscreen defect are extracted and output, including: Input and foreground set definitions: ; in Foreground set; For pixel fields; It is a binary mask; Construction of connected component sets and labeling functions: ; in Let be a set of connected components that are maximal and disjoint under the condition of eight-neighbor connectivity. For marking functions; The value is the label for the connected components; Centroid coordinate calculation: ; ; in The centroid coordinate vector; For the horizontal component of the centroid coordinates; The vertical component of the centroid coordinates; For the set of connected components The number of pixels; These are the horizontal and vertical coordinates of the pixel, respectively. Pixel area calculation: ;in The pixel area; Calculation and output of the outer frame: ; ; ; in For outer frame; These represent the minimum and maximum values of the connected component set on the horizontal axis, respectively. Let be the minimum and maximum values of the connected component set along the vertical axis, respectively; output set As a result.
[0037] It should be noted that the foreground set is the set of pixels with a value equal to one in the binary mask within the pixel domain, reflecting the pixel group of suspected defect areas. The eight-neighbor connectivity relation is the rule for determining whether pixels are connected. The labeling function is a function that establishes the mapping relationship between pixel coordinates and connected component label values. The connected component set is the set of pixels with the same connected component label value, reflecting the pixel composition of a single suspected defect. The horizontal component of the centroid coordinate reflects the horizontal position of the defect center. The vertical component of the centroid coordinate reflects the vertical position of the defect center. The centroid coordinate vector is a two-dimensional vector composed of the horizontal and vertical components of the centroid coordinate, reflecting the complete spatial position of the defect center. The pixel area reflects the size of the defect area. The bounding box is a rectangular area constructed by the minimum and maximum values of the horizontal and vertical coordinates of pixels within the connected component set, reflecting the spatial coverage of the defect. The defect detection result set is a set formed by integrating the centroid coordinate vectors, pixel areas, and bounding boxes of all connected components, reflecting the quantitative information of all suspected defects in the entire image.
[0038] It should be noted that eight-neighbor connectivity means that all adjacent pixels in the four directions (up, down, left, right) and four diagonal directions of a pixel are considered connected. During analysis, the pixels in the foreground set are scanned from left to right and from top to bottom. When an unlabeled pixel is encountered, a new connected component label value is assigned. Then, the eight neighboring pixels of that pixel are recursively or iteratively checked. If a neighboring pixel belongs to the foreground set and is unlabeled, it is assigned the same label value, until all connected pixels are labeled. Finally, the group of pixels corresponding to each label value constitutes a connected component set. Connected component labeling uses the scan line labeling method. The scanning order is from the top left corner to the bottom right corner of the image, in row priority and from left to right. The labeling assignment rule is as follows: when a foreground pixel is scanned, its left and top neighboring pixels (pixels that have already been scanned) are checked first. If there are labeled neighboring pixels, the smallest label value is assigned to the current pixel; if there are no labeled neighboring pixels, a new label value is assigned (the current maximum label value plus 1). After the scan is completed, the labels are merged to ensure that the same connected component corresponds to only one label value. In addition, it is necessary to filter out connected components with too small an area (suspected noise). The filtering threshold is preferably set to 1 / 4 of the number of pixels corresponding to the microstructure scale. For example, if the microstructure scale is 10 pixels, the corresponding number of pixels is 100, and the filtering threshold is 25 pixels. That is, connected components with a pixel area less than 25 are regarded as noise and removed from the result set. In other words, connected components that are too small are likely noise left over after morphological operations, rather than real defects.
[0039] It should be noted that the defect detection result set contains three fields: centroid coordinate vector (storing two floating-point numbers, rounded to two decimal places), pixel area (storing an integer), and bounding box (storing four integers). This set supports storage in text or binary format to meet the data reading and processing needs of industrial inspection systems. This invention leverages the characteristic that suspected defect areas in a binary mask represent sets of independently connected pixels. It extracts these independently connected components through eight-neighbor connectivity analysis, eliminating noise interference. Then, by statistically analyzing pixel coordinates, quantity, and extreme values, it calculates quantitative indicators such as the centroid, area, and bounding box of the defect, integrating them into a standardized result set to meet the production line's needs for defect location, size assessment, and quality traceability.
[0040] In one embodiment of the present invention, such as Figure 2 As shown, the image analysis-based screen printing defect detection system includes: The scraper axis direction determination module 201 calculates the second-order moment matrix of the gradient of the entire image on the input grayscale image, extracts the feature vector corresponding to the largest feature value and performs normalization processing to determine the scraper axis direction; The microstructure scale determination module 202 performs a two-dimensional Fourier transform on the grayscale image, statistically analyzes the power spectrum energy distribution in the frequency domain sector perpendicular to the scraper axis, extracts the frequency corresponding to the energy peak and calculates its reciprocal to determine the microstructure scale. The skewness field construction module 203 calculates the directional derivative of the grayscale image in the direction of the scraper axis, and calculates the standardized third-order central moment of the directional derivative within a local window whose side length is determined by the microstructure scale to construct the skewness field. The defect response map construction module 204 constructs a directional convolutional network, uses a directional Gaussian derivative kernel determined analytically by the scraper axis direction and microstructure scale to convolve the grayscale image, and maps the skewness field to the gating coefficient to modulate the convolution result layer by layer, and outputs the defect response map. Binary mask construction module 205 determines an adaptive threshold based on the defect response map to generate a binary image, and performs anisotropic opening operation on the binary image along the scraper axis using line segment structural elements whose length matches the microstructure scale to obtain a binary mask; The screen printing defect output module 206 performs connected component labeling on the binary mask and extracts and outputs the centroid coordinates, pixel area, and bounding box of the screen printing defect.
[0041] It should be noted that this invention requires the use of an industrial camera, a stable light source, and a computing terminal to form a complete inspection chain. The industrial camera needs to be installed at the inspection station of the screen printing production line, with the lens vertically aimed at the surface of the screen-printed product to ensure that the shooting range covers the entire area to be inspected. A uniform surface light source should be used to avoid strong light reflection or shadows that could cause image grayscale distortion. The brightness of the light source needs to be adjusted according to the characteristics of the screen printing material to maintain consistent lighting conditions during the inspection process. During data acquisition, the industrial camera captures images of the screen-printed product at a set frame rate. The frame rate needs to match the transmission speed of the production line to ensure that no area to be inspected is missed. The acquired images need to be grayscale images, and the resolution is determined according to the scale of the screen printing microstructure to ensure that the image can clearly present microstructural details such as mesh, openings, and strip edges. The acquired grayscale images are directly transmitted to the computing terminal without additional manual preprocessing. The terminal needs to have computing capabilities that support two-dimensional Fourier transform, convolution operations, etc., to meet the real-time inspection requirements, which will not be elaborated here.
[0042] It should be noted that the interval and threshold sizes are set for ease of comparison. The size of the threshold depends on the amount of sample data and the base number set by those skilled in the art for each set of sample data, as long as it does not affect the proportional relationship between the parameter and the quantized value. Furthermore, the above formulas are all dimensionless calculations, and the formulas are derived from software simulations using a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0043] The embodiments of this example have been described above. However, this example is not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms based on the guidance of this example, and all of them are within the protection scope of this example.
Claims
1. A screen printing defect detection method based on image analysis, characterized in that, Includes the following steps: Step S101: Calculate the second-order moment matrix of the gradient of the entire image for the input grayscale image, extract the eigenvector corresponding to the largest eigenvalue and perform normalization processing to determine the direction of the scraper axis; Step S102: Perform a two-dimensional Fourier transform on the grayscale image, statistically analyze the power spectrum energy distribution in the frequency domain sector perpendicular to the scraper axis, extract the frequency corresponding to the energy peak and calculate its reciprocal to determine the microstructure scale. Step S103: Calculate the directional derivative of the grayscale image along the scraper axis. Within a local window whose side length is determined by the microstructure scale, calculate the normalized third-order central moment of the directional derivative to construct the skewness field. Step S104: Construct a directional convolutional network, use a directional Gaussian derivative kernel determined analytically by the scraper axis direction and microstructure scale to convolve the grayscale image, and map the skewness field to the gating coefficient to modulate the convolution result layer by layer, and output the defect response map; Step S105: Determine an adaptive threshold based on the defect response map to generate a binary image. Perform anisotropic opening operation on the binary image along the scraper axis using line segment structuring elements whose length matches the microstructure scale to obtain a binary mask. Step S106: Perform connected component labeling on the binary mask, extract and output the centroid coordinates, pixel area and bounding box of the silkscreen defect.
2. The image analysis-based screen printing defect detection method according to claim 1, characterized in that, The coordinate range of the input grayscale image is set to the pixel domain; a Gaussian kernel with a set variance is used to perform convolution operations on the partial derivatives of the input grayscale image in the horizontal and vertical coordinate directions, respectively, and outputs the smooth gradient in the horizontal and vertical directions. Within the pixel domain, the square of the horizontal smoothing gradient, the product of the horizontal and vertical smoothing gradients, and the square of the vertical smoothing gradient are summed across the entire image to construct the second-order moment matrix of the overall image gradient. Perform eigenvalue decomposition on the second-order moment matrix of the gradient of the whole image, select the eigenvector corresponding to the largest eigenvalue, calculate the Euclidean norm of the eigenvector to normalize the eigenvector, and output the scraper axis direction.
3. The image analysis-based screen printing defect detection method according to claim 1, characterized in that, Perform a two-dimensional Fourier transform on the input grayscale image to map the spatial domain grayscale distribution to a frequency domain complex-valued function; Determine the vertical direction vector orthogonal to the scraper axis direction, calculate the vertical polar angle of the vertical direction vector, and construct the frequency domain sector in combination with the set sector half width. Construct the power spectral energy density in polar coordinates, and perform aggregate integration of the power spectral energy density along the direction angle within the frequency domain sector to obtain the radial energy curve; Search for the energy peak position corresponding to the maximum value in the radial energy curve, calculate the reciprocal of the energy peak position and multiply it by the conversion factor to output the microstructure scale.
4. The image analysis-based screen printing defect detection method according to claim 1, characterized in that, By using the horizontal and vertical components of the scraper axis, and weighted summing them with the partial derivatives of the input grayscale image in the horizontal and vertical directions respectively, the directional derivative field along the scraper axis is obtained. Using the pixel coordinates in the input grayscale image as the center, a square region with a side length equal to the microstructure scale is set as a local window, and the number of pixels within the local window is counted. Calculate the numerical arithmetic mean of the directional derivative field within a local window to obtain the local mean of the directional derivative; calculate the sum of squares of the differences between the numerical value of the directional derivative field and the local mean within the local window, divide the sum of squares by the number of pixels and take the square root to obtain the local standard deviation of the directional derivative. Within a local window, calculate the sum of the cubes of the differences between the directional derivative field values and the local mean. Divide the sum of the cubes by the number of pixels to obtain the third central moment. Then divide the third central moment by the cube of the local standard deviation to obtain the pixel-level values of the skewness field and output the skewness field.
5. The image analysis-based screen printing defect detection method according to claim 1, characterized in that, For each layer of the directional convolutional network, a scale coefficient is set, and a two-dimensional Gaussian function is constructed using the product of the scale coefficient and the microstructure scale as the standard deviation. The directional derivative of the two-dimensional Gaussian function is obtained by using the horizontal and vertical components of the scraper axis direction, and a directional Gaussian derivative kernel analytically aligned with the scraper axis direction and the microstructure scale is constructed. The input grayscale image is defined as the initial input image. For each layer of the directional convolutional network, spatial domain convolution operation is performed on the layer input image using a directional Gaussian derivative kernel to obtain the convolution result. Multiply the skewness field by the skewness scaling constant and then input it into the hyperbolic tangent function to generate the gate coefficient field; The gating coefficient field is multiplied by the gating strength constant and then added to the value to obtain the modulation term. The modulation term is multiplied point by point with the convolution result to obtain the layer output image of the current layer, and the layer output image is used as the layer input image of the next layer. Extract the layer output image of the last layer of the directional convolutional network and output it as a defect response map.
6. The image analysis-based screen printing defect detection method according to claim 1, characterized in that, The global median of the defect response map is calculated, the absolute value of the difference between the pixel value of the defect response map and the global median is calculated, the median of the absolute value of the difference is calculated and multiplied by the robust estimation constant to obtain the robust scaling estimate. The square of the pixel value of the defect response map is calculated and divided by twice the square of the robust scale estimate. The result is then negative and an exponential operation is performed to generate a normalized response map.
7. The image analysis-based screen printing defect detection method according to claim 1, characterized in that, The Otsu method is used to search for the value that minimizes the sum of weighted intra-class variances in the normalized response map as an adaptive threshold, and the normalized response map is converted into a binary image based on the adaptive threshold. The range of values for the range variable is set according to the microstructure scale. The transverse and longitudinal components of the scraper axis are multiplied by the range variable and rounded to the nearest integer to construct the line segment structure element along the scraper axis. The binary image is subjected to morphological erosion using line segment structuring elements, and the result of the morphological erosion is subjected to morphological dilation using line segment structuring elements to output a binary mask.
8. The image analysis-based screen printing defect detection method according to claim 1, characterized in that, Extract pixels with a value of one from the binary mask within the pixel domain to construct the foreground set; Based on the eight-neighbor connectivity relationship, a connectivity analysis is performed on the foreground set, a labeling function is constructed to map pixel coordinates to connected component label values, and pixels with the same connected component label values are extracted using the labeling function to form a connected component set; The centroid coordinates are obtained by summing the horizontal coordinates of all pixels in the connected component set and dividing by the number of pixels in the connected component set. The centroid coordinates are obtained by summing the vertical coordinates of all pixels in the connected component set and dividing by the number of pixels in the connected component set. The centroid coordinate vector is composed of the horizontal and vertical components.
9. The image analysis-based screen printing defect detection method according to claim 8, characterized in that, Count the number of pixels in the connected component set and define the number of pixels as the pixel area of the connected component set; search for the minimum and maximum values of the horizontal coordinates of all pixels in the connected component set, and search for the minimum and maximum values of the vertical coordinates of all pixels in the connected component set; construct the bounding box using the minimum and maximum values of the horizontal and vertical coordinates. Integrate the centroid coordinate vector, pixel area, and bounding box to output a set of defect detection results.
10. A screen printing defect detection system based on image analysis, characterized in that, Performing the image analysis-based screen printing defect detection method as described in any one of claims 1 to 9, comprising: The scraper axis direction determination module calculates the second-order moment matrix of the gradient of the entire image on the input grayscale image, extracts the feature vector corresponding to the largest eigenvalue and performs normalization processing to determine the scraper axis direction; The microstructure scale determination module performs a two-dimensional Fourier transform on the grayscale image, statistically analyzes the power spectrum energy distribution in the frequency domain sector perpendicular to the scraper axis, extracts the frequency corresponding to the energy peak and calculates its reciprocal to determine the microstructure scale. The skewness field construction module calculates the directional derivative of the grayscale image along the scraper axis, and within a local window whose side length is determined by the microstructure scale, calculates the normalized third-order central moment of the directional derivative to construct the skewness field. The defect response map construction module constructs a directional convolutional network, uses a directional Gaussian derivative kernel determined analytically by the scraper axis direction and microstructure scale to convolve the grayscale image, and maps the skewness field to gating coefficients to modulate the convolution result layer by layer, outputting the defect response map; The binary mask construction module determines an adaptive threshold based on the defect response map to generate a binary image. It then performs anisotropic opening operations on the binary image along the scraper axis using line segment structuring elements whose length matches the microstructure scale to obtain a binary mask. The screen printing defect output module performs connected component labeling on the binary mask and extracts and outputs the centroid coordinates, pixel area, and bounding box of the screen printing defect.