Chip wafer defect detection method based on dual-domain query enhanced transformer
Patent Information
- Application Number
- CN202610776048.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-01
- Publication Date
- 2026-09-01
AI Technical Summary
[0004]针对上述背景技术中存在的缺陷,如传统卷积神经网络受限于静态感受野,难以捕捉晶圆表面微弱缺陷的边缘细节,以及现有Transformer架构容易引入冗余背景噪声导致误检等问题,本发明提供一种基于双域查询增强Transformer的芯片晶圆缺陷检测方法
本发明提出的基于双域查询增强Transformer的芯片晶圆缺陷检测方法,构建了一种全新的双域交互架构,通过小波增强交叉注意力机制在频域上分离并调制高频细节分量,结合原型引导交叉注意力机制在空域上自适应聚合语义原型,显著提升了模型对微弱缺陷边缘和细粒度结构的感知能力以及对复杂晶圆纹理背景的抗干扰能力,有效解决传统卷积网络因感受野受限及频域信息缺失导致的漏检误检问题;通过查询向量与语义原型的动态交互来迭代细化缺陷掩码,降低了背景冗余信息对检测精度的影响,并利用深层监督策略和多种数据增强实现了模型的高效收敛。该方法通过频域细节增强与空域语义聚焦的深度协同,在低对比度、高噪声的晶圆检测场景下实现了高精度、高鲁棒性的像素级缺陷分割,兼具理论严谨性与工业实用性。
Smart Images

Figure CN122675751A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a chip wafer defect detection method based on dual-domain query enhanced Transformer. Background Technology
[0002] With the continuous advancement of semiconductor manufacturing processes, wafer surface defect detection has become a crucial step in ensuring yield. Mainstream detection methods have evolved from traditional machine vision algorithms to deep learning-based fully convolutional neural networks and object detection networks. However, these methods primarily rely on static convolutional kernels sliding across the image space to extract features, making it difficult to effectively remove discriminative features of minute scratches or low-contrast dirt. This easily leads to missed and false detections, failing to meet the requirements for high-precision pixel-level segmentation.
[0003] In recent years, to overcome the limitations of convolutional networks, query-based Transformer architectures have been introduced to capture long-range dependencies. While existing query-driven methods have improved segmentation performance to some extent, they still suffer from two significant drawbacks in wafer inspection scenarios: First, most existing methods focus only on spatial feature interactions, neglecting frequency domain information. This results in the ineffective utilization of high-frequency components containing rich edge details, making it difficult to accurately define ambiguous defect boundaries. Second, standard cross-attention mechanisms typically calculate pairwise similarity across the entire image. This introduces a large amount of irrelevant wafer background texture into the calculation, and the resulting redundant information dilutes the query vector's attention to key defect features, thus limiting the model's detection accuracy under complex background interference. Summary of the Invention
[0004] To address the shortcomings of the aforementioned technologies, such as the limitation of traditional convolutional neural networks to a static receptive field, making it difficult to capture the edge details of subtle defects on the wafer surface, and the tendency of existing Transformer architectures to introduce redundant background noise leading to false detections, this invention provides a chip wafer defect detection method based on a dual-domain query-enhanced Transformer. This method constructs a novel dual-domain interactive architecture. In the frequency domain, wavelet transform is used to separate and modulate high-frequency detail components to enhance edge perception. In the spatial domain, a prototype learning mechanism adaptively aggregates multi-scale features into semantic prototypes with semantic information. The interaction between the semantic prototypes and learnable query vectors is used to capture key defect information and suppress interference from complex wafer textures. Through the synergistic effect of frequency domain detail enhancement and spatial domain semantic focusing, this method achieves high-precision and robust pixel-level defect segmentation in wafer detection scenarios with low contrast and complex backgrounds.
[0005] This invention is achieved using the following technical solution: A chip wafer defect detection method based on dual-domain query enhanced Transformer relies on a chip wafer defect detection model based on dual-domain query enhanced Transformer. The construction of the chip wafer defect detection model based on dual-domain query enhanced Transformer specifically includes the following steps: (1) Construct a wafer defect dataset and use various data augmentation methods such as random scaling, random cropping, horizontal flipping and mosaic enhancement to process the chip wafer images to be inspected. Adjust the processed images to a uniform resolution and perform Z-Score normalization to eliminate data distribution differences and accelerate model convergence.
[0006] (2) Building a chip wafer defect detection model based on dual-domain query enhanced Transformer: The chip wafer defect detection model based on dual-domain query enhanced Transformer can be divided into three core modules, namely feature encoding module, dual-domain Transformer decoding module and mask prediction module; (3) Use the dataset obtained in step (1) to train the model built in step (2): The model is trained using a deep supervision strategy, which specifically includes: inputting the query vector updated by each iteration of the dual-domain Transformer decoding module into the mask prediction module to generate intermediate prediction masks and final prediction masks for each level; using a combined loss function to calculate the difference between the prediction masks at each level and the real defect labels, the combined loss function consisting of binary cross-entropy loss and Dice / IoU loss, which is used to guide the network to optimize simultaneously in two dimensions: pixel classification accuracy and mask overlap; updating the network parameters through the Adam optimization algorithm, combined with a cosine annealing learning rate decay strategy, to prevent the model from getting stuck in local optima, thereby improving the convergence speed of the model and the final defect detection performance.
[0007] The chip wafer defect detection method based on dual-domain query enhanced Transformer specifically includes the following steps: (1) A variety of data augmentation methods are used to process the chip wafer image to be detected, and the processed wafer image is used as the input of the wafer defect detection model; (2) Input the processed wafer image into the chip wafer defect detection model based on dual-domain query enhancement Transformer; First, use the feature encoding module to extract multi-scale features of the processed wafer image, and initialize a set of learnable query vectors to characterize potential defect areas based on the multi-scale features; Then, use high-resolution feature maps to update the learnable query vectors; Then, input the updated learnable query vectors into the dual-domain Transformer decoding module for dual-domain interactive update: Update the learnable query vectors in the frequency domain, specifically by decomposing the high and low frequency components of the multi-scale features and modulating the high frequency detail components through the wavelet enhanced cross-attention mechanism, guiding the updated learnable query vectors to focus on weak defect details; Update the learned query vectors updated in the frequency domain in the spatial domain, by using the prototype-guided cross-attention mechanism to aggregate the multi-scale features into a semantic prototype with semantic information, and by using the interaction between the semantic prototype and the learnable query vectors, guide the updated learnable query vectors in the frequency domain to capture key defect information and suppress complex background interference; (3) The mask prediction module receives the learnable query vector updated by the dual-domain Transformer decoding module, and generates a pixel-level wafer defect detection mask by calculating its dot product with the high-resolution feature map.
[0008] In the above technical solution, the data augmentation methods employed further include: random image scaling, random cropping, horizontal flipping, and mosaic enhancement; the processed wafer image is adjusted to a uniform resolution; a normalization operation is performed on the uniform resolution wafer image to accelerate model convergence and unify the input distribution, the specific calculation formula being: in, Represented as the original wafer image Normalized output of the channel, The original wafer image Channel input, The original wafer image The statistical mean of the channel. The original wafer image The statistical standard deviation of the channel.
[0009] Furthermore, the feature encoding module is used to extract multi-scale features from the processed wafer image, and a set of learnable query vectors for characterizing potential defect regions is initialized based on the multi-scale features. The learnable query vectors are then updated using high-resolution feature maps, specifically including the following steps: First, the processed wafer image is input into the feature encoding module: four feature maps of different resolutions are first obtained using the pyramid vision Transformer backbone network; then, the Feature Pyramid Network (FPN) is used to perform channel adjustment and upsampling fusion on the above feature maps to generate multi-scale features, specifically represented as follows: in, and The first The height and width of the layer feature map To unify the adjusted channel dimensions; It is a high-resolution feature map, specifically the feature map with the highest resolution, which is used for subsequent mask prediction; Secondly, initialize a set of learnable query vectors. , used to characterize potential defect instances in a wafer image, is mathematically defined as: in, This indicates the preset number of query vectors, corresponding to the maximum number of defect instances that the model can detect. Indicates the feature dimension of the query vector; Finally, before entering the dual-domain Transformer decoding module, high-resolution features are utilized first. For the initialized query vector Perform a pre-update to make the query vector Obtain initial prior information about the defect location.
[0010] Furthermore, the dual-domain Transformer decoding module iteratively updates the learnable query vector in the frequency domain. Specifically, it employs a wavelet-enhanced cross-attention mechanism to decompose the high and low frequency components of the learnable query vector and modulate the high-frequency detail components, guiding the updated learnable query vector to focus on subtle defect details. The specific processing steps include the following: S1: Using Haar wavelet transform, the multi-scale features are decomposed into four half-resolution sub-bands, defining the low-frequency information component. and high-frequency detail components The specific calculation formula is as follows: in, This represents the low-frequency subband that contains the basic structure of the image. , and These represent the high-frequency subbands in the horizontal, vertical, and diagonal directions, respectively, which contain edge details; S2: Construct a multi-scale context module. The working method of the multi-scale context module is as follows: The high-frequency detail components and low-frequency information components are added together and then input into the multi-scale context module. By capturing the global and local channel dependencies between frequency components, global channel weights are generated. and local channel weights The specific calculation formula is as follows: in, This indicates a global average pooling operation. This represents a linear fully connected layer. Represents the ReLU activation function; S3: The global channel weights and local channel weights are fused to generate the final attention modulation weights, which are then used to weight and modulate the high-frequency detail components to suppress high-frequency noise. Specifically, this is expressed as follows: in, This represents the modulated high-frequency components. This represents the Sigmoid activation function. This represents an element-wise multiplication operation; S4: Modulate the high-frequency components With the original low-frequency information components The enhanced frequency domain features are reconstructed using inverse wavelet transform. And use them as Key and Value, along with the input query vector as the Query. Cross-attention calculation is performed to update the learnable query vector.
[0011] Furthermore, the dual-domain Transformer decoding module, while incorporating the aforementioned wavelet-enhanced cross-attention mechanism, also uses a prototype-guided cross-attention mechanism to jointly update the learnable query vector in the spatial domain. In the spatial domain, the dual-domain Transformer decoding module aggregates the multi-scale features into a semantic prototype with semantic information through the prototype-guided cross-attention mechanism. Utilizing the interaction between the semantic prototype and the frequency-domain-updated learnable query vector, it guides the frequency-domain-updated learnable query vector to capture key defect information and suppress complex background interference. Specifically: S1: Introduce a prototype learning unit, and obtain a semantic prototype with semantic information based on the prototype learning unit. The specific method is as follows: First, the input multi-scale features are... The mapping features are generated by sequentially processing the data through 3x3 convolutional layers and 1x1 convolutional layers. Subsequently based on The clustering weights are calculated using the Softmax function in the spatial dimension, and then compared with... Perform matrix multiplication to aggregate and generate a set of semantic prototypes with semantic information. Its mathematical definition is: in, The semantic prototype representing matrix multiplication operation. The number of vectors should be consistent with the number of query vectors. S2: Utilizing the multi-scale context module to capture the interaction between the semantic prototype and the frequency-domain updated learnable query vector, firstly, the generated semantic prototype... With input query vector The fused features are obtained by element-wise addition; then the fused features are processed in two ways: one way first compresses the spatial dimension through global average pooling, and then passes through a first linear fully connected layer, a ReLU activation function, and a second linear fully connected layer in sequence to generate global channel interaction weights. The other path does not perform pooling, but directly passes through the first fully connected linear layer, the ReLU activation function, and the second fully connected linear layer in sequence to generate local channel interaction weights. ; S3: Integrate the global channel interaction weights Interaction weights with local channels Generate gating coefficients, and apply the gating coefficients to the input query vector. Adaptive modulation and residual connection are performed to update the learnable query vector in the spatial domain after the frequency domain update.
[0012] Further, in step (3), the mask prediction module is used to generate a pixel-level wafer defect detection mask, which specifically includes the following steps: S1: The high-resolution features output by the feature encoding module First, the features are mapped to a mask using a 1x1 convolutional layer. Then, it is flattened in the spatial dimension to obtain the flattened mask feature. ; S2: Obtain the final query vector output by the dual-domain Transformer decoding module. The transformed query vector is then fed into a 3-layer multilayer perceptron for feature transformation. The transformed query vector and its transpose are then compared. Matrix multiplication between them generates the initial mask prediction. The specific calculation formula is as follows: in, This indicates the operation of a multilayer sensor. This represents the matrix multiplication operation. Represents the transpose of the flattened mask feature; S3: Predict the initial mask Reshaped into spatial dimension form (The reverse process of flattening), while utilizing the query vector A set of fusion weights is generated through a linear layer. Finally, the masks corresponding to all query vectors are weighted and summed, and then activated with Sigmoid to generate the final wafer defect detection results. The specific calculation formula is as follows: in, The number of query vectors, Indicates the first The weights corresponding to each query vector Indicates the first Mask prediction for each query vector.
[0013] Furthermore, during the training process of the chip wafer defect detection model based on dual-domain query enhanced Transformer, a combined loss function is used to perform deep supervised training on the output of each level of the dual-domain Transformer decoding module, guiding the model to simultaneously optimize pixel classification and defect localization accuracy; and the network parameters are updated through the Adam optimization algorithm, combined with a cosine annealing learning rate decay strategy to improve the convergence speed and detection performance of the model.
[0014] Furthermore, the combined loss function consists of the binary cross-entropy loss and the Dice / IoU loss, and its calculation formula is derived as follows: Based on the dual-domain Transformer decoding module, the first Level output The difference between the actual labeled G and the true labeled G is used to define a single-level loss function. for: in, This represents the binary cross-entropy loss, used to measure pixel-level classification accuracy. This represents the intersection-union ratio loss, used to measure the degree of overlap between the predicted mask and the true mask; and These are the balance coefficients for the binary cross-entropy loss and cross-union ratio loss, respectively. To enhance gradient propagation, all of the two-domain Transformer decoding modules... The intermediate outputs and the final fused output of each layer are weighted and summed to define the total loss function. for: in, Indicates the first The intermediate prediction results output by the layer decoder. This represents the final fused prediction result. The model optimizes the parameters of all branches by minimizing this total loss function.
[0015] The advantages of this invention are: This invention proposes a chip wafer defect detection method based on a dual-domain query-enhanced Transformer. It constructs a novel dual-domain interactive architecture, using a wavelet-enhanced cross-attention mechanism to separate and modulate high-frequency detail components in the frequency domain, and a prototype-guided cross-attention mechanism to adaptively aggregate semantic prototypes in the spatial domain. This significantly improves the model's ability to perceive weak defect edges and fine-grained structures, as well as its resistance to interference from complex wafer texture backgrounds. It effectively solves the problems of missed and false detections caused by limited receptive fields and missing frequency domain information in traditional convolutional networks. The method iteratively refines the defect mask through dynamic interaction between the query vector and the semantic prototype, reducing the impact of background redundancy on detection accuracy. Furthermore, it utilizes deep supervision strategies and various data augmentations to achieve efficient model convergence. This method, through deep synergy between frequency domain detail enhancement and spatial domain semantic focusing, achieves high-precision and robust pixel-level defect segmentation in low-contrast, high-noise wafer detection scenarios, combining theoretical rigor with industrial practicality. Attached Figure Description
[0016] Figure 1 A training framework for a chip wafer defect detection model based on dual-domain query-enhanced Transformer; Figure 2 This is a schematic diagram of the dual-domain Transformer decoding module structure; Figure 3 A schematic diagram of the wavelet-enhanced cross-attention mechanism (WCA). Figure 4 Prototype-guided cross-attention (PCA) principle diagram; Figure 5 This is a comparison of experimental results from different detection methods. Detailed Implementation
[0017] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0018] This invention provides a chip wafer defect detection method based on dual-domain query enhanced Transformer, which relies on a chip wafer defect detection model based on dual-domain query enhanced Transformer.
[0019] like Figure 1The diagram shows the training framework of the model of this invention. This model is based on an end-to-end deep neural network architecture, and the specific training steps are as follows: (1) To improve the robustness of the model under different industrial production line environments, the acquired chip wafer images were first subjected to standardized preprocessing. Specifically, the data augmentation strategies employed included random image scaling, random cropping, horizontal flipping, and mosaic enhancement, aiming to simulate the morphological changes of the wafer under different shooting angles and fields of view. After the enhanced images were adjusted to a uniform resolution, Z-Score normalization was performed to eliminate the distribution differences of wafer data from different batches and generate standardized input suitable for model learning.
[0020] (2) Input the chip wafer image processed in step (1) into the feature encoding module. First, use the visual Transformer as the backbone network to extract four feature maps of different resolutions. Then, use the feature pyramid network to fuse the four feature maps to generate multi-scale features, among which the feature map with the highest resolution is the high-resolution feature map. Simultaneously, a set of learnable query vectors is initialized, and utilized... It is pre-updated to obtain initial prior information about the defect location.
[0021] (3) The query vector and multi-scale features are updated using the dual-domain Transformer decoding module to obtain the updated query vector. The dual-domain Transformer decoding module includes two parallel processing branches: frequency domain and spatial domain, such as... Figure 2 As shown. In the frequency domain, the following is used: Figure 3 The wavelet-enhanced cross-attention (WCA) mechanism shown decomposes the high- and low-frequency components of the learnable query vector and modulates the high-frequency detail components, guiding the updated learnable query vector to focus on weak defect details. Specifically, the method involves first using Haar wavelet transform to decompose the multi-scale features into low-frequency information components. and high-frequency detail components The high-frequency detail components and low-frequency information components are input into a multi-scale context module after element-wise superposition. This module sequentially passes through a "fully connected layer-ReLU activation-fully connected layer" to generate global and local channel weights, and then fuses the global and local channel weights to obtain attention modulation weights. Subsequently, the attention modulation weights after Sigmoid activation are used to modulate the high-frequency detail components. Modulation is performed, and the modulated high-frequency components are recombined with the low-frequency information components via inverse wavelet transform. These recombined components serve as the key and value, interacting with the query vector to achieve the update of the learnable query vector. In the spatial domain, methods such as... Figure 4The prototype-guided cross-attention (PCA) mechanism shown aggregates the multi-scale features into semantic prototypes with semantic information. By leveraging the interaction between the semantic prototypes and the frequency-domain-updated learnable query vectors, it guides the frequency-domain-updated learnable query vectors to capture key defect information and suppress interference from complex backgrounds. Specifically, a prototype learning unit is first introduced. After convolutional transformation of the multi-scale features, spatial clustering weights are calculated using Softmax, and matrix multiplication is performed with the original multi-scale features to generate semantic prototypes with semantic information. Then semantic prototype The interaction relationship between the query vector and the query vector is captured by the multi-scale context module to obtain the global channel weight and the local channel weight. The global channel weight and the local channel weight are fused to generate the gating coefficient. Based on the gating coefficient, the query vector is adaptively modulated and residual connected to complete the update of the learnable query vector in the spatial domain. (4) The query vector updated by the dual-domain Transformer decoding module is received by the mask prediction module. The features are then input into a 3-layer multilayer perceptron for feature transformation and combined with the flattened mask features. (High-resolution features output in step (2)) After convolutional layer mapping and flattening, dot product (matrix multiplication) is performed to generate the initial mask prediction. Predict the initial mask. Reshaped into spatial dimension form (The reverse process of flattening), while utilizing the query vector A set of fusion weights is generated through a linear layer. Finally, the masks corresponding to all query vectors are weighted and summed, and then activated with Sigmoid to generate the final wafer defect detection results. .
[0022] (5) A combined loss function is used to perform deep supervised training on the output of each level of the dual-domain Transformer decoding module, guiding the network to simultaneously optimize pixel classification and defect localization accuracy. The combined loss function is composed of a weighted sum of binary cross-entropy loss and Dice / IoU loss; the network parameters are updated through the Adam optimization algorithm, and a cosine annealing learning rate decay strategy is used to improve the convergence speed and detection performance of the model.
[0023] Based on the trained model, high-precision and robust pixel-level defect segmentation can be achieved in wafer inspection scenarios with low contrast and complex backgrounds.
[0024] Experimental comparison results of this invention with existing few-sample anomaly detection methods WinCLIP and DRA are as follows: Figure 5As shown, in complex textures or weak defect scenes, both WinCLIP and DRA exhibit local false detections and insufficient pixel-level positioning accuracy. In contrast, this invention can more closely approximate real-world annotations for pixel-level precision segmentation of defect areas, maintaining stable detection performance even under complex background interference conditions. This verifies the robustness and technical superiority of this invention in complex environments.
[0025] The above are merely specific embodiments of the present invention and should not be construed as limiting the scope of the present invention. Equivalent variations made by those skilled in the art based on this invention, as well as changes well-known to those skilled in the art, should still fall within the scope of the present invention.
Claims
1. A chip wafer defect detection method based on dual-domain query enhanced Transformer, characterized in that, The method relies on a chip wafer defect detection model based on a dual-domain query enhanced Transformer. This model includes a feature encoding module, a dual-domain Transformer decoding module, and a mask prediction module. The detection method specifically includes the following steps: (1) Multiple data augmentation methods are used to process the chip wafer image to be inspected; (2) Input the processed wafer image into the chip wafer defect detection model based on dual-domain query enhancement Transformer; extract multi-scale features of the processed wafer image using the feature encoding module, and initialize a set of learnable query vectors for characterizing potential defect regions based on the multi-scale features; update the learnable query vectors using high-resolution feature maps; then, input the updated learnable query vectors into the dual-domain Transformer decoding module for dual-domain interactive update: update the learnable query vectors in the frequency domain, specifically by decomposing the high and low frequency components of the multi-scale features and modulating the high frequency detail components through a wavelet-enhanced cross-attention mechanism, guiding the updated learnable query vectors to focus on weak defect details; update the learned query vectors updated in the frequency domain in the spatial domain, specifically by a prototype-guided cross-attention mechanism to aggregate the multi-scale features into a semantic prototype with semantic information, and by using the interaction between the semantic prototype and the learned query vectors updated in the frequency domain to guide the learned query vectors updated in the frequency domain to capture key defect information and suppress complex background interference; (3) The mask prediction module receives the output of the dual-domain Transformer decoding module and generates a pixel-level wafer defect detection mask by calculating its dot product with the high-resolution feature map.
2. The chip wafer defect detection method based on dual-domain query enhanced Transformer as described in claim 1, characterized in that, In step (1): The data augmentation methods employed include: random image scaling, random cropping, horizontal flipping, and mosaic enhancement; the processed wafer images are adjusted to a uniform resolution; and the uniformly resolved wafer images are then normalized using the following formula: in, Represented as the original wafer image Normalized output of the channel, The original wafer image Channel input, The original wafer image The statistical mean of the channel. The original wafer image The statistical standard deviation of the channel.
3. The chip wafer defect detection method based on dual-domain query enhanced Transformer as described in claim 1, characterized in that, The feature encoding module extracts multi-scale features from the processed wafer image, and initializes a set of learnable query vectors to characterize potential defect regions based on these multi-scale features. The learnable query vectors are then updated using high-resolution feature maps. Specifically, the steps include: First, the processed wafer image is input into the feature encoding module to obtain four feature maps at different resolutions. Then, the four feature maps at different resolutions are subjected to channel adjustment and upsampling fusion to generate multi-scale features, which are represented as follows: in, and The first The height and width of the layer feature map To unify the adjusted channel dimensions; High-resolution feature maps; Secondly, initialize a set of learnable query vectors. Its mathematical definition is: in, This indicates the preset number of query vectors, corresponding to the maximum number of defect instances that the model can detect. Indicates the feature dimension of the query vector; Finally, before entering the dual-domain Transformer decoding module, high-resolution features are utilized first. For the initialized query vector Perform a pre-update to enable Obtain initial prior information about the defect location.
4. The chip wafer defect detection method based on dual-domain query enhanced Transformer as described in claim 1, characterized in that, The dual-domain Transformer decoding module updates the learnable query vector in the frequency domain, specifically including the following steps: S1: Using Haar wavelet transform, the multi-scale features are decomposed into four half-resolution sub-bands, defining the low-frequency information component. and high-frequency detail components The specific calculation formula is as follows: in, This represents the low-frequency subband that contains the basic structure of the image. , and These represent the high-frequency subbands in the horizontal, vertical, and diagonal directions, respectively, which contain edge details; S2: Construct a multi-scale context module. The working method of the multi-scale context module is as follows: The high-frequency detail components and low-frequency information components are added together and then input into the multi-scale context module. By capturing the global and local channel dependencies between frequency components, global channel weights are generated. and local channel weights The specific calculation formula is as follows: in, This indicates a global average pooling operation. This represents a linear fully connected layer. Represents the ReLU activation function; S3: The global channel weights and local channel weights are fused to generate the final attention modulation weights, which are then used to weight and modulate the high-frequency detail components to suppress high-frequency noise. Specifically, this is expressed as follows: in, This represents the modulated high-frequency components. This represents the Sigmoid activation function. This represents an element-wise multiplication operation; S4: Modulate the high-frequency components With low-frequency information components Reorganized into enhanced frequency domain features And use them as Key and Value, along with the input query vector as the Query. Cross-attention calculation is performed to update the learnable query vector.
5. The chip wafer defect detection method based on dual-domain query enhanced Transformer as described in claim 4, characterized in that, The dual-domain Transformer decoding module updates the learnable query vector in the spatial domain after the frequency domain update. The specific method is as follows: S1: First, multi-scale features The mapping features are generated by sequentially processing the data through 3x3 convolutional layers and 1x1 convolutional layers. Subsequently based on The clustering weights are calculated using the Softmax function in the spatial dimension, and then compared with... Perform matrix multiplication to aggregate and generate a set of semantic prototypes with semantic information. Its mathematical definition is: in, The semantic prototype representing matrix multiplication operation. The number of vectors should be consistent with the number of query vectors. S2: Utilizing the multi-scale context module to capture the interaction between the semantic prototype and the frequency-domain updated learnable query vector, firstly, the generated semantic prototype... With input query vector The fused features are obtained by element-wise addition; then the fused features are processed in two ways: one way first compresses the spatial dimension through global average pooling, and then passes through a first linear fully connected layer, a ReLU activation function, and a second linear fully connected layer in sequence to generate global channel interaction weights. The other path does not perform pooling, but directly passes through the first fully connected linear layer, the ReLU activation function, and the second fully connected linear layer in sequence to generate local channel interaction weights. ; S3: Integrate the global channel interaction weights Interaction weights with local channels Generate gating coefficients, and apply the gating coefficients to the input query vector. Adaptive modulation and residual connection are performed to update the learnable query vector in the spatial domain after the frequency domain update.
6. The chip wafer defect detection method based on dual-domain query enhanced Transformer as described in claim 5, characterized in that, Step (3) involves generating a pixel-level wafer defect detection mask using the mask prediction module, specifically including the following steps: S1: The high-resolution features output by the feature encoding module First, the features are mapped to a mask using a 1x1 convolutional layer. Then, it is flattened in the spatial dimension to obtain the flattened mask feature. ; S2: Obtain the final query vector output by the dual-domain Transformer decoding module. The transformed query vector is then fed into a 3-layer multilayer perceptron for feature transformation. The transformed query vector and its transpose are then compared. Matrix multiplication between them generates the initial mask prediction. The specific calculation formula is as follows: in, This indicates the operation of a multilayer sensor. This represents the matrix multiplication operation. Represents the transpose of the flattened mask feature; S3: Predict the initial mask Reshaped into spatial dimension form At the same time, using query vectors A set of fusion weights is generated through a linear layer. Finally, the masks corresponding to all query vectors are weighted and summed, and then activated with Sigmoid to generate the final wafer defect detection results. The specific calculation formula is as follows: in, The number of query vectors, Indicates the first The weights corresponding to each query vector Indicates the first Mask prediction for each query vector.
7. The chip wafer defect detection method based on dual-domain query enhanced Transformer as described in claim 6, characterized in that, During the training process of the chip wafer defect detection model based on dual-domain query enhanced Transformer, a combined loss function is used to perform deep supervised training on the output of each level of the dual-domain Transformer decoding module, guiding the model to simultaneously optimize pixel classification and defect localization accuracy; and the network parameters are updated through the Adam optimization algorithm, combined with a cosine annealing learning rate decay strategy to improve the convergence speed and detection performance of the model.
8. The chip wafer defect detection method based on dual-domain query enhanced Transformer as described in claim 7, characterized in that, The combined loss function consists of the binary cross-entropy loss and the Dice / IoU loss, and its calculation formula is derived as follows: Based on the dual-domain Transformer decoding module, the first Level output The difference between the actual labeled G and the true labeled G is used to define a single-level loss function. for: in, This represents the binary cross-entropy loss, used to measure pixel-level classification accuracy. This represents the intersection-union ratio loss, used to measure the degree of overlap between the predicted mask and the true mask; and These are the balance coefficients for the binary cross-entropy loss and cross-union ratio loss, respectively. To enhance gradient propagation, all of the two-domain Transformer decoding modules... The intermediate outputs and the final fused output of each layer are weighted and summed to define the total loss function. for: in, Indicates the first The intermediate prediction results output by the layer decoder. This represents the final fused prediction result. The model optimizes the parameters of all branches by minimizing this total loss function.