High-precision wafer surface micro-scratch detection method based on improved YOLO

CN121921324BActive Publication Date: 2026-06-16WUXI UNIV +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUXI UNIV
Filing Date
2026-03-27
Publication Date
2026-06-16

Smart Images

  • Figure CN121921324B_ABST
    Figure CN121921324B_ABST
Patent Text Reader

Abstract

The application discloses a high-precision wafer surface micro-scratch detection method based on an improved YOLO, which comprises an improved YOLO detection algorithm; the improved YOLO detection algorithm comprises a backbone network, a neck network and a detection network; the convolution layer of each residual module in the backbone network is replaced with a strip anisotropic convolution module to extract anisotropic features in wafer image data; a content-aware feature reorganization operator is introduced into the neck network to perform high-fidelity up-sampling; a multi-scale attention field enhancement module and a multi-scale aggregation module constructed by a coordinate attention mechanism are introduced into the neck network to perform feature enhancement and positioning on an input feature map; during the training process of the improved YOLO detection algorithm, a hybrid loss function constructed by a dynamic non-monotonic focusing coefficient and an Inner-SIoU loss function based on a distance cost of an introduced angle cost is used to optimize the regression process of a predicted bounding box, so that high-precision identification and positioning of wafer surface defects are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target inspection technology, and in particular to a high-precision method for detecting minute scratches on wafer surfaces based on YOLO improvements. Background Technology

[0002] With integrated circuit manufacturing serving as the cornerstone of modern information technology, Moore's Law drives process nodes ever closer to 7 nanometers, 5 nanometers, and even 3 nanometers. The feature size of circuits on the wafer surface continues to shrink, and the complexity of device structures increases exponentially. In this extremely precise manufacturing process, hundreds of steps, such as photolithography and thin film deposition, are highly susceptible to introducing physical defects onto the wafer surface due to equipment vibrations or mechanical handling. Among these, micro-scratches, as continuous topological defects with extremely high aspect ratios, can easily span multiple circuit units, causing short circuits or open circuits. They are a major cause of decreased wafer yield and early chip failure.

[0003] Deep learning algorithms, such as convolutional neural networks, are gradually becoming dominant in the field of industrial defect detection. However, when faced with micro-scale scratches on wafers, they still face severe adaptation challenges, mainly in three dimensions: First, there is an inherent mismatch between the receptive field and the feature geometry. Traditional square convolutional kernels are difficult to adapt to anisotropic scratches with extreme aspect ratios, and easily introduce irrelevant background noise, leading to the dilution of effective features. Second, there is the irreversible loss of spatial information caused by deep downsampling. High-magnification downsampling will erase the high-frequency spatial details of micro-scratches with a width of only a few pixels, resulting in a decrease in positioning accuracy. Finally, there is feature confusion caused by complex background textures. The gradient features of high-density circuit wiring are highly homogeneous with micro-scratches, and conventional networks are difficult to effectively decouple texture edges from scratch defects. In the process of integrated circuit manufacturing, the micro-scratches on the wafer surface are extremely small in scale, have a high aspect ratio, and are easily submerged by complex circuit grid backgrounds, resulting in high false negative rates and low positioning accuracy of existing detection algorithms. Summary of the Invention

[0004] Purpose of the invention: In order to overcome the shortcomings of the existing technology, the present invention provides a high-precision method for detecting micro-scratches on wafer surfaces based on YOLO. Based on the YOLO detection algorithm, a strip anisotropic convolution module is introduced into the backbone network to extract features. In the neck network, a content-aware feature recombination operator, a multi-scale attention domain enhancement module, and a multi-scale aggregation module constructed by coordinate attention mechanism are introduced to enhance, fuse, and locate the features, so as to accurately detect micro-scratches on the wafer surface.

[0005] Technical Solution: To achieve the above objectives, the present invention provides a high-precision wafer surface micro-scratch detection method based on improved YOLO, comprising an improved YOLO detection algorithm; the improved YOLO detection algorithm includes a backbone network, a neck network, and a detection network; the backbone network includes a DRL layer, a res1 residual module, a res2 residual module, a res8 residual module, and a res4 residual module connected in sequence; all convolutional layers of each residual module in the backbone network are replaced with striped anisotropic convolutional modules to extract anisotropic features from the wafer image data; features are extracted sequentially through the improved res2 residual module, res8 residual module, and res4 residual module to obtain P2 feature map, P3 feature map, and P4 feature map.

[0006] The neck network incorporates a content-aware feature reconstruction operator during upsampling to perform high-fidelity upsampling of deep feature maps. It also introduces a multi-scale aggregation module constructed from a multi-scale attention domain enhancement module and a coordinate attention mechanism. The multi-scale attention domain enhancement module enhances the input feature maps, while the coordinate attention mechanism locates each coordinate position in the input feature maps, restoring the spatial coordinate information of each position. Feature maps P2, P3, and P4 are input into the neck network to obtain first, second, and third multi-scale aggregation outputs. These outputs are then input into a detection network. The large, medium, and small target detection heads in the detection network perform bounding box prediction operations on these outputs, outputting the detection results for large, medium, and small targets, respectively.

[0007] An Inner-SIoU loss function is constructed based on the distance cost and shape cost introduced in SIoU, as well as the intersection-union ratio of the auxiliary bounding box calculated based on the Inner-IoU strategy. A hybrid loss function L is constructed by combining the Inner-SIoU loss function with the dynamic non-monotonic focusing coefficient of Wise-IoU. W-I-S The improved YOLO detection algorithm employs a hybrid loss function L during training. W-I-S Optimize the regression process for predicting bounding boxes.

[0008] Furthermore, in the strip anisotropic convolution module, the input feature map is input into a 1×1 convolutional layer for channel dimensionality reduction, and the dimensionality-reduced feature map is input into the horizontal path convolutional layer and the vertical path convolutional layer respectively; the horizontal path convolutional layer uses a 1×N horizontal strip convolutional kernel to extract the horizontal span feature, and the vertical path convolutional layer uses an N×1 vertical strip convolutional kernel to extract the vertical span feature; the horizontal span feature and the vertical span feature are input into a 1×1 recovery convolutional layer for element-wise feature fusion and convolutional recovery operation to obtain the convolutional recovery feature map; a sigmoid function is introduced to activate and generate attention weights σ to adjust the convolutional recovery feature map, and the attention weight-adjusted feature map is concatenated and fused with the input feature map through residual connections to obtain the output feature map; let the input feature map be X∈¡ C×H×W The output feature map is y, and the process is as follows:

[0009]

[0010]

[0011]

[0012] In the formula, σ is the attention weight. To add element by element, For element-wise multiplication, y h As a lateral span feature, y v For vertical span features, X is the input feature map, f is a 1×1 convolution transformation operation, and x i This is the two-dimensional spatial feature of the i-th channel in the input feature map.

[0013] Furthermore, a content-aware feature reconstruction operator is introduced during the upsampling process to perform high-fidelity upsampling of the deep feature map; the content-aware feature reconstruction operator includes a kernel prediction module and a feature reconstruction module; for each target position l in the deep feature map , The kernel prediction module is based on the target location l , The neighborhood content dynamically generates specific upsampled convolutional kernel weights; the feature reconstruction module reconstructs the upsampled convolutional kernel weights of each target location with its corresponding local region to obtain a high-fidelity upsampled deep feature map; the calculation process is as follows:

[0014]

[0015] In the formula, For target position l , The upsampled convolution kernel weights predicted for the nth neighborhood, where N is the weight of the kernel at the target location l. , The number of local neighbors centered on X l+n For local areas, The target position l after reconstruction operation , .

[0016] Furthermore, in the multi-scale attention domain enhancement module, the input fused feature map is split and fed into parallel convolutional branches with different receptive fields to extract and aggregate multi-scale local neighborhood context information. Based on the aggregated multi-scale local neighborhood context information, a linear classifier is constructed in each channel of the fused feature map, and an energy function is defined for each neuron in that channel. The minimum energy value in each neuron is calculated using the energy function of each neuron, and an attention weight matrix containing spatial and channel importance scores is constructed based on the minimum energy values ​​of all neurons. The attention weight matrix is ​​multiplied element-wise with the fused feature map to obtain the enhanced fused feature map. The enhanced fused feature map is added to the input fused feature map through a residual connection to obtain a significantly optimized feature map. The calculation process of the energy function is defined as follows:

[0017]

[0018] In the formula, w t e represents the weights of the linear classifier. t b is the energy function value of the target neuron t. t y is the bias term of the linear classifier; y is the target label variable of the classifier. t The expected output label for the target neuron t; x is the predicted output value of the target neuron t after linear transformation. i Let λ be the i-th neuron in the same channel excluding the target neuron, λ be the regularization coefficient, and M be the total number of neurons in that channel.

[0019] Furthermore, a weighting operation is performed on the input fused feature map based on the minimum energy value e* in the energy function of each neuron, thereby enhancing the features of the input feature map. The calculation process is as follows:

[0020]

[0021] In the formula, E is the minimum energy value e* of all neurons. t The matrix formed This is an element-wise multiplication operation.

[0022] Furthermore, the coordinate attention mechanism performs global pooling decomposition on the fused feature map into feature encodings along the horizontal and vertical directions, generating a direction-aware feature vector z. h and z w The calculation process is as follows:

[0023]

[0024] In the formula, z h For the feature vectors sensed in the horizontal direction, z w The feature vector is perceived in the vertical direction.

[0025] Feature vector z based on horizontal orientation sensing h and the feature vector z of the vertical direction perception w Constructing the horizontal spatial attention weights g h Spatial attention weights g in the vertical direction w The calculation process is as follows:

[0026]

[0027]

[0028] In the formula, [,] represents the concatenation operation, F1 is a shared 1×1 convolution function, δ is a nonlinear activation function; f is the intermediate feature map containing bidirectional interaction information generated after concatenation, dimensionality reduction, and activation operations; f h For the intermediate feature map in the horizontal direction, f w For the intermediate feature map in the vertical direction; F h For independent 1×1 convolution functions, F w σ is an independent 1×1 convolution function; σ is the Sigmoid activation function.

[0029] Furthermore, based on the horizontal spatial attention weight g h Spatial attention weights g in the vertical direction w Each coordinate position in the input fused feature map is weighted to recover the spatial coordinate information of each position; the calculation process is as follows:

[0030]

[0031] In the formula, x(i,j) is the coordinate information of the input feature map with coordinate position (i,j), and y(i,j) is the spatial coordinate information of the input feature map with coordinate position (i,j) after recovery.

[0032] Furthermore, an Inner-SIoU loss function is constructed based on the distance cost and shape cost introduced into SIoU, as well as the intersection-union ratio of the auxiliary bounding box calculated based on the Inner-IoU strategy; the calculation process is shown below:

[0033]

[0034] In the formula, IoU inner To assist in the intersection-union ratio of the bounding boxes, To introduce the distance cost of the angle cost in SIoU, Ω is the shape cost.

[0035] Furthermore, distance cost is introduced into the angle cost of SIoU, and the angle cost in SIoU is incorporated into the distance cost. The penalty weight of the distance cost is dynamically adjusted using the angle cost in SIoU. The calculation process is as follows:

[0036]

[0037]

[0038] In the formula, γ is the penalty weight for distance cost, and ρ x ρ is the square of the relative distance in the horizontal direction. y Let Λ be the square of the relative distance in the vertical direction, and let Λ be the angular cost in SIoU.

[0039] Angle cost is introduced into SIoU to reduce the oscillating degrees of freedom of the regression vector. The calculation process of angle cost in SIoU is as follows:

[0040]

[0041] In the formula, To predict the distance between the center point of the bounding box and the center point of the true bounding box, c h To predict the height difference between the center point of the bounding box and the center point of the actual bounding box.

[0042] Furthermore, a hybrid loss function L is constructed by weighting the Inner-SIoU loss function and the dynamic non-monotonic focusing coefficients of Wise-IoU. W-I-S The calculation process is as follows:

[0043]

[0044] In the formula, R WIoU L is the dynamic non-monotonic focusing coefficient of Wise-IoU. Inner-SIoU The loss function is Inner-SIoU.

[0045] The dynamic non-monotonic focusing coefficient of Wise-IoU is obtained by assessing the quality of the current sample based on outlier. The calculation process of the dynamic non-monotonic focusing coefficient of Wise-IoU is as follows:

[0046]

[0047] In the formula, exp is an exponential function with the natural constant e as its base, and x... c and y cThese are the x and y coordinates of the center point of the predicted bounding box in the current output, respectively. c gt and y c gt These are the x and y coordinates of the center point of the labeled true bounding box; W g and H g These are the width and height of the smallest bounding rectangle that can completely enclose both the predicted bounding box and the ground truth bounding box, respectively.

[0048] Beneficial Effects: The high-precision wafer surface micro-scratch detection method based on YOLO improvement of this invention introduces a strip anisotropic convolution module into the residual module of the backbone network, utilizing the elongated receptive field to adapt to the linear geometric features of the scratch, effectively suppressing background texture noise interference; a content-aware feature recombination operator is introduced during the upsampling process in the neck network to avoid dilution of micro-features; and a multi-scale aggregation module constructed by a multi-scale attention domain enhancement module and a coordinate attention mechanism is introduced during the feature fusion process of the neck network to achieve deep fusion of multi-scale semantics and background noise suppression; for the detection head output of the three scales, a hybrid loss function that fuses dynamic focusing and auxiliary bounding box angle perception is applied to achieve dynamic focusing regression optimization, ultimately achieving high-precision identification and localization of wafer surface defects. Attached Figure Description

[0049] Figure 1 This is a network structure diagram of the improved YOLO detection algorithm.

[0050] Figure 2 This is a flowchart of a strip anisotropic convolution module.

[0051] Figure 3 The flowchart shows the content-aware feature recombination operator and the multi-scale aggregation module.

[0052] Figure 4 For the mixed loss function L W-I-S The flowchart for the construction. Detailed Implementation

[0053] The invention will now be further described with reference to the accompanying drawings.

[0054] like Figure 1As shown, a high-precision wafer surface micro-scratch detection method based on improved YOLO includes an improved YOLO detection algorithm. The improved YOLO detection algorithm includes a backbone network, a neck network, and a detection network. The backbone network includes a DRL layer, a res1 residual module, a res2 residual module, a res8 residual module, and a res4 residual module connected in sequence. All convolutional layers of each residual module in the backbone network are replaced with striped anisotropic convolutional modules. Specific convolutional kernels are used to enhance the extraction of features of thin linear scratches, extracting anisotropic features from the wafer image data. Features are extracted sequentially through the improved res2, res8, and res4 residual modules to obtain feature maps P2, P3, and P4.

[0055] The neck network incorporates a content-aware feature reorganization operator during upsampling to perform high-fidelity upsampling of deep feature maps, avoiding the dilution of minute features. It also introduces a multi-scale attention domain enhancement module and a multi-scale aggregation module constructed using a coordinate attention mechanism. This enhances the semantic consistency and spatial localization capabilities of features while restoring high-resolution spatial details, achieving deep fusion of multi-scale semantics and suppression of background noise. The multi-scale attention domain enhancement module enhances the input feature map, while the coordinate attention mechanism locates each coordinate position in the input feature map, restoring the semantic consistency and spatial localization capabilities of each feature map. The spatial coordinates of the target location are obtained; the P2, P3, and P4 feature maps are input into the neck network to obtain the first, second, and third multi-scale aggregated outputs; the first, second, and third multi-scale aggregated outputs are input into the detection network, and the large, medium, and small target detection heads in the detection network perform bounding box prediction operations on the first, second, and third multi-scale aggregated outputs to output the detection results of large targets, medium targets, and small targets.

[0056] The P4 feature map is processed by the SPP module for multi-scale feature extraction to obtain the first deep feature map. This first deep feature map is then upsampled with high fidelity and concatenated with the P3 feature map to obtain the first fused feature map. The first fused feature map is then input into the first multi-scale aggregation module to obtain the first multi-scale aggregation output. This first multi-scale aggregation output is used as the second deep feature map. The second deep feature map is then upsampled with high fidelity and concatenated with the P2 feature map to obtain the second fused feature map. This second fused feature map is then input into the second multi-scale aggregation module to obtain the second multi-scale aggregation output. The first and second multi-scale aggregation outputs are then input into the detection network. The large target detection head and medium target detection head in the detection network perform bounding box prediction operations on the first and second multi-scale aggregation outputs, respectively, to output the detection results for large and medium targets.

[0057] The output of the second multi-scale aggregation is used as the third deep feature map. The third deep feature map is then upsampled with high fidelity and concatenated with the P2 feature map to obtain the third fused feature map. The third fused feature map is then input into the third multi-scale aggregation module to obtain the third multi-scale aggregation output. The third multi-scale aggregation output is then input into the detection network. The small target detection head in the detection network performs bounding box prediction on the third multi-scale aggregation output to output the detection results of the small targets.

[0058] An Inner-SIoU loss function is constructed based on the distance cost and shape cost introduced in SIoU, as well as the intersection-union ratio of the auxiliary bounding box calculated based on the Inner-IoU strategy. A hybrid loss function L is constructed by combining the Inner-SIoU loss function with the dynamic non-monotonic focusing coefficient of Wise-IoU. W-I-S By fusing dynamic focusing and the Inner-IoU strategy, the difficulties in regressing small, slender targets and the problem of sample imbalance are addressed. A hybrid loss function L is employed during the training process of the improved YOLO detection algorithm. W-I-S Optimize the regression process for predicting bounding boxes.

[0059] like Figure 2As shown, given the extreme aspect ratios of surface scratches on wafers, the square convolutional kernels widely used in traditional convolutional neural networks are ill-suited for such anisotropic targets. This can easily introduce background noise and dilute linear features. Therefore, a striped anisotropic convolutional module is introduced, utilizing specific convolutional kernels to enhance the extraction of features from slender linear scratches. In this module, the input feature map is fed into a 1×1 convolutional layer for channel dimensionality reduction, and the dimensionality-reduced feature map is then fed into horizontal and vertical convolutional layers respectively. The horizontal convolutional layer uses a 1×N... The horizontal strip convolutional kernel extracts the lateral span features, focusing on capturing the lateral details of the scratch; the vertical path convolutional layer uses an N×1 vertical strip convolutional kernel to extract the vertical span features, focusing on capturing the vertical details of the scratch; the lateral and vertical span features are input into a 1×1 recovery convolutional layer for element-wise feature fusion and convolutional recovery operations to obtain the convolutional recovery feature map; a sigmoid function is introduced to activate and generate attention weights σ to adjust the convolutional recovery feature map, and the attention-weighted feature map is concatenated and fused with the input feature map through residual connections to obtain the output feature map. Let the input feature map be X∈¡ C×H×W The output feature map is y, and the process is as follows:

[0060]

[0061]

[0062]

[0063] In the formula, σ is the attention weight. To add element by element, This is element-wise multiplication, used for feature recalibration; y h As a lateral span feature, y v For the vertical span feature, X is the input feature map, and f is a 1×1 convolutional transformation operation used to fuse the features of the horizontal and vertical paths; x i The input feature map contains the two-dimensional spatial features of the i-th channel. N is the long side size of the strip anisotropic convolution kernel, which determines the degree of anisotropy; w 1×N W is a 1×N horizontal one-dimensional convolution kernel, consisting of 1 row and N columns, used for horizontal convolution calculations on the feature map, specifically for extracting horizontal spatial features; N×1 It is a vertical one-dimensional convolution kernel with a size of N×1, consisting of N rows and 1 column, used to perform vertical convolution calculations on the feature map, specifically to extract spatial features in the vertical direction.

[0064] like Figure 3As shown, to address the severe feature dilution and location information loss issues faced by micro-scratches on wafers in deep networks, the neck network is improved. To eliminate edge blurring caused by traditional interpolation upsampling, a content-aware feature reconstruction operator is introduced during the upsampling process to perform high-fidelity upsampling of the deep feature map. The content-aware feature reconstruction operator includes a kernel prediction module and a feature reconstruction module. For each target location l in the deep feature map... , The kernel prediction module is based on the target location l , The neighborhood content dynamically generates specific upsampled convolutional kernel weights; the feature reconstruction module reconstructs the upsampled convolutional kernel weights of each target location with their corresponding local regions to obtain a high-fidelity upsampled deep feature map; the content-aware feature reconstruction operator ensures that scratch edges and flat backgrounds use differentiated upsampling strategies, achieving high-fidelity feature reconstruction. The calculation process is shown below:

[0065]

[0066] In the formula, For target position l , The upsampled convolution kernel weights predicted for the nth neighborhood, where N is the weight of the kernel at the target location l. , The number of local neighbors centered on X l+n For local areas, The target position l after reconstruction operation , .

[0067] The nuclear prediction module is based on the target location l , The algorithm dynamically generates specific upsampled convolutional kernel weights based on the neighborhood content. First, a 1×1 convolution is used to compress the input deep feature map channels to reduce the number of computational parameters. Then, a convolutional layer with a specific receptive field is used as a content encoder to deeply perceive features such as texture and edges in the local neighborhood and predict dense weight channels containing information about future magnification. Next, pixel rearrangement is used to unfold and align these channel-dimensional weights to a high-resolution spatial scale, accurately assigning a set of exclusive local weight vectors to each target location after upsampling, which are the upsampled convolutional kernel weights for each target location. At the same time, by applying Softmax normalization in the channel dimension, it is ensured that the sum of the weights at each target location is 1, thereby achieving dynamic upsampling that adaptively allocates weights based entirely on the local image content while maintaining the stability of feature values.

[0068] The content-aware feature reconstruction operator works by mapping the target pixel coordinates on the high-resolution image back to the low-resolution image by an upsampling factor, finding the corresponding center point, and defining the local region around it. A weight vector specifically generated for the target location by the kernel prediction module is then used to reshape it into a weight matrix of equal size. Finally, this specific weight matrix is ​​summed element-wise with the corresponding local region features on the low-resolution image, and the same set of weights is shared across all channels. This allows for accurate calculation of the final feature value of the high-resolution pixel, resulting in a high-fidelity upsampled deep feature map.

[0069] To suppress background noise and correct spatial location immediately after feature fusion, a multi-scale aggregation module constructed using a multi-scale attention domain enhancement module and a coordinate attention mechanism is introduced. The multi-scale attention domain enhancement module enhances the fused feature map, while the coordinate attention mechanism locates each coordinate position in the fused feature map and restores the spatial coordinate information of each coordinate position. The multi-scale attention domain enhancement module uses dilated convolutions with different dilation rates to simulate the eccentricity effect of human vision and extracts salient features through parameterless attention.

[0070] like Figure 3 As shown, in the multi-scale attention domain enhancement module, the input fused feature map is split and fed into parallel convolutional branches with different receptive fields to extract and aggregate multi-scale local neighborhood context information. Based on the aggregated multi-scale local neighborhood context information, a linear classifier is constructed in each channel of the fused feature map, and the energy function of each neuron in that channel is defined. The minimum energy value of each neuron is calculated using the energy function of each neuron, and an attention weight matrix containing spatial and channel importance scores is constructed based on the minimum energy values ​​of all neurons. The attention weight matrix is ​​multiplied element-wise with the fused feature map to obtain the enhanced fused feature map, which dynamically amplifies the features of key targets and useful neighborhoods while suppressing irrelevant background noise. The enhanced fused feature map is added to the input fused feature map through residual connections, and the final output feature map has the same dimension but significantly optimized core feature expression. The calculation process of the energy function is defined as follows:

[0071]

[0072] In the formula, w t e represents the weights of the linear classifier. t t represents the energy function value of the target neuron, used to measure the linear separability of this neuron from its surrounding neurons; b t y represents the bias term of the linear classifier; y is the target label variable of the classifier. When searching for the most significant neuron, the algorithm labels the target neuron as positive and other neurons as negative.t Let be the expected output label of the target neuron t. For ease of calculation, it is usually fixed at 1 in the actual derivation. x is the predicted output value of the target neuron t after linear transformation. i Let λ be the i-th neuron in the same channel excluding the target neuron, and λ be the regularization coefficient, a hyperparameter used to penalize excessively large weights w. t This prevents the classifier from overfitting due to excessive weights; M is the total number of neurons in this channel, so the summation involves traversing the other M-1 neurons.

[0073] The lower the value of the calculated energy function, the greater the difference between the target neuron and the surrounding background neurons, and the easier it is to be linearly separated. In other words, the features contained in the neuron are more significant and important. The network will then assign a greater attention weight to it accordingly. First, the mean and variance of all pixels in the entire channel of the current feature map are calculated as global statistics. The global statistics are substituted into the corresponding energy function to directly calculate the minimum energy value of each neuron.

[0074] A precise weighting operation is performed on the input fused feature map based on the minimum energy value e* in the energy function of each neuron, thereby enhancing the feature X of the input feature map. % The calculation process is as follows:

[0075]

[0076] In the formula, E is the minimum energy value e* of all neurons. t The matrix formed For element-wise multiplication, Sigmoid is the Sigmoid function, which maps the minimum energy value of all neurons to attention weights between 0 and 1.

[0077] The coordinate attention mechanism performs global pooling decomposition on the fused feature map into feature encodings along the horizontal and vertical directions, generating a direction-aware feature vector z. h and z w The direction-aware feature vector z h and z w The calculation process is as follows:

[0078]

[0079] In the formula, z h For the feature vectors sensed in the horizontal direction, z wis the feature vector perceived in the vertical direction; H is the total height of the input feature map, and W is the total width of the input feature map; x(h, i) is the feature value of the pixel located in the h-th row and i-th column of the input feature map; x(j, w) is the feature value of the pixel located in the j-th row and w-th column of the input feature map.

[0080] Feature vector z based on horizontal orientation sensing h and the feature vector z of the vertical direction perception w Constructing the horizontal spatial attention weights g h Spatial attention weights g in the vertical direction w The construction of the horizontal spatial attention weights g h Spatial attention weights g in the vertical direction w The feature vector z sensed in the horizontal direction h and the feature vector z of the vertical direction perception w A concatenation operation is performed, and a shared 1×1 convolution function is used to compress the channels of the concatenated feature vectors. The channel-compressed feature vectors are then processed by a non-linear activation function to obtain an intermediate feature map f containing bidirectional interaction information. The intermediate feature map is then decomposed along the original concatenation dimension to restore the horizontal intermediate feature map f. h and the intermediate feature map f in the vertical direction w ; respectively for the intermediate feature map f in the horizontal direction h and the intermediate feature map f in the vertical direction w Channel upscaling is performed, and then the Sigmoid activation function is applied to the intermediate feature maps f in the horizontal direction of the channel upscaling. h and the intermediate feature map f in the vertical direction w The mapping operation yields the horizontal spatial attention weights g. h Spatial attention weights g in the vertical direction w The calculation process is as follows:

[0081]

[0082]

[0083] In the formula, [,] represents the concatenation operation, which concatenates z... h and z w The feature vectors are concatenated along spatial dimensions to allow global feature information in the horizontal and vertical directions to be integrated and interact. F1 is a shared 1×1 convolution function primarily responsible for channel compression of the concatenated feature vectors, significantly reducing subsequent computation. δ is a non-linear activation function used to endow the model with non-linear fitting capabilities. f is the intermediate feature map containing bidirectional interactive information generated after concatenation, dimensionality reduction, and activation operations.h For the intermediate feature map in the horizontal direction, f w The intermediate feature map in the vertical direction; F h It is an independent 1×1 convolution function, which is used to transform f h Perform channel upscaling to restore the number of channels to a state completely consistent with the original input feature map; F w It is an independent 1×1 convolution function, which is used to transform f w Channel upscaling is performed to restore the number of channels to a state completely consistent with the original input feature map; σ is the Sigmoid activation function, which forcibly maps and compresses the upscaled values ​​into the range of 0 to 1, giving them mathematical significance for weight allocation.

[0084] Based on the horizontal spatial attention weight g h Spatial attention weights g in the vertical direction w Each coordinate position in the input fused feature map is weighted to recover the spatial coordinate information of each position; thus, accurate spatial coordinate information is recovered during the feature fusion stage, ensuring precise localization of micron-level defects. The calculation process is as follows:

[0085]

[0086] In the formula, x(i,j) is the coordinate information of the input feature map with coordinate position (i,j), and y(i,j) is the spatial coordinate information of the input feature map with coordinate position (i,j) after recovery.

[0087] like Figure 4 As shown, wafer scratch detection faces challenges such as the difficulty of reviewing data due to the extremely small size of the target and the training imbalance caused by the dominance of background samples. Therefore, an Inner-SIoU loss function is constructed based on the distance cost and shape cost introduced into SIoU, as well as the intersection-union ratio of the auxiliary bounding boxes calculated using the Inner-IoU strategy. The calculation process is shown below:

[0088]

[0089] In the formula, IoU inner To assist in the intersection-union ratio of the bounding boxes, To introduce the distance cost of the angle cost in SIoU, Ω is the shape cost.

[0090] When the predicted bounding box and the ground truth bounding box are at a diagonal angle, the angle is penalized first to align the predicted bounding box. When the predicted bounding box and the ground truth bounding box are close to align in the horizontal or vertical direction, the distance penalty is increased to make the predicted bounding box move closer together. This effectively avoids the predicted bounding box oscillating aimlessly during spatial regression. Therefore, it is proposed to introduce the distance cost from the angle cost in SIoU into the distance cost, and use the angle cost in SIoU to dynamically adjust the penalty weight of the distance cost. The calculation process is as follows:

[0091]

[0092]

[0093] In the formula, γ is the penalty weight for distance cost, and ρ x ρ is the square of the relative distance in the horizontal direction. y x is the square of the relative distance in the vertical direction, Λ is the angular cost in SIoU; c To predict the x-coordinate of the center point of the bounding box, x c gt C is the x-coordinate of the center point of the true bounding box. w The width of the minimum bounding rectangle that can completely enclose both the predicted and ground truth bounding boxes; y c To predict the ordinate of the center point of the bounding box, y c gt C is the ordinate of the center point of the true bounding box. h The height of the minimum bounding rectangle that can completely enclose both the predicted bounding box and the ground truth bounding box.

[0094] An angular cost is introduced into SIoU to reduce the oscillating degrees of freedom of the regression vector. The angular cost in SIoU is calculated based on the true bounding box and the predicted bounding box. The calculation process of the angular cost in SIoU is as follows:

[0095]

[0096] In the formula, To predict the distance between the center point of the bounding box and the center point of the true bounding box, c h To predict the height difference between the center point of the bounding box and the center point of the actual bounding box.

[0097] The intersection-union ratio (IoU) of the auxiliary bounding boxes is calculated by introducing a scale factor ratio using the Inner-IoU strategy, generating auxiliary bounding boxes B that are either smaller or larger than the original bounding boxes. innerThis accelerates the convergence of high IoU samples and improves the regression performance of low IoU samples. Keeping the center point coordinates of the original bounding box unchanged, its width and height are multiplied by the scale factor ratio to obtain the auxiliary bounding boxes of the predicted bounding box and the ground truth bounding box. Let the center point of the original predicted bounding box be (x... c y c The width is w and the height is h; the center point of the original true bounding box is (x). c gt y c gt ), with a width of w gt The height is h gt The auxiliary bounding box for predicting the bounding box is calculated as follows:

[0098]

[0099]

[0100] In the formula, , , and Here, w represents the coordinates of the four vertices of the auxiliary bounding box used to predict the bounding box. inner To predict the width of the auxiliary bounding box of the bounding box, h inner To predict the height of the auxiliary bounding box of the bounding box.

[0101] The auxiliary bounding box of the true bounding box is calculated as follows:

[0102] ,

[0103] , ,

[0104] ,

[0105] In the formula, , , and Let w be the coordinates of the four vertices of the auxiliary bounding box of the real bounding box. gt inner h is the width of the auxiliary bounding box of the true bounding box. gt inner The height of the auxiliary bounding box is the actual bounding box.

[0106] The intersection-union ratio (IoU) of the auxiliary bounding boxes is calculated based on the auxiliary bounding boxes of the predicted and ground truth bounding boxes. inner The calculation process is as follows:

[0107]

[0108] ,

[0109] ,

[0110] ,

[0111]

[0112] In the formula, inter is the intersection area of ​​the auxiliary bounding boxes of the predicted bounding box and the auxiliary bounding boxes of the ground truth bounding box, which is determined by the width of the intersection region inter. w and the height of the intersection region h The width of the intersection region is calculated. w and height inter h The area is determined by the horizontal and vertical overlap of the auxiliary bounding boxes of the predicted bounding box and the ground truth bounding box, respectively; `max` and `min` are the maximum and minimum value functions, used to locate the boundary of the intersection region of the two rectangles; `union` is the union area of ​​the auxiliary bounding boxes of the predicted bounding box and the ground truth bounding box, which is the sum of the areas of the auxiliary bounding boxes of the predicted bounding box and the ground truth bounding box minus the intersection area; the intersection-union ratio (IoU) of the auxiliary bounding boxes is... inner The value range is [0, 1], which reflects the degree of overlap of the core region after scaling or expansion by the scale factor ratio.

[0113] The shape cost Ω is used to penalize the mismatch in width and height ratio between the predicted bounding box and the true bounding box. The calculation process is as follows:

[0114]

[0115]

[0116] In the formula, ω w ω represents the degree of width difference. h To represent the degree of difference, `max` is a function that takes the maximum value between the two values ​​to normalize the difference to a range of 0 to 1; `w` and `h` are the width and height of the predicted bounding box, respectively; gt h gt θ represents the width and height of the true bounding box, respectively; θ is the shape penalty attention coefficient, a hyperparameter used to control the network's sensitivity to shape difference penalties.

[0117] The hybrid loss function L is constructed by weighting the Inner-SIoU loss function and the dynamic non-monotonic focusing coefficients of Wise-IoU. W-I-S The bounding box regression process is optimized through the synergy of a dynamic focusing mechanism and an auxiliary bounding box strategy; the calculation process is shown below:

[0118]

[0119] In the formula, R WIoU L is the dynamic non-monotonic focusing coefficient of Wise-IoU. Inner-SIoU The loss function is Inner-SIoU.

[0120] The dynamic non-monotonic focusing coefficient of Wise-IoU is obtained by assessing the quality of the current sample based on outlier. The calculation process of the dynamic non-monotonic focusing coefficient of Wise-IoU is as follows:

[0121]

[0122] In the formula, exp is an exponential function with the natural constant e as its base, and x... c and y c These are the x and y coordinates of the center point of the predicted bounding box in the current output, respectively. c gt and y c gt These are the x and y coordinates of the center point of the labeled true bounding box; W g and H g Let W be the width and height of the smallest bounding rectangle that can completely enclose both the predicted and ground truth bounding boxes, respectively; the denominator W... g 2 +H g 2 The result calculated using the Pythagorean theorem is the square of the diagonal length of the smallest bounding rectangle. The asterisk (*) is a special symbol belonging to the deep learning engineering implementation level, representing the gradient truncation operation. This means that when the neural network performs backpropagation and calculates the gradient, the denominator marked with * will be treated as a fixed constant and will not participate in the gradient backpropagation and weight update.

[0123] During the forward propagation phase, the neural network outputs the predicted bounding box coordinates, and the system sequentially calculates the angle deviation, distance penalty, cross-union ratio of the auxiliary bounding boxes, and the dynamic focusing coefficient R of Wise-IoU. WIoU This ultimately yields a scalar loss value. During the backpropagation phase, the system calculates the partial derivative of this total loss with respect to the predicted bounding box coordinates. It's important to note that to prevent gradient explosion and training oscillations, the focusing coefficient R is typically set in the code implementation. WIoUGradient truncation ensures that the gradient flows primarily in the reverse direction along the angle and distance error chains within the Inner-SIoU loss function. Finally, these gradient self-detectors, carrying multidimensional geometric bias information, are fed back down layer by layer into the backbone network. The optimizer uses this information to update the weights of all convolutional layers, driving the model to output more accurate and angularly fitted bounding boxes in the next iteration. The hybrid loss function L... W-I-S This enables the model to quickly locate the direction of scratches in the early stages of training, optimize minor deviations through auxiliary boxes in the middle stages of training, and dynamically reduce the weight interference of simple background samples throughout the process, thereby achieving highly robust detection in complex industrial scenarios.

[0124] To completely solve the problem of missing detection of extremely small targets, the improved YOLO detection algorithm in this invention replaces the original low-resolution P5 feature map with a high-resolution P2 feature map. This preserves the texture features of extremely small targets, enhances the feature capture capability of extremely small defects, and significantly improves the detection accuracy and recall rate of micron-level defects. In the backbone network, the traditional YOLO network usually extracts P3, P4, and deeper P5 feature maps for subsequent fusion, where the P5 feature map has a scale of 13×13. Since the high downsampling of the P5 feature map directly eliminates the features of fine scratches with a width of only a few pixels, the improved YOLO detection algorithm in this invention completely removes the output leads of the P5 feature map branch and instead extracts the P2 feature map from a shallower position in the backbone network, which is input into the Neck network for feature fusion. The P2 feature map has a scale of 104×104. This allows the model to effectively resolve tiny defects with a diameter of pixels, improving sensitivity by 8 times compared to the traditional algorithm architecture and significantly enhancing the recall capability of extremely small targets.

[0125] Simultaneously, based on inputting high-resolution P2 feature maps into the Neck network for feature fusion, a high-resolution feature pyramid and detection head structure were reconstructed. The entire multi-scale fusion path was restructured to adapt to feature transfer at three higher resolution levels: 26×26, 52×52, and 104×104, discarding the original fusion data stream containing the 13×13 scale. In terms of the detection network structure, the detection heads underwent core adjustments to adapt to the feature pyramid scale reconstruction. The prediction scales of the three detection heads were completely changed: the 13×13 detection head originally responsible for large targets disappeared, the 26×26 scale was upgraded to handle large target detection, and a new 104×104 output scale detection head was constructed at a location where there was no detection branch, explicitly labeled for predicting small targets. The adjusted detection network structure includes a 26×26 large target detection head, a 52×52 medium target detection head, and a 104×104 small target detection head.

[0126] Replacing P2 with P5 is a systematic step involving the rebinding of global feature flows and scales in the network. In the backbone network, the output path from the deepest downsampling stage to the feature fusion network, i.e., the P5 path, needs to be cut off or discarded to reduce useless computation. Then, the feature extraction node is moved forward to extract the high-resolution P2, which retains a large amount of original image texture, edge, and spatial localization information, from the shallow network that has only been downsampled by 4 times. The fusion logic of the neck network is then significantly modified, and the top-down upsampling path and the bottom-up propagation path are all realigned to the three new scales of P4, P3, and P2 to ensure that the P2 feature map can receive high-level semantic information guidance from P4 and P3 when participating in fusion. Finally, in the detection network, the original 13×13 low-resolution detection head and the large prior boxes assigned to it are completely removed. For the fused 104×104 resolution feature map, a brand-new convolutional detection branch is constructed through code, and algorithms such as K-means are used to re-cluster and generate extremely small prior boxes for this new branch, thereby completing the smooth shift of the detection focus of the entire network to small targets.

[0127] like Figure 1 As shown, the improved YOLO detection algorithm includes a backbone network, a neck network, and a detection network. The backbone network includes a DRL layer, a res1 residual module, a res2 residual module, a res8 residual module, and a res4 residual module connected in sequence. All convolutional layers in the res1, res2, res8, and res4 residual modules of the backbone network are replaced with striped anisotropic convolutional modules. The backbone network takes wafer image data as input, which is then processed in the DRL layer. The output of the DRL layer is input to the res1 residual module to extract anisotropic features. The output of the res1 residual module is input to the res2 residual module to extract anisotropic features, resulting in a P2 feature map (104*104). The P2 feature map is then input to the res8 residual module to extract anisotropic features, resulting in a P3 feature map (52*52). Finally, the P3 feature map is input to the res4 residual module to extract anisotropic features, resulting in a P4 feature map (26*26). The DRL layer consists of a convolutional layer, a batch normalization layer, and an activation function connected in series; the res1 residual module contains one residual block, the res2 residual module contains two residual blocks, the res8 residual module contains eight residual blocks, and the res4 residual module contains four residual blocks.

[0128] The Neck network includes an SPP module, a first Concat splicing layer, a first DBL*5 module, a first multi-scale aggregation module, a second Concat splicing layer, a second DBL*5 module, a second multi-scale aggregation module, a third Concat splicing layer, a third DBL*5 module, and a third multi-scale aggregation module. The first multi-scale aggregation module, the second multi-scale aggregation module, and the third multi-scale aggregation module are all constructed using a multi-scale attention domain enhancement module and a coordinate attention mechanism. The P4 feature map is input into the Neck network and then into the SPP module for multi-scale feature extraction to obtain the first deep feature map. This first deep feature map is then upsampled with a content-aware recombination factor and input into the first Concat layer. Simultaneously, the P3 feature map is also input into the first Concat layer. The first Concat layer concatenates and fuses the upsampled first deep feature map with the P3 feature map from the shallow layers to obtain the first fused feature. This first fused feature is then processed by the first DBL*5 module and input into the first multi-scale aggregation module for feature enhancement and localization, yielding the first multi-scale aggregation output. This first multi-scale aggregation output serves as the second deep feature map. This second deep feature map is then upsampled with a content-aware recombination factor and input into the second Concat layer. Simultaneously, the P2 feature map is also input into the second Concat layer. The concatenation layer consists of two parts: the second Concat concatenation layer and the third Concat layer. The second Concat layer concatenates and fuses the high-fidelity upsampled second deep feature map with the P2 feature map of the shallow features to obtain the second fused feature. The second fused feature is then processed by the second DBL*5 module and input into the second multi-scale aggregation module for feature enhancement and localization to obtain the second multi-scale aggregation output. The second multi-scale aggregation output is used as the third deep feature map. The third deep feature map is then upsampled with high fidelity using a content-aware recombination factor and input into the third Concat concatenation layer. Simultaneously, the P2 feature map is input into the third Concat concatenation layer. The third Concat concatenation layer concatenates and fuses the high-fidelity upsampled third deep feature map with the P2 feature map of the shallow features to obtain the third fused feature. The third fused feature is then processed by the third DBL*5 module and input into the third multi-scale aggregation module for feature enhancement and localization to obtain the third multi-scale aggregation output. The SPP module is a spatial pyramid pooling module that divides the input feature map into regions of different scales (5*5, 9*9, 13*13, and 1*1 grids), performs max pooling on each region of different scales, and then concatenates the pooling results of all regions of different scales to form a fixed-dimensional output, which is the first deep feature map. The first, second, and third DBL*5 modules are all structures composed of five cascaded DBL modules.

[0129] The detection network includes a large target detection head, a medium target detection head, and a small target detection head. A first multi-scale aggregation output, a second multi-scale aggregation output, and a third multi-scale aggregation output are input into the detection network. The first multi-scale aggregation output is input to the large target detection head to perform bounding box prediction, outputting the detection result for the large target. The second multi-scale aggregation output is input to the medium target detection head to perform bounding box prediction, outputting the detection result for the medium target. The third multi-scale aggregation output is input to the small target detection head to perform bounding box prediction, outputting the detection result for the small target.

[0130] By employing a constructed hybrid loss function L during the training process of the improved YOLO detection algorithm. W-I-S By leveraging the synergistic effect of a dynamic focusing mechanism and an auxiliary bounding box strategy, the bounding box regression process is optimized, enabling high-precision identification and localization of wafer surface defects.

[0131] The above description is merely a preferred embodiment of the present invention. Those skilled in the art can make several modifications and optimizations based on the above disclosure without departing from the basic principles described above. These modifications and optimizations should be considered within the scope of protection as understood by the present invention.

Claims

1. A high-precision method for detecting minute scratches on wafer surfaces based on improved YOLO, characterized in that: The algorithm includes an improved YOLO detection algorithm; the improved YOLO detection algorithm includes a backbone network, a neck network, and a detection network; the backbone network includes a DRL layer, a res1 residual module, a res2 residual module, a res8 residual module, and a res4 residual module connected in sequence; all convolutional layers of each residual module in the backbone network are replaced with striped anisotropic convolutional modules to extract anisotropic features from the wafer image data; Features were extracted sequentially using the improved res2 residual module, res8 residual module, and res4 residual module to obtain the P2 feature map, P3 feature map, and P4 feature map; In the neck network, a content-aware feature recombination operator is introduced during the upsampling process to perform high-fidelity upsampling of deep feature maps. In the neck network, a multi-scale aggregation module is constructed by introducing a multi-scale attention domain enhancement module and a coordinate attention mechanism. The multi-scale attention domain enhancement module is used to enhance the features of the input feature map, and the coordinate attention mechanism is used to locate each coordinate position in the input feature map and restore the spatial coordinate information of each coordinate position. The P2, P3, and P4 feature maps are input into the neck network to obtain the first, second, and third multi-scale aggregated outputs. These outputs are then input into the detection network, where large, medium, and small target detection heads perform bounding box prediction operations on them, outputting the detection results for large, medium, and small targets, respectively. An Inner-SIoU loss function is constructed based on a distance cost of an angle cost introduced in the SIoU, a shape cost, and an intersection over union of an auxiliary bounding box calculated based on an Inner-IoU strategy; a hybrid loss function L is constructed by the Inner-SIoU loss function and a dynamic non-monotonic focusing coefficient of the Wise-IoU W-I-S In the training process of the improved YOLO detection algorithm, the hybrid loss function L is used W-I-S The regression process of the optimized prediction bounding box is optimized.

2. The high-precision wafer surface micro-scratch detection method based on YOLO improvement according to claim 1, characterized in that: In the strip anisotropic convolution module, the input feature map is fed into a 1×1 convolutional layer for channel dimensionality reduction, and the dimensionality-reduced feature map is then fed into horizontal and vertical convolutional layers respectively. The horizontal convolutional layer uses a 1×N horizontal strip convolutional kernel to extract horizontal span features, and the vertical convolutional layer uses an N×1 vertical strip convolutional kernel to extract vertical span features. The horizontal and vertical span features are then fed into a 1×1 recovery convolutional layer for element-wise feature fusion and convolutional recovery operations to obtain a convolutional recovery feature map. A sigmoid function is introduced to activate and generate attention weights σ to adjust the convolutional recovery feature map. The attention-weighted feature map is then concatenated and fused with the input feature map through a residual connection to obtain the output feature map. Let the input feature map be X∈¡ C×H×W The output feature map is y, and the process is as follows: In the formula, σ is the attention weight. To add element by element, For element-wise multiplication, y h As a lateral span feature, y v For vertical span features, X is the input feature map, f is a 1×1 convolution transformation operation, and x i This is the two-dimensional spatial feature of the i-th channel in the input feature map.

3. The high-precision wafer surface micro-scratch detection method based on YOLO improvement according to claim 1, characterized in that: A content-aware feature reconstruction operator is introduced during the upsampling process to perform high-fidelity upsampling of deep feature maps; the content-aware feature reconstruction operator includes a kernel prediction module and a feature reconstruction module; For each target location l in the deep feature map , The kernel prediction module is based on the target location l , The neighborhood content dynamically generates specific upsampled convolutional kernel weights; the feature reconstruction module reconstructs the upsampled convolutional kernel weights of each target location with its corresponding local region to obtain a high-fidelity upsampled deep feature map; the calculation process is as follows: In the formula, For target position l , The upsampled convolution kernel weights predicted for the nth neighborhood, where N is the weight of the kernel at the target location l. , The number of local neighbors centered on X l+n For local areas, The target position l after reconstruction operation , .

4. The high-precision wafer surface micro-scratch detection method based on YOLO improvement according to claim 1, characterized in that: In the multi-scale attention domain enhancement module, the input fused feature map is split and input into parallel convolutional branches with different receptive fields to extract and aggregate multi-scale local neighborhood context information. Based on aggregated multi-scale local neighborhood context information, a linear classifier is constructed within each channel of the fused feature map, defining an energy function for each neuron within that channel. The minimum energy value of each neuron is calculated using its energy function, and an attention weight matrix containing spatial and channel importance scores is constructed based on the minimum energy values ​​of all neurons. The attention weight matrix is ​​then element-wise multiplied with the fused feature map to obtain the enhanced fused feature map. Finally, the enhanced fused feature map is added to the input fused feature map via a residual connection to obtain a significantly optimized feature map. The calculation process for the energy function is shown below: In the formula, w t e represents the weights of the linear classifier. t b is the energy function value of the target neuron t. t y is the bias term of the linear classifier; y is the target label variable of the classifier. t The expected output label for the target neuron t; x is the predicted output value of the target neuron t after linear transformation. i Let λ be the i-th neuron in the same channel excluding the target neuron, λ be the regularization coefficient, and M be the total number of neurons in that channel.

5. The high-precision wafer surface micro-scratch detection method based on YOLO improvement according to claim 4, characterized in that: The input fused feature map is weighted based on the minimum energy value e* in the energy function of each neuron, thereby enhancing the features of the input feature map. The calculation process is as follows: In the formula, E is the minimum energy value e* of all neurons. t The matrix formed This is an element-wise multiplication operation.

6. The high-precision wafer surface micro-scratch detection method based on YOLO improvement according to claim 1, characterized in that: The coordinate attention mechanism performs global pooling decomposition on the fused feature map into feature encodings along the horizontal and vertical directions, generating a direction-aware feature vector z. h and z w The calculation process is as follows: In the formula, z h For the feature vectors sensed in the horizontal direction, z w Feature vectors perceived in the vertical direction; Feature vector z based on horizontal orientation sensing h and the feature vector z of the vertical direction perception w Constructing the horizontal spatial attention weights g h Spatial attention weights g in the vertical direction w The calculation process is as follows: In the formula, [,] represents the concatenation operation, F1 is a shared 1×1 convolution function, δ is a non-linear activation function; f is the intermediate feature map containing bidirectional interaction information generated after concatenation, dimensionality reduction, and activation operations; f h For the intermediate feature map in the horizontal direction, f w The intermediate feature map in the vertical direction; F h For independent 1×1 convolution functions, F w σ is an independent 1×1 convolution function; σ is the Sigmoid activation function.

7. The high-precision wafer surface micro-scratch detection method based on YOLO improvement according to claim 6, characterized in that: Based on the horizontal spatial attention weight g h Spatial attention weights g in the vertical direction w Each coordinate position in the input fused feature map is weighted to recover the spatial coordinate information of each position; the calculation process is as follows: In the formula, x(i,j) is the coordinate information of the input feature map with coordinate position (i,j), and y(i,j) is the spatial coordinate information of the input feature map with coordinate position (i,j) after recovery.

8. The high-precision wafer surface micro-scratch detection method based on YOLO improvement according to claim 1, characterized in that: The Inner-SIoU loss function is constructed based on the distance cost and shape cost introduced into SIoU, as well as the intersection-union ratio of the auxiliary bounding box calculated based on the Inner-IoU strategy; the calculation process is shown below: In the formula, IoU inner To assist in the intersection-union ratio of the bounding boxes, To introduce the distance cost of the angle cost in SIoU, Ω is the shape cost.

9. The high-precision wafer surface micro-scratch detection method based on YOLO improvement according to claim 8, characterized in that: This approach introduces the distance cost into the angle cost of SIoU, incorporating it into the distance cost. It then uses the angle cost from SIoU to dynamically adjust the penalty weight of the distance cost. The calculation process is as follows: In the formula, γ is the penalty weight for distance cost, and ρ x ρ is the square of the relative distance in the horizontal direction. y Let Λ be the square of the relative distance in the vertical direction, and Λ be the angular cost in SIoU; Angle cost is introduced into SIoU to reduce the oscillating degrees of freedom of the regression vector. The calculation process of angle cost in SIoU is as follows: In the formula, To predict the distance between the center point of the bounding box and the center point of the true bounding box, c h To predict the height difference between the center point of the bounding box and the center point of the actual bounding box.

10. The high-precision wafer surface micro-scratch detection method based on YOLO improvement according to claim 8, characterized in that: The hybrid loss function L is constructed by weighting the Inner-SIoU loss function and the dynamic non-monotonic focusing coefficients of Wise-IoU. W-I-S The calculation process is as follows: In the formula, R WIoU L is the dynamic non-monotonic focusing coefficient of Wise-IoU. Inner-SIoU The Inner-SIoU loss function; The dynamic non-monotonic focusing coefficient of Wise-IoU is obtained by assessing the quality of the current sample based on outlier. The calculation process of the dynamic non-monotonic focusing coefficient of Wise-IoU is as follows: In the formula, exp is an exponential function with the natural constant e as its base, and x... c and y c These are the x and y coordinates of the center point of the predicted bounding box in the current output, respectively. c gt and y c gt These are the x and y coordinates of the center point of the labeled true bounding box; W g and H g These are the width and height of the smallest bounding rectangle that can completely enclose both the predicted bounding box and the ground truth bounding box, respectively.