Method for improving wafer body defect detection accuracy through edge enhancement
By adopting edge enhancement technology, hollow convolution, Cycle-GAN variant, adaptive instance normalized convolution layer and Ywafer-BLF attention mechanism and improved WIoU loss function in wafer defect detection, the problems of low detection accuracy and large data demand in the prior art are solved, and more efficient and accurate wafer defect detection is achieved.
Patent Information
- Application Number
- CN202411969093.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art has problems of low imaging resolution, slow speed and high price in wafer defect detection. Traditional image processing methods are sensitive to image registration, poor local feature extraction robustness, and deep learning methods face problems such as large data demand, high labeling work difficulty and poor model universality.
Through edge enhancement technology, edge enhancement is used in the horizontal and vertical directions by using the Sobel-dx operator and the Sobel-dy operator to enhance the edge gradient of the picture. At the same time, the multi-scale feature information is obtained by using hollow convolution and Cycle-GAN variants, and the adaptive example normalized convolution layer and the Ywafer-BLF attention mechanism are used to perform feature fusion. Finally, the damaged defects in different directions of the wafer are identified through the improved WIoU loss function.
The accuracy of wafer defect detection is improved, the edge gradient is enhanced, so that the model can accurately judge defect location, improve defect positioning accuracy, and improve the ability to identify defect direction through attention mechanism and improved loss function.
Smart Images

Figure CN119991570A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wafer body defect detection, and in particular to a method for improving wafer body defect detection accuracy through edge enhancement. Background Art
[0002] The semiconductor industry is developing rapidly, and the key dimensions of integrated circuits are shrinking, which makes wafer defect detection more important and more difficult. Traditional bright field detection technology is facing difficulties. Automatic optical detection and scanning electron microscope detection have problems of low imaging resolution, slow speed and high price, which are difficult to meet the needs of large-scale production.
[0003] Existing image processing technologies have exposed many defects when used for wafer defect detection. Traditional methods such as detection based on reference images are sensitive to image registration, and the commonly used algorithm of comparing the detected pattern with the reference pattern to find differences cannot effectively characterize the defect type through the extracted local features, and has poor robustness, so the model needs to be redesigned for new problems. Although deep learning methods are promising, they face many challenges. On the one hand, the demand for training data is large, while in actual production, defect images are limited and not shared, and the defect types in different factories vary, making it difficult to obtain sufficient and appropriate data. On the other hand, labeling is difficult and costly, and the trained model has poor versatility. At the same time, the training process consumes a lot of time and computing resources.
[0004] In the field of optical scanning detection, when using visible light sources, the mixed multi-wavelength optical signals are difficult to distinguish; when using specific wavelength light sources, the scanning effect on some materials is poor due to the different reflectivity of the wafer surface materials. In addition, when using copper ion distribution to evaluate wafer vacancy point defects, the discrete distribution of copper ions leads to large boundary errors and unstable measurements. Summary of the invention
[0005] The purpose of the present invention is to address the deficiencies of the above-mentioned prior art and propose a method for improving the accuracy of wafer body defect detection by edge enhancement. The method proposed by the present invention has the ability to extract features of different types of defects and can improve the accuracy of wafer body defect detection.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] A method for improving wafer defect detection accuracy by edge enhancement specifically comprises the following steps:
[0008] Step S1. Obtain defect images of the original image, i.e., the magnified view, the top view, and the defect image, and input them into a wafer edge enhancement module for refinement processing, wherein the wafer edge enhancement module performs edge enhancement in the horizontal and vertical directions through a Sobel-dx operator and a Sobel-dy operator to enhance the edge gradient of the image;
[0009] Step S2. Use dilated convolution to process the magnified image and the top view, and effectively expand its receptive field by reasonably setting the dilation rate, obtain multi-scale feature information and avoid information loss; at the same time, use the Cycle-GAN variant to build a specific mapping relationship;
[0010] Step S3. Adopting Adaptive Instance Normalization (AdaIN) convolutional layer technology, the deep feature maps of the three photos are normalized and reshaped;
[0011] Step S4. Using the Ywafer-BLF feature fusion algorithm based on the attention mechanism proposed in the present invention, dynamic weights are assigned to different modal features to achieve deep fusion and semantic enhancement of the features of the three photos, thereby improving the accuracy and expressiveness of feature fusion;
[0012] Step S5. Using the improved WIoU loss function, identify the damage defects in different directions of the wafer.
[0013] Furthermore, the calculation method of the Sobel-dx operator in the step S1 for edge enhancement in the horizontal direction is:
[0014]
[0015]
[0016] Among them, G x (x, y) is the pixel at the coordinate (x, y) after horizontal edge enhancement, I(x+i, y+j) represents the pixel value of the original image at the coordinate (x+i, y+j), S dx (i+1,j+1) is the value of the Sobel-dx template at coordinate (i+1,j+1);
[0017] The calculation method of the Sobel-dy operator for edge enhancement in the vertical direction in step S1 is:
[0018]
[0019]
[0020] Among them, S dy (i+1,j+1) is the value of the Sobel-dy template at coordinate (i+1,j+1).
[0021] Furthermore, in the step S1, the Sobel-dx operator and the Sobel-dy operator, the Sobel-dx operator uses its specific convolution kernel weight matrix to accurately calculate the pixel gray value change rate of the image in the horizontal direction, effectively highlighting the edge contour in the horizontal direction; similarly, the Sobel-dy operator focuses on the vertical direction, and through its unique convolution kernel design, accurately captures the gradient change of the pixel gray value in the vertical direction, thereby enhancing the edge details in the vertical direction;
[0022] Furthermore, the Cycle-GAN variant described in step S2 can, on the one hand, transform the original magnified image and top view into an image with a receptive field that meets the requirements, and on the other hand, can achieve the conversion from the original defect image to an upsampled defect image that can more clearly show the defect features, and rely on the cycle consistency loss to ensure that the processed image can retain the key features of the original image, thereby optimizing the entire image feature extraction and processing process.
[0023] Furthermore, the calculation method of the Cycle-GAN variant described in step S2 is:
[0024] The calculation process of the generator is as follows:
[0025] Let G AB is a generator from domain A to domain B, G BA is the generator from domain B to domain A, D A and D B are the discriminators for domain A and domain B respectively;
[0026] For an input image x∈A, the generator G AB The output is:
[0027]
[0028] in is the weight of the kth convolution kernel in the lth layer, is the corresponding bias, * represents the convolution operation, φ is the activation function, U l is the upsampling operation, σ is the normalization function, is the feature map of the kth channel of the l-1th layer;
[0029] Similarly, for the input image y∈B,
[0030] Discriminator formula:
[0031] Discriminator D A The output for an input image Z (which could be a real domain A image or a fake image generated by the generator) is:
[0032]
[0033] in etc. are the convolution kernel weights and other parameters of each layer of the discriminator, F p It is a downsampling operation (such as a convolution layer with a convolution step size greater than 1), the purpose of which is to extract features and gradually reduce the resolution for true or false judgment. Similarly, D B There is also a corresponding formula;
[0034] Loss function formula:
[0035] Fighting Loss:
[0036]
[0037]
[0038] A weighted cycle consistency loss is introduced to consider the importance of features at different scales. Let α l is the weight of the cycle consistency of the lth layer;
[0039]
[0040]
[0041] Perceptual Loss:
[0042] Let Φ be a pre-trained perceptual network (such as some layers of the VGG network) used to extract high-level semantic features of the image;
[0043]
[0044]
[0045] This variant formula adds perceptual loss to the traditional Cycle-GAN to better preserve the semantic information of the image, and considers the weights of different layers in the cycle consistency loss, so that the model can learn image transformation relationships more flexibly.
[0046] Further, in step S4, the attention mechanism is the proposed Ywafer-BLF attention mechanism, and its role is reflected in three aspects: first, the local-global dual-path module can simultaneously capture the local details and global semantic information of the wafer body image, so that the model can more comprehensively and deeply understand the basic features of the wafer body image; second, the lightweight adaptive feature transformation and fusion module, which is dynamically adjusted according to the image feature distribution, combines the deep separable convolution and the dynamic parameter matrix, reduces the computational complexity and enhances the long-distance dependency capture capability, and avoids the limitation when processing the complex structure of the wafer body image; third, the gating mechanism of multimodal feature fusion, which fuses the original and transformed features to prevent the loss of feature information;
[0047] In the local-global dual-path module, the local path captures the local details of the wafer volume image, where the formula of the local path is as follows:
[0048]
[0049] in q i , k j are the query and key vectors at position (i, j), d k is the key vector dimension, X is the input image data, Attn local ,k(X) is the local attention mechanism, K is the convolution operation, X local is a local path variable;
[0050] The global path captures global semantic information. The specific formula is as follows:
[0051] X global =Pool(X)⊙Attn global (X)=Pool(X)⊙Sigmoid(W g Pool(X)+b g )
[0052] In the lightweight adaptive feature transformation and fusion module, the fusion operation is to fuse the local path with the global path. The formula is as follows:
[0053] X lg-fused =X local +X global
[0054] The adaptive transformation formula is as follows:
[0055]
[0056] in,
[0057] ParamMatrix i (X lg-fused )=Softmax(W mi Stat(X lg-fused )+b mi )(Stat(X lg-fused )(Stat(X lg-fused ) is the characteristic statistic, W mi , b mi is the parameter, X local is a local path variable, X global is the global path variable, X lg-fused is the variable after local-global fusion, X adapt is the variable after adaptive processing;
[0058] The gated fusion formula is as follows:
[0059] Y attn =Attn(X adapt )
[0060] G = σ(MLP(X lg-fused ,Y attn ))
[0061] Y wafer-BLF =G⊙Y attn +(1-G)⊙X lg-fused
[0062] Among them, Y attn is the output after attention mechanism processing, G is the gate value, Y wafer-BLF It is the result after being processed by the gated fusion mechanism;
[0063] The local-global dual-path structure is integrated with the lightweight adaptive feature transformation and gated fusion mechanism to form the attention mechanism formula Ywafer-BLF for wafer body images. This fusion method can better process wafer body image features.
[0064] Furthermore, the improved WIoU loss function in step S5, based on the traditional WIoU loss function, can effectively consider the angle difference of the defect area of the wafer body when calculating the loss by introducing an angle difference penalty term based on a Gaussian function. The larger the angle deviation, the larger the angle penalty term, thereby prompting the model to more accurately learn the characteristics of defects in different directions of the wafer body during training, and improve the ability to identify the defect direction; at the same time, by adjusting the hyperparameter λ IoU and λ θ , the weights of intersection-over-union loss and angle loss in the total loss can be flexibly adjusted according to actual data and task requirements;
[0065] The calculation formula of the improved WIoU loss function is:
[0066] Let the predicted box be B p =(x p1 ,y p1 ,x p2 ,y p2 ,θ p ), where (x p1 ,y p1 ) and (x p1 ,y p2 ) are the coordinates of the upper left corner and lower right corner of the box, θ p is the angle of the predicted box (the angle information is encoded by polar coordinate transformation, etc.), and the real box is B t =(x t1 ,yt1 ,x t2 ,y t2 ,θ t );
[0067] First, calculate the intersection area A of the predicted box and the real box intersection and the area of the union A union An angle difference penalty based on a Gaussian function is adopted, and σ is set as a parameter to control the sensitivity of the angle penalty. The angle difference penalty term is calculated:
[0068]
[0069] Improved WIoU loss function:
[0070]
[0071] where λ IoU and λ θ A hyperparameter to balance the intersection-over-union loss and the angle loss.
[0072] Furthermore, the improved WIoU loss function in step S5 can identify damaged defects in different directions of the wafer. On the basis of traditional WIoU, an angle encoding mechanism is constructed by polar coordinate transformation, the angle information of the defect area is quantified and integrated into the loss calculation, weights are assigned according to the angle difference, and the penalty for prediction results with large angle deviations is increased. Combined with multi-scale feature fusion, the WIoU loss containing angle information is calculated in feature maps of different resolutions and weighted summed, thereby improving the accuracy and robustness of defect direction recognition.
[0073] Compared with the prior art, the present invention adopts the above technical solution and has the following beneficial effects:
[0074] 1. The present invention proposes a method for improving the accuracy of wafer body defect detection through edge enhancement, which can improve the accuracy of wafer body defect detection.
[0075] 2. The present invention proposes a method for improving the accuracy of wafer defect detection through edge enhancement. The edge enhancement operation is used to effectively increase the edge gradient, so that the model can accurately determine the defect position and improve the accuracy of defect positioning.
[0076] 3. The present invention proposes a method for improving the accuracy of wafer defect detection through edge enhancement. The wafer edge enhancement module improves the overall edge gradient of the image through the synergistic effect of the Sobel-dx operator and the Sobel-dy operator, making the edge structure of the wafer in the image clearer and more identifiable, thereby facilitating subsequent accurate defect detection and analysis.
[0077] 4. The present invention proposes a method for improving the accuracy of wafer defect detection through edge enhancement, and the proposed Ywafer-BLF attention mechanism can simultaneously capture the local detail features and global semantic information of the wafer image, accurately locate and identify wafer defects, improve model characterization and generalization performance, and provide strong support for wafer manufacturing quality control and defect analysis.
[0078] 5. The present invention proposes a method for improving the accuracy of wafer defect detection through edge enhancement. By using an improved WIoU loss function, it is possible to identify damaged defects in different directions of the wafer and improve the accuracy and robustness of defect direction recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 It is a technical flow chart of the present invention;
[0080] Figure 2 This is a structural diagram of the Ywafer-BLF attention mechanism proposed in the present invention. DETAILED DESCRIPTION
[0081] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0082] A method for improving wafer defect detection accuracy by edge enhancement, the technical process is as follows: Figure 1 As shown, the specific steps include:
[0083] Step S1. Obtain defect images of the original image, i.e., the magnified view, the top view, and the defect image, and input them into a wafer edge enhancement module for refinement processing, wherein the wafer edge enhancement module performs edge enhancement in the horizontal and vertical directions through a Sobel-dx operator and a Sobel-dy operator to enhance the edge gradient of the image;
[0084] Step S2. Use dilated convolution to process the magnified image and the top view, and effectively expand its receptive field by reasonably setting the dilation rate, obtain multi-scale feature information and avoid information loss; at the same time, use the Cycle-GAN variant to build a specific mapping relationship;
[0085] Step S3. Adopting Adaptive Instance Normalization (AdaIN) convolutional layer technology, the deep feature maps of the three photos are normalized and reshaped;
[0086] Step S4. Using the feature fusion algorithm of the Ywafer-BLF attention mechanism proposed in the present invention, dynamic weights are assigned to features of different modalities to achieve deep fusion and semantic enhancement of features of the three photos, thereby improving the accuracy and expressiveness of feature fusion;
[0087] Step S5. Using the improved WIoU loss function, identify the damage defects in different directions of the wafer.
[0088] Furthermore, the calculation method of the Sobel-dx operator in the step S1 for edge enhancement in the horizontal direction is:
[0089]
[0090]
[0091] Among them, G x (x, y) is the pixel at the coordinate (x, y) after horizontal edge enhancement, I(x+i, y+j) represents the pixel value of the original image at the coordinate (x+i, y+j), S dx (i+1,j+1) is the value of the Sobel-dx template at coordinate (i+1,j+1);
[0092] The calculation method of the Sobel-dy operator for edge enhancement in the vertical direction in step S1 is:
[0093]
[0094]
[0095] Among them, S dy (i+1,j+1) is the value of the Sobel-dy template at coordinate (i+1,j+1).
[0096] Furthermore, in the step S1, the Sobel-dx operator and the Sobel-dy operator, the Sobel-dx operator uses its specific convolution kernel weight matrix to accurately calculate the pixel grayscale value change rate of the image in the horizontal direction, effectively highlighting the edge contour in the horizontal direction; similarly, the Sobel-dy operator focuses on the vertical direction, and through its unique convolution kernel design, it accurately captures the gradient change of the pixel grayscale value in the vertical direction, thereby enhancing the edge details in the vertical direction.
[0097] Furthermore, the Cycle-GAN variant described in step S2 can, on the one hand, transform the original magnified image and top view into an image with a receptive field that meets the requirements, and on the other hand, can achieve the conversion from the original defect image to an upsampled defect image that can more clearly show the defect features, and rely on the cycle consistency loss to ensure that the processed image can retain the key features of the original image, thereby optimizing the entire image feature extraction and processing process.
[0098] Furthermore, the calculation method of the Cycle-GAN variant described in step S2 is:
[0099] The calculation process of the generator is as follows:
[0100] Let G AB is a generator from domain A to domain B, G BA is the generator from domain B to domain A, D A and D B are the discriminators for domain A and domain B respectively;
[0101] For an input image x∈A, the generator G AB The output is:
[0102]
[0103] in is the weight of the kth convolution kernel in the lth layer, is the corresponding bias, * represents the convolution operation, φ is the activation function, U l is the upsampling operation, σ is the normalization function, is the feature map of the kth channel of the l-1th layer;
[0104] Similarly, for the input image y∈B,
[0105] Discriminator formula:
[0106] Discriminator D A The output for an input image Z (which could be a real domain A image or a fake image generated by the generator) is:
[0107]
[0108] in etc. are the convolution kernel weights and other parameters of each layer of the discriminator, F p It is a downsampling operation (such as a convolution layer with a convolution step size greater than 1), the purpose of which is to extract features and gradually reduce the resolution for true or false judgment. Similarly, D B There is also a corresponding formula;
[0109] Loss function formula:
[0110] Fighting Loss:
[0111]
[0112]
[0113] A weighted cycle consistency loss is introduced to consider the importance of features at different scales. Let α l is the weight of the cycle consistency of the lth layer;
[0114]
[0115]
[0116] Perceptual Loss:
[0117] Let Φ be a pre-trained perceptual network (such as some layers of the VGG network) used to extract high-level semantic features of the image;
[0118]
[0119]
[0120] This variant formula adds perceptual loss to the traditional Cycle-GAN to better preserve the semantic information of the image, and considers the weights of different layers in the cycle consistency loss, so that the model can learn image transformation relationships more flexibly.
[0121] Furthermore, in step S4, the attention mechanism is the proposed Ywafer-BLF attention mechanism, and its composition structure is as follows: Figure 2 As shown in the figure, its role is reflected in three aspects: first, the local-global dual-path module can capture the local details and global semantic information of the wafer image at the same time, allowing the model to have a more comprehensive and in-depth understanding of the basic features of the wafer image; second, the lightweight adaptive feature transformation and fusion module, which dynamically adjusts according to the image feature distribution, combines deep separable convolution and dynamic parameter matrix, reduces the computational complexity and enhances the long-distance dependency capture capability, and avoids limitations when processing complex structures of wafer images; third, the gating mechanism of multimodal feature fusion, which fuses the original and transformed features to prevent feature information loss;
[0122] In the local-global dual-path module, the local path captures the local details of the wafer volume image, where the formula of the local path is as follows:
[0123]
[0124] in q i , k j are the query and key vectors at position (i, j), dk is the key vector dimension, X is the input image data, Attn local ,k(X) is the local attention mechanism, K is the convolution operation, X local is a local path variable;
[0125] The global path captures global semantic information. The specific formula is as follows:
[0126] X global =Pool(X)⊙Attn global (X)=Pool(X)⊙Sigmoid(W g Pool(X)+b g )
[0127] In the lightweight adaptive feature transformation and fusion module, the fusion operation is to fuse the local path with the global path. The formula is as follows:
[0128] X lg-fused =X local +X global
[0129] The adaptive transformation formula is as follows:
[0130]
[0131] in,
[0132] ParamMatrix i (X lg-fused )=Softmax(W mi Stat(X lg-fused )+b mi )(Stat(X lg-fused )(Stat(X lg-fused ) is the characteristic statistic, W mi , b mi is the parameter, X local is a local path variable, X global is the global path variable, X lg-fused is the variable after local-global fusion, X adapt is the variable after adaptive processing;
[0133] The gated fusion formula is as follows:
[0134] Y attn =Attn(X adapt )
[0135] G = σ(MLP(X lg-fused ,Y attn ))
[0136] Y wafer-BLF=G⊙Y attn +(1-G)⊙X lg-fused
[0137] Among them, Y attn is the output after attention mechanism processing, G is the gate value, Y wafer-BLF It is the result after being processed by the gated fusion mechanism;
[0138] The local-global dual-path structure is integrated with the lightweight adaptive feature transformation and gated fusion mechanism to form the attention mechanism formula Ywafer-BLF for wafer body images. This fusion method can better process wafer body image features.
[0139] Furthermore, the improved WIoU loss function in step S5, based on the traditional WIoU loss function, can effectively consider the angle difference of the defect area of the wafer body when calculating the loss by introducing an angle difference penalty term based on a Gaussian function. The larger the angle deviation, the larger the angle penalty term, thereby prompting the model to more accurately learn the characteristics of defects in different directions of the wafer body during training, and improve the ability to identify the defect direction; at the same time, by adjusting the hyperparameter λ IoU and λ θ , the weight proportion of intersection-over-union loss and angle loss in the total loss can be flexibly adjusted according to actual data and task requirements;
[0140] The calculation formula of the improved WIoU loss function is:
[0141] Let the predicted box be B p =(x p1 ,y p1 ,x p2 ,y p2 ,θ p ), where (x p1 ,y p1 ) and (x p1 ,y p2 ) are the coordinates of the upper left corner and lower right corner of the box, θ p is the angle of the predicted box (the angle information is encoded by polar coordinate transformation, etc.), and the real box is B t =(x t1 ,y t1 ,x t2 ,y t2 ,θ t );
[0142] First, calculate the intersection area A of the predicted box and the real box intersection and the area of the union A union An angle difference penalty based on a Gaussian function is adopted, and σ is set as a parameter to control the sensitivity of the angle penalty. The angle difference penalty term is calculated:
[0143]
[0144] Improved WIoU loss function:
[0145]
[0146] where λ IoU and λ θ A hyperparameter to balance the intersection-over-union loss and the angle loss.
[0147] Furthermore, the improved WIoU loss function in step S5 can identify damaged defects in different directions of the wafer. On the basis of traditional WIoU, an angle encoding mechanism is constructed by polar coordinate transformation, the angle information of the defect area is quantified and integrated into the loss calculation, weights are assigned according to the angle difference, and the penalty for prediction results with large angle deviations is increased. Combined with multi-scale feature fusion, the WIoU loss containing angle information is calculated in feature maps of different resolutions and weighted summed, thereby improving the accuracy and robustness of defect direction recognition.
[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for improving wafer defect detection accuracy by edge enhancement, characterized in that: The specific steps include: Step S1. Obtain defect images of the original image, i.e., the magnified view, the top view, and the defect image, and input them into a wafer edge enhancement module for refinement processing, wherein the wafer edge enhancement module performs edge enhancement in the horizontal and vertical directions through a Sobel-dx operator and a Sobel-dy operator to enhance the edge gradient of the image; Step S2. Use dilated convolution to process the magnified image and the top view, and effectively expand its receptive field by reasonably setting the dilation rate, obtain multi-scale feature information and avoid information loss; at the same time, use the Cycle-GAN variant to build a specific mapping relationship; Step S3. Adopting the adaptive instance normalization convolutional layer technology, the feature values of the deep feature maps of the three photos are normalized and reshaped; Step S4. Using the feature fusion algorithm of the Ywafer-BLF attention mechanism proposed in the present invention, dynamic weights are assigned to features of different modalities to achieve deep fusion and semantic enhancement of features of the three photos, thereby improving the accuracy and expressiveness of feature fusion; Step S5. Using the improved WIoU loss function, identify the damage defects in different directions of the wafer.
2. The method for improving wafer defect detection accuracy by edge enhancement according to claim 1, characterized in that: The calculation method of the Sobel-dx operator in the step S1 for edge enhancement in the horizontal direction is: Among them, G x (x, y) is the pixel at the coordinate (x, y) after horizontal edge enhancement, I(x+i, y+j) represents the pixel value of the original image at the coordinate (x+i, y+j), S dx (i+1,j+10 is the value of the Sobel-dx template at coordinates (i+1,j+1); The calculation method of the Sobel-dy operator for edge enhancement in the vertical direction in step S1 is: Among them, S dy (i+1,j+1) is the value of the Sobel-dy template at coordinate (i+1,j+1).
3. The method for improving wafer defect detection accuracy by edge enhancement according to claim 1, characterized in that: In the step S1, the Sobel-dx operator and the Sobel-dy operator, the Sobel-dx operator uses its specific convolution kernel weight matrix to accurately calculate the pixel gray value change rate of the image in the horizontal direction, and effectively highlights the edge contour in the horizontal direction; similarly, the Sobel-dy operator focuses on the vertical direction, and through its unique convolution kernel design, it accurately captures the gradient change of the pixel gray value in the vertical direction, thereby enhancing the edge details in the vertical direction.
4. The method for improving wafer defect detection accuracy by edge enhancement according to claim 1, characterized in that: The Cycle-GAN variant described in step S2 can, on the one hand, transform the original magnified image and top view into an image with a receptive field that meets the requirements, and on the other hand, can achieve the conversion from the original defect image to an upsampled defect image that can more clearly show the defect features, and rely on the cycle consistency loss to ensure that the processed image can retain the key features of the original image, thereby optimizing the entire image feature extraction and processing process.
5. The method for improving wafer defect detection accuracy by edge enhancement according to claim 1, characterized in that: The Cycle-GAN variant described in step S2 is calculated as: The calculation process of the generator is as follows: Let G AB is a generator from domain A to domain B, G BA is the generator from domain B to domain A, D A and D B are the discriminators for domain A and domain B respectively; For an input image x∈A, the generator G AB The output is: in is the weight of the kth convolution kernel in layer I, is the corresponding bias, * represents the convolution operation, φ is the activation function, U l is the upsampling operation, σ is the normalization function, is the feature map of the kth channel of the l-1th layer; Similarly, for the input image y∈B, Discriminator formula: Discriminator D A The output for an input image Z (which could be a real domain A image or a fake image generated by the generator) is: in etc. are the convolution kernel weights and other parameters of each layer of the discriminator, F p It is a downsampling operation (such as a convolution layer with a convolution step greater than 1), the purpose of which is to extract features and gradually reduce the resolution for true or false judgment. Similarly, D B There is also a corresponding formula; Loss function formula: Fighting Loss: A weighted cycle consistency loss is introduced, considering the importance of features at different scales, and α is set l is the weight of the cycle consistency of the lth layer; Perceptual Loss: Let Φ be a pre-trained perceptual network (such as some layers of the VGG network) used to extract high-level semantic features of the image; This variant formula adds perceptual loss to the traditional Cycle-GAN to better preserve the semantic information of the image, and considers the weights of different layers in the cycle consistency loss, so that the model can learn image transformation relationships more flexibly.
6. The method for improving wafer defect detection accuracy by edge enhancement according to claim 1, characterized in that: In step S4, the attention mechanism is the proposed Ywafer-BLF attention mechanism, which has three functions: first, the local-global dual-path module can simultaneously capture the local details and global semantic information of the wafer image, allowing the model to have a more comprehensive and in-depth understanding of the basic features of the wafer image; second, the lightweight adaptive feature transformation and fusion module, which is dynamically adjusted according to the image feature distribution, combines the deep separable convolution and the dynamic parameter matrix, reduces the computational complexity and enhances the long-distance dependency capture capability, and avoids limitations when processing the complex structure of the wafer image; third, the gating mechanism of multimodal feature fusion, which fuses the original and transformed features to prevent the loss of feature information; In the local-global dual-path module, the local path captures the local details of the wafer volume image, where the formula of the local path is as follows: in q i , k j are the query and key vectors at position (i, j), d k is the key vector dimension, X is the input image data, Attn local ,k(X) is the local attention mechanism, K is the convolution operation, X local is a local path variable; The global path captures global semantic information. The specific formula is as follows: X global =Pool(X)⊙Attn global (X)=Pool(X)⊙Sigmoid(W g Pool(X)+b g ) In the lightweight adaptive feature transformation and fusion module, the fusion operation is to fuse the local path with the global path. The formula is as follows: X lg-fused =X local +X global The adaptive transformation formula is as follows: in, ParamMatrix i (X lg-fused )=Softmax(W mi Stat(X lg-fused )+b mi )(Stat(X lg-fused )(Stat(X lg-fused ) is the characteristic statistic, W mi , b mi is the parameter, X local is a local path variable, X global is the global path variable, X lg-fused is the variable after local-global fusion, X adapt is the variable after adaptive processing; The gated fusion formula is as follows: Y attn =Attn(X adapt ) G=σ(MLP(X lg-fused ,Y attn )) Y wafer-BLF =G⊙Y attn +(1-G)⊙X lg-fused Among them, Y attn is the output after attention mechanism processing, G is the gate value, Y wafer-BLF It is the result after being processed by the gated fusion mechanism; The local-global dual-path structure is integrated with the lightweight adaptive feature transformation and gated fusion mechanism to form the attention mechanism formula Ywafer-BLF for wafer body images. This fusion method can better process wafer body image features.
7. The method for improving wafer defect detection accuracy by edge enhancement according to claim 1, characterized in that: The improved WIoU loss function in step S5, based on the traditional WIoU loss function, can effectively consider the angle difference of the defect area of the wafer body when calculating the loss by introducing an angle difference penalty term based on a Gaussian function. The larger the angle deviation, the larger the angle penalty term, thereby prompting the model to more accurately learn the characteristics of the defects in different directions of the wafer body during the training process, and improve the ability to identify the defect direction; at the same time, by adjusting the hyperparameter λ IoU and λ θ , the weights of intersection-over-union loss and angle loss in the total loss can be flexibly adjusted according to actual data and task requirements; The calculation formula of the improved WIoU loss function is: Let the predicted box be B p =(x p1 ,y p1 ,x p2 ,y p2 ,θ p ), where (x p1 ,y p1 ) and (x p1 ,y p2 ) are the coordinates of the upper left corner and lower right corner of the box, θ p is the angle of the predicted box (the angle information is encoded by polar coordinate transformation, etc.), and the real box is B t =(x t1 ,y t1 ,x t2 ,y t2 ,θ t ); First, calculate the intersection area A of the predicted box and the real box intersection and the area of the union A union An angle difference penalty based on a Gaussian function is adopted, and σ is set as a parameter to control the sensitivity of the angle penalty. The angle difference penalty term is calculated: Improved WIoU loss function: where λ IoU and λ θ A hyperparameter to balance the intersection-over-union loss and the angle loss.
8. The method for improving wafer defect detection accuracy by edge enhancement according to claim 1, characterized in that: The improved WIoU loss function in step S5 can identify damaged defects in different directions of the wafer body. On the basis of traditional WIoU, an angle encoding mechanism is constructed by polar coordinate transformation, the angle information of the defect area is quantified and integrated into the loss calculation, weights are assigned according to the angle difference, and the penalty for prediction results with large angle deviations is increased. Combined with multi-scale feature fusion, the WIoU loss containing angle information is calculated in feature maps of different resolutions and weighted summed, thereby improving the accuracy and robustness of defect direction recognition.
Citation Information
Cited By
Steel defect detection method based on edge enhancement extraction
CN120451089A