Wafer defect pattern region coarse positioning method based on improved YOLO11

CN123015429APending Publication Date: 2026-10-30XIJING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

仅由少量晶粒构成的微小缺陷经多层下采样后,特征响应被周围正常区域逐步稀释,在深层特征图中失去可区分性,直接造成检测召回率下降;细长划痕的连续结构被拆解为零散的微弱响应点,易出现定位边界偏移、缺陷区域截断等问题,无法为后续精定位环节提供可靠的候选区域输入,难以满足工业级晶圆缺陷粗定位的性能要求;因此,针对以上问题,提出下列方案

Benefits of technology

[0032]1、本发明通过对主干网络下采样结构的改进,有效提升了细粒度缺陷特征的保留能力。传统步长卷积下采样在压缩特征图空间尺寸的过程中,会通过卷积聚合对局部区域信息进行平滑,易造成离散分布的细小缺陷结构信息丢失,甚至导致细长型缺陷的特征响应发生断裂。本方法采用空间到深度重排与非步长卷积结合的下采样方式,在实现同等尺寸压缩的前提下,将局部空间单元的信息完整映射至通道维度,避免了聚合过程中的细节损耗,充分保留了晶圆缺陷的离散拓扑结构特征,强化了网络对微小、细长类缺陷模式的感知能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015429A_ABST
    Figure CN123015429A_ABST
Patent Text Reader

Abstract

The application discloses a wafer defect mode area rough positioning method based on improved YOLO11, relates to the technical field of wafer defect detection, and comprises the following steps: constructing an improved YOLO11 target detection network, replacing a convolution downsampling layer with a step of 2 in a key downsampling stage of a backbone network with an SPD-Conv module, and keeping the rest of the original network structure unchanged; adopting a dynamic non-monotonic focusing loss as a boundary box regression loss, combining a classification loss and a distributed focus loss to construct a total loss function, training the improved YOLO11 network by using a wafer defect data set with weak supervision pseudo-box labeling, and obtaining a wafer defect detection model; inputting a wafer binary graph into the wafer defect detection model for inference, and outputting all defect prediction boxes with a confidence higher than a preset threshold; based on spatial adjacency graph connected component analysis, clustering and aggregating all defect prediction boxes, generating basic regions of interest of each defect cluster, and after constraint processing, outputting final defect candidate regions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of wafer defect detection technology, and in particular relates to a coarse localization method for wafer defect mode regions based on an improved YOLO11. Background Technology

[0002] As integrated circuit manufacturing processes continue to evolve towards micro- and nano-scales, wafer surface defect detection is a core component for ensuring chip yield and reducing production control costs. Currently, YOLO-based target detection methods are widely used in coarse wafer defect localization scenarios. These methods rely on multi-layer stride convolutions of the backbone network to complete feature map downsampling and semantic information aggregation, achieving a balance between detection efficiency and recognition accuracy in general detection scenarios.

[0003] However, when the aforementioned general detection architecture is applied to wafer binary image defect detection scenarios, it suffers from a core problem: insufficient ability to represent fine-grained defect features. Wafer defects are based on discretely distributed grains as basic building blocks, with some defects consisting of only a few grains. Slender scratches, for example, have widths only reaching the scale of a single grain. Their discrimination hinges on fine-grained topological structures rather than large-scale continuous textures. Traditional convolutional downsampling with a stride of 2 compresses resolution through local neighborhood weighted aggregation, naturally smoothing out discrete detail information. With each level of downsampling, the effective feature response of abnormal regions significantly diminishes.

[0004] Continuous feature smoothing can lead to the loss of features from minute defects and the breakage of slender structures. After multi-layer downsampling, the feature response of minute defects consisting of only a few grains is gradually diluted by the surrounding normal regions, losing distinguishability in deeper feature maps and directly causing a decrease in detection recall. The continuous structure of slender scratches is broken down into scattered weak response points, easily leading to problems such as positioning boundary offset and defect region truncation, failing to provide reliable candidate region input for subsequent fine positioning and making it difficult to meet the performance requirements of coarse positioning of industrial-grade wafer defects. Therefore, the following solutions are proposed to address these issues. Summary of the Invention

[0005] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:

[0006] This invention provides a coarse localization method for wafer defect mode regions based on an improved YOLO11 method, comprising the following steps:

[0007] Step S1: Construct an improved YOLO11 object detection network by replacing the convolutional downsampling layer with a stride of 2 in the key downsampling stage of the backbone network with an SPD-Conv module, while keeping the rest of the original network structure unchanged.

[0008] Step S2: Use dynamic non-monotonic focusing loss as the bounding box regression loss, combine classification loss and distributed focus loss to construct the total loss function, and train the improved YOLO11 network using a wafer defect dataset with weakly supervised pseudo-box annotations to obtain the wafer defect detection model.

[0009] Step S3: Input the binary image of the wafer to be detected into the trained wafer defect detection model for inference, and output all defect prediction boxes with confidence scores higher than the preset threshold.

[0010] Step S4: Based on the spatial adjacency graph connected component analysis, all defect prediction boxes are clustered and aggregated to generate the basic regions of interest for each defect cluster. After scale adaptive expansion and double boundary constraint processing, the final defect candidate regions are output, completing the coarse localization of the wafer defect mode region.

[0011] Furthermore, the processing procedure of the SPD-Conv module in step S1 includes the following steps:

[0012] Step S11: Perform a spatial-to-depth rearrangement operation on the input feature map, using 2 as a downsampling factor to divide the feature map into four sub-feature maps according to the parity index, and then stitch them together along the channel dimension so that all the information of the original local spatial unit is completely preserved in the channel dimension.

[0013] Step S12: Use a convolutional layer with a stride of 1 to perform feature fusion on the rearranged feature map. After batch normalization and activation by the activation function, output the downsampled feature map. The spatial size and number of channels of the output feature map are consistent with the output size of the original convolutional layer with a stride of 2.

[0014] Furthermore, in step S1, SPD-Conv replacement is performed only on the P3 and P4 downsampling stages of the YOLO11 backbone network. The remaining convolutional modules, SPPF modules, C2PSA modules of the backbone network, as well as the neck network and detection head structure, remain unchanged.

[0015] Furthermore, the process of constructing the dynamic non-monotonic focusing loss in step S2 includes the following steps:

[0016] Step S21: Construct the first-level attention regression loss, calculate the intersection-union ratio loss between the predicted bounding box and the ground truth bounding box, and construct the center distance attention factor based on the center distance between the two boxes and the width and height of the minimum bounding rectangle. Multiply the attention factor with the intersection-union ratio loss to obtain the basic regression loss that retains only the center alignment constraint.

[0017] Step S22: Construct a sample anomaly metric. Use an exponential moving average strategy to update the historical mean of the cross-union loss during training in real time. Use the ratio of the cross-union loss of the current sample to the historical mean as the sample anomaly metric to characterize the annotation quality of the current sample.

[0018] Step S23: Construct a non-monotonic focusing mechanism. Based on the sample anomaly degree, construct a non-monotonic focusing coefficient. The focusing coefficient first increases and then decreases as the anomaly degree increases, reaching the weight peak at moderately difficult samples. Actively decay the gradient weight of low-quality pseudo-label samples with excessive anomalies. Multiply the focusing coefficient by the basic regression loss to obtain the final dynamic non-monotonic focusing loss.

[0019] Furthermore, in step S2, the formula for calculating the total loss function is:

[0020]

[0021] In the formula, For dynamic non-monotonic focusing bounding box regression loss, For classification loss based on binary cross-entropy, For distribution focus loss; , , These are the balancing weight coefficients for the corresponding loss terms.

[0022] Furthermore, the adaptive generation process of the region of interest in step S4 includes the following steps:

[0023] Step S41: Predicted box adjacency clustering. For the set of predicted boxes with confidence scores higher than a preset threshold, the spatial interval between two boxes is defined as the sum of the horizontal and vertical intervals. When the cross-union ratio of two boxes is greater than 0, or the spatial interval metric is less than the preset topological adjacency threshold, the two boxes are determined to belong to the same defect cluster.

[0024] Step S42: Connected component extraction and basic region of interest generation. Construct an undirected adjacency graph with each predicted bounding box as a vertex and adjacency relationships as edges, and extract all connected components in the graph. For all predicted bounding boxes corresponding to each connected component, find its minimum bounding rectangle as the basic region of interest for the defect cluster.

[0025] Step S43: Scale adaptive expansion. An expansion coefficient is introduced, and the width and height of the basic region of interest are expanded proportionally based on the center of the region of interest, while preserving the contextual information around the defect boundary.

[0026] Step S44: Double boundary constraints. First, apply image boundary constraints to prevent the expanded region of interest from exceeding the image range. Then, apply wafer circular effective domain constraints. Based on the wafer center and radius, retain only the region within the circular effective domain and exclude invalid background outside the wafer to obtain the final candidate region of interest for defects.

[0027] Furthermore, step S4 is followed by a Die index mapping step for the coarse positioning result, specifically:

[0028] Based on the ratio coefficient between the wafer image pixel size and the die matrix size, the coordinates of the final candidate region of interest in the pixel coordinate system are mapped to the die matrix coordinate system. A conservative envelope strategy of rounding down the upper left coordinate and rounding up the lower right coordinate is adopted to obtain the die index range of defect coverage. At the same time, the effective field constraint of the wafer circle is applied to verify the index range. Finally, the result is encapsulated into a coarse localization result output containing defect category, die index range, region center coordinates, region area and confidence.

[0029] Furthermore, in step S2, the wafer defect dataset with weakly supervised pseudo-boundary annotations is constructed in the following way:

[0030] Based on the WM-811K public wafer dataset, after removing defect-free samples, samples of eight typical defect patterns were retained: central type, annular type, edge local type, edge ring type, local type, near full type, random type, and scratch type. Based on graph-level defect labels, instance-level pseudo-label boxes were automatically generated through connected component analysis and boundary adaptive expansion as supervision information for network training.

[0031] The present invention has the following beneficial effects:

[0032] 1. This invention effectively enhances the preservation of fine-grained defect features by improving the downsampling structure of the backbone network. Traditional stride convolutional downsampling, during the compression of feature map spatial size, smooths local region information through convolutional aggregation, which easily leads to the loss of discretely distributed fine defect structural information, and even causes the feature response of slender defects to break. This method adopts a downsampling approach that combines spatial-to-depth rearrangement with non-stride convolution. Under the premise of achieving the same size compression, it completely maps the information of local spatial units to the channel dimension, avoids the loss of details during the aggregation process, fully preserves the discrete topological structural features of wafer defects, and strengthens the network's ability to perceive small and slender defect patterns.

[0033] 2. This invention improves the robustness and regression accuracy of model training in weakly supervised labeling scenarios by designing a dynamic non-monotonic focusing loss. Traditional bounding box regression losses are sensitive to labeling bias. When using rule-generated pseudo-boxes for weakly supervised training, the aspect ratio constraint and monotonic gradient mechanism of the loss function drive noise bias in the network's fitting of pseudo-boxes, generating a large number of harmful gradients that interfere with the convergence direction of the training process and reduce the final bounding box regression accuracy. This method constructs a non-monotonic weight allocation mechanism based on sample anomaly, focusing on strengthening the supervision role of medium-quality samples and actively attenuating the gradient contribution of low-quality pseudo-labels, effectively avoiding the negative interference caused by pseudo-label noise.

[0034] 3. This invention effectively improves the completeness of coarse localization output and its adaptability to subsequent stages through an adaptive candidate region generation mechanism. Traditional methods that directly extract defect regions using a single detection box are prone to edge truncation and missing contextual information for discretely distributed defect patterns. Furthermore, rectangular extraction introduces a large amount of invalid background outside the wafer, reducing the input quality of subsequent fine localization stages. This method integrates fragmented detection results through connected component analysis of a spatial adjacency graph, aggregating scattered prediction boxes belonging to the same defect pattern into a unified candidate region. Combined with scale expansion and wafer physical boundary constraints, this method not only fully covers the defect region and preserves surrounding contextual information but also effectively eliminates invalid background regions. The output candidate region can be directly adapted to subsequent fine localization stages.

[0035] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0036] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a flowchart illustrating a method for coarse localization of wafer defect mode regions based on an improved YOLO11 according to the present invention. Detailed Implementation

[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0039] Please see Figure 1 As shown, this invention is a coarse localization method for wafer defect mode regions based on an improved YOLO11, comprising the following steps:

[0040] Step S1: Construct an improved YOLO11 object detection network by replacing the convolutional downsampling layer with a stride of 2 in the key downsampling stage of the backbone network with an SPD-Conv module, while keeping the rest of the original network structure unchanged.

[0041] Step S2: Use dynamic non-monotonic focusing loss as the bounding box regression loss, combine classification loss and distributed focus loss to construct the total loss function, and train the improved YOLO11 network using a wafer defect dataset with weakly supervised pseudo-box annotations to obtain the wafer defect detection model.

[0042] Step S3: Input the binary image of the wafer to be detected into the trained wafer defect detection model for inference, and output all defect prediction boxes with confidence scores higher than the preset threshold.

[0043] Step S4: Based on the spatial adjacency graph connected component analysis, all defect prediction boxes are clustered and aggregated to generate the basic regions of interest for each defect cluster. After scale adaptive expansion and double boundary constraint processing, the final defect candidate regions are output, completing the coarse localization of the wafer defect mode region.

[0044] The processing procedure of the SPD-Conv module in step S1 includes the following steps:

[0045] Step S11: Perform a spatial-to-depth rearrangement operation on the input feature map, using 2 as a downsampling factor to divide the feature map into four sub-feature maps according to the parity index, and then stitch them together along the channel dimension so that all the information of the original local spatial unit is completely preserved in the channel dimension.

[0046] Step S12: Use a convolutional layer with a stride of 1 to perform feature fusion on the rearranged feature map. After batch normalization and activation by the activation function, output the downsampled feature map. The spatial size and number of channels of the output feature map are consistent with the output size of the original convolutional layer with a stride of 2.

[0047] In step S1, SPD-Conv replacement is performed only on the P3 and P4 downsampling stages of the YOLO11 backbone network. The remaining convolutional modules, SPPF modules, C2PSA modules of the backbone network, as well as the neck network and detection head structure, remain unchanged.

[0048] The process of constructing the dynamic non-monotonic focusing loss in step S2 includes the following steps:

[0049] Step S21: Construct the first-level attention regression loss, calculate the intersection-union ratio loss between the predicted bounding box and the ground truth bounding box, and construct the center distance attention factor based on the center distance between the two boxes and the width and height of the minimum bounding rectangle. Multiply the attention factor with the intersection-union ratio loss to obtain the basic regression loss that retains only the center alignment constraint.

[0050] Step S22: Construct a sample anomaly metric. Use an exponential moving average strategy to update the historical mean of the crossover ratio loss during training in real time. Use the ratio of the crossover ratio loss of the current sample to the historical mean as the sample anomaly metric to characterize the annotation quality of the current sample.

[0051] Step S23: Construct a non-monotonic focusing mechanism. Based on the sample anomaly degree, construct a non-monotonic focusing coefficient. The focusing coefficient first increases and then decreases as the anomaly degree increases, reaching the weight peak at moderately difficult samples. Actively decay the gradient weight of low-quality pseudo-label samples with excessive anomalies. Multiply the focusing coefficient by the basic regression loss to obtain the final dynamic non-monotonic focusing loss.

[0052] In step S2, the formula for calculating the total loss function is:

[0053]

[0054] In the formula, For dynamic non-monotonic focusing bounding box regression loss, For classification loss based on binary cross-entropy, For distribution focus loss; , , These are the balancing weight coefficients for the corresponding loss terms.

[0055] The adaptive generation process of the region of interest in step S4 includes the following steps:

[0056] Step S41: Predicted box adjacency clustering. For the set of predicted boxes with confidence scores higher than a preset threshold, the spatial interval between two boxes is defined as the sum of the horizontal and vertical intervals. When the cross-union ratio of two boxes is greater than 0, or the spatial interval metric is less than the preset topological adjacency threshold, the two boxes are determined to belong to the same defect cluster.

[0057] Step S42: Connected component extraction and basic region of interest generation. Construct an undirected adjacency graph with each predicted bounding box as a vertex and adjacency relationships as edges, and extract all connected components in the graph. For all predicted bounding boxes corresponding to each connected component, find its minimum bounding rectangle as the basic region of interest for the defect cluster.

[0058] Step S43: Scale adaptive expansion. An expansion coefficient is introduced, and the width and height of the basic region of interest are expanded proportionally based on the center of the region of interest, while preserving the contextual information around the defect boundary.

[0059] Step S44: Double boundary constraints. First, apply image boundary constraints to prevent the expanded region of interest from exceeding the image range. Then, apply wafer circular effective domain constraints. Based on the wafer center and radius, retain only the region within the circular effective domain and exclude invalid background outside the wafer to obtain the final candidate region of interest for defects.

[0060] Step S4 is followed by a Die index mapping step for the coarse localization results, specifically:

[0061] Based on the ratio coefficient between the wafer image pixel size and the die matrix size, the coordinates of the final candidate region of interest in the pixel coordinate system are mapped to the die matrix coordinate system. A conservative envelope strategy of rounding down the upper left coordinate and rounding up the lower right coordinate is adopted to obtain the die index range of defect coverage. At the same time, the effective field constraint of the wafer circle is applied to verify the index range. Finally, the result is encapsulated into a coarse localization result output containing defect category, die index range, region center coordinates, region area and confidence.

[0062] In step S2, the wafer defect dataset with weakly supervised pseudo-boundary annotations is constructed as follows:

[0063] Based on the WM-811K public wafer dataset, after removing defect-free samples, samples of eight typical defect patterns were retained: central type, annular type, edge local type, edge ring type, local type, near full type, random type, and scratch type. Based on graph-level defect labels, instance-level pseudo-label boxes were automatically generated through connected component analysis and boundary adaptive expansion as supervision information for network training.

[0064] One specific application of this embodiment is:

[0065] This embodiment uses a binarized wafer image from the WM-811K publicly available wafer dataset as the detection object. The wafer image pixel size is 200×200, corresponding to a die matrix size of 25×25, and the pixel size of a single die is 8×8. The effective area of ​​the wafer is circular, and the center coordinates are the image center point. The effective radius is 98 pixels; coarse localization of wafer defect mode regions is achieved by improving the YOLO11 network, and the specific steps are as follows:

[0066] Step S1: Construct an improved YOLO11 object detection network

[0067] Based on the native YOLO11-s network architecture, only the two key downsampling stages P3 and P4 in the backbone network are modified. The original convolutional downsampling layer with a stride of 2 is replaced with the SPD-Conv module. The remaining convolutional modules, SPPF module, C2PSA module, as well as the neck network and detection head structure of the backbone network remain unchanged.

[0068] The processing procedure of the SPD-Conv module is as follows:

[0069] Spatial-to-depth rearrangement: Using a downsampling factor of 2, the input feature map is split according to row and column parity indices, resulting in four sub-feature maps with their spatial dimensions halved. These four sub-feature maps are then concatenated along the channel dimension. Taking stage P3 as an example, the input feature map size is... (Height × Width × Number of Channels), the size of the output feature map after rearrangement is... All pixel information of the original local spatial unit is completely preserved in the channel dimension without information loss.

[0070] Feature Fusion and Output: A 3×3 convolutional layer with a stride of 1 is used to fuse channel-dimensional features in the rearranged feature map. After batch normalization and SiLU activation, a downsampled feature map is output. The P3 stage outputs a feature map with a size of [size missing]. The output size is exactly the same as the original convolutional layer with a stride of 2, ensuring that the subsequent network structure does not need to be adapted or modified.

[0071] Step S2: Train the wafer defect detection model

[0072] Dynamic non-monotonic focusing loss is used as the bounding box regression loss, and the total loss function is constructed by combining classification loss and distributed focus loss. The network is trained using a wafer defect dataset with weakly supervised pseudo-box annotations.

[0073] (1) Dataset Construction

[0074] Based on the publicly available WM-811K wafer dataset, after removing defect-free samples, samples representing eight typical defect patterns—central, annular, edge-local, edge-ring, local, near-full, random, and scratch—were retained, totaling 121,437 binary wafer images. These were randomly divided into training and validation sets at an 8:2 ratio, with 97,150 images in the training set and 24,287 in the validation set. Based on graph-level defect labels, initial bounding boxes for each defect region were extracted through connected component analysis. These bounding boxes were then adaptively expanded with a 1.1-fold expansion factor, automatically generating instance-level pseudo-labeled boxes as supervision information for network training.

[0075] (2) Total loss function

[0076] The total loss function is a weighted sum of the bounding box regression loss, classification loss, and distribution focus loss. The calculation formula is as follows:

[0077]

[0078] In the formula, For dynamic non-monotonic focusing bounding box regression loss, For classification loss based on binary cross-entropy, For distribution focus loss; , , These are the balance weight coefficients for the corresponding loss terms, and in this embodiment, their values ​​are respectively... , , .

[0079] (3) Construction of dynamic non-monotonic focusing loss

[0080] First-level attention regression loss calculation: First, calculate the intersection-union (IU) loss between the predicted bounding box and the ground truth bounding box. Then, a center distance attention factor is constructed based on the center distance between the two bounding boxes and the width and height of the minimum bounding rectangle. The attention factor is multiplied by the intersection-union ratio loss to obtain the basic regression loss that retains only the center alignment constraint. .

[0081] Sample anomaly metric: An exponential moving average strategy is used to update the historical mean of the cross-union loss during training in real time, with the moving momentum coefficient set to 0.99; the ratio of the current sample's cross-union loss to the historical mean is used as the sample anomaly metric. It is used to characterize the annotation quality of the current sample; the higher the anomaly, the greater the annotation bias of the sample.

[0082] Non-monotonic focusing mechanism: Constructing non-monotonic focusing coefficients based on sample anomaly degree The focusing coefficient varies with the degree of anomaly. Increase first, then decrease: When At that time, the focusing coefficient varies with Increase monotonicity and strengthen focus on difficult samples; when When the focusing coefficient reaches its weight peak; when At that time, the focusing coefficient varies with Increase the monotonic descent and actively decay the gradient weights of low-quality pseudo-label samples with excessively high anomalies; when At this point, the focusing coefficient decays to below 0.1, significantly suppressing the interference of noisy samples. Multiplying the focusing coefficient by the basic regression loss yields the final dynamic non-monotonic focusing loss. .

[0083] (4) Training parameter settings

[0084] The SGD optimizer was used for training, with a batch size of 32, an initial learning rate of 0.01, a weight decay coefficient of 0.0005, and a momentum coefficient of 0.937. The learning rate was decayed using a cosine annealing strategy, and the total number of training epochs was set to 300, with the first 3 epochs serving as a warm-up phase. After training, the weights with the best overall performance on the validation set were selected as the final wafer defect detection model.

[0085] Step S3: Wafer Defect Inference Detection

[0086] After scaling the binary image of the wafer to be detected to 200×200 pixels, it is input into the trained wafer defect detection model for forward inference. A confidence threshold of 0.25 and a non-maximum suppression (NMS) threshold of 0.45 are set, and all defect prediction boxes with confidence levels higher than the preset thresholds are output. Taking a scratch-type defect wafer as an example, a total of 12 defect prediction boxes with confidence levels ranging from 0.32 to 0.89 are output after inference, covering all discrete segmented regions of the scratch.

[0087] Step S4: Adaptive generation of defect candidate regions

[0088] Based on spatial adjacency graph connected component analysis, all defect prediction boxes are clustered and aggregated to generate the final defect candidate regions. The specific process is as follows:

[0089] Predicted box adjacency clustering: For a set of predicted boxes with confidence scores higher than a threshold, the spatial interval between two boxes is defined as the sum of their horizontal and vertical intervals. A topological adjacency threshold of 8 pixels is set. When the intersection-union ratio (IU) of two boxes is greater than 0, or the spatial interval is less than 8 pixels, the two boxes are determined to belong to the same defect cluster. In this embodiment, all 12 predicted boxes were grouped into the same defect cluster after adjacency determination.

[0090] Connected component extraction and basic region of interest (ROI) generation: An undirected adjacency graph is constructed using each predicted bounding box as a vertex and adjacency relationships as edges. All connected components in the graph are extracted. For each connected component and all predicted bounding boxes, its minimum bounding rectangle is calculated as the basic ROI for that defect cluster. In this embodiment, the pixel coordinates of the basic ROI corresponding to a single connected component are: The area is 142 pixels wide and 130 pixels high.

[0091] Scale-adaptive expansion: Setting the expansion factor to 1.15, the width and height of the base region of interest are expanded proportionally, based on its center, while preserving contextual information around the defect boundary. The pixel coordinates of the expanded region of interest are... .

[0092] Double boundary constraints:

[0093] The first layer is image boundary constraint: restricting the coordinates of the expanded region within the effective range of the image, i.e. , , , This avoids the area extending beyond the image boundaries. In this embodiment, the coordinates are all within the image range after expansion, so no cropping is required.

[0094] The second layer is the wafer circular effective domain constraint: centered on the wafer center. Using a radius of 98 pixels as a baseline, the rectangular region is cropped, retaining only the area within the effective circular region and excluding invalid background outside the wafer. After constraint, the effective boundary of the final defect candidate region fits the circular outline of the wafer, with no external background redundancy.

[0095] Step S4 also includes: Die index mapping of the coarse localization results.

[0096] Based on the scaling factor between the wafer image pixel size and the die matrix size, the coordinates of the final candidate region of interest in the pixel coordinate system are mapped to the die matrix coordinate system. In this embodiment, the scaling factor is 8 pixels / die, and the mapping process adopts a conservative envelope strategy of rounding down the top-left coordinate and rounding up the bottom-right coordinate.

[0097] Top left pixel coordinates Mapped to: row index Column index ;

[0098] Bottom right pixel coordinates Mapped to: row index Column index ;

[0099] The initial die index range is obtained as row 2 to row 22 and column 2 to column 22. Then, a wafer circular effective domain constraint is applied to verify the index range, eliminating die indices located outside the wafer. Finally, the effective die range covering the defect is obtained. The final coarse localization result output by the packaging includes: defect type (scratch type), die index range (row 2 to row 22, column 2 to column 22), and region center pixel coordinates. The area is approximately 12,800 pixels, and the average confidence level of the area is 0.68.

[0100] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0101] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A method for coarse localization of wafer defect mode regions based on improved YOLO11, characterized in that, Includes the following steps: Step S1: Construct an improved YOLO11 object detection network by replacing the convolutional downsampling layer with a stride of 2 in the key downsampling stage of the backbone network with an SPD-Conv module, while keeping the rest of the original network structure unchanged. Step S2: Use dynamic non-monotonic focusing loss as the bounding box regression loss, combine classification loss and distributed focus loss to construct the total loss function, and train the improved YOLO11 network using a wafer defect dataset with weakly supervised pseudo-box annotations to obtain the wafer defect detection model. Step S3: Input the binary image of the wafer to be detected into the trained wafer defect detection model for inference, and output all defect prediction boxes with confidence scores higher than the preset threshold. Step S4: Based on the spatial adjacency graph connected component analysis, all defect prediction boxes are clustered and aggregated to generate the basic regions of interest for each defect cluster. After scale adaptive expansion and double boundary constraint processing, the final defect candidate regions are output, completing the coarse localization of the wafer defect mode region.

2. The method for coarse localization of wafer defect mode regions based on improved YOLO11 according to claim 1, characterized in that, The processing procedure of the SPD-Conv module in step S1 includes the following steps: Step S11: Perform a spatial-to-depth rearrangement operation on the input feature map, using 2 as a downsampling factor to divide the feature map into four sub-feature maps according to the parity index, and then stitch them together along the channel dimension so that all the information of the original local spatial unit is completely preserved in the channel dimension. Step S12: Use a convolutional layer with a stride of 1 to perform feature fusion on the rearranged feature map. After batch normalization and activation by the activation function, output the downsampled feature map. The spatial size and number of channels of the output feature map are consistent with the output size of the original convolutional layer with a stride of 2.

3. The method for coarse localization of wafer defect mode regions based on improved YOLO11 according to claim 1, characterized in that, In step S1, SPD-Conv replacement is performed only on the P3 and P4 downsampling stages of the YOLO11 backbone network. The remaining convolutional modules, SPPF modules, C2PSA modules of the backbone network, as well as the neck network and detection head structure, remain unchanged.

4. The method for coarse localization of wafer defect mode regions based on improved YOLO11 according to claim 1, characterized in that, The process of constructing the dynamic non-monotonic focusing loss in step S2 includes the following steps: Step S21: Construct the first-level attention regression loss, calculate the intersection-union ratio loss between the predicted bounding box and the ground truth bounding box, and construct the center distance attention factor based on the center distance between the two boxes and the width and height of the minimum bounding rectangle. Multiply the attention factor with the intersection-union ratio loss to obtain the basic regression loss that retains only the center alignment constraint. Step S22: Construct a sample anomaly metric. Use an exponential moving average strategy to update the historical mean of the cross-union loss during training in real time. Use the ratio of the cross-union loss of the current sample to the historical mean as the sample anomaly metric to characterize the annotation quality of the current sample. Step S23: Construct a non-monotonic focusing mechanism. Based on the sample anomaly degree, construct a non-monotonic focusing coefficient. The focusing coefficient first increases and then decreases as the anomaly degree increases, reaching the weight peak at moderately difficult samples. Actively decay the gradient weight of low-quality pseudo-label samples with excessive anomalies. Multiply the focusing coefficient by the basic regression loss to obtain the final dynamic non-monotonic focusing loss.

5. The method for coarse localization of wafer defect mode regions based on improved YOLO11 according to claim 1, characterized in that, In step S2, the formula for calculating the total loss function is: In the formula, For dynamic non-monotonic focusing bounding box regression loss, For classification loss based on binary cross-entropy, For distribution focus loss; , , These are the balancing weight coefficients for the corresponding loss terms.

6. The method for coarse localization of wafer defect mode regions based on improved YOLO11 according to claim 1, characterized in that, The adaptive generation process of the region of interest in step S4 includes the following steps: Step S41: Predicted box adjacency clustering. For the set of predicted boxes with confidence scores higher than a preset threshold, the spatial interval between two boxes is defined as the sum of the horizontal and vertical intervals. When the cross-union ratio of two boxes is greater than 0, or the spatial interval metric is less than the preset topological adjacency threshold, the two boxes are determined to belong to the same defect cluster. Step S42: Connected component extraction and basic region of interest generation. Construct an undirected adjacency graph with each predicted bounding box as a vertex and adjacency relationships as edges, and extract all connected components in the graph. For all predicted bounding boxes corresponding to each connected component, find its minimum bounding rectangle as the basic region of interest for the defect cluster. Step S43: Scale adaptive expansion. An expansion coefficient is introduced, and the width and height of the basic region of interest are expanded proportionally based on the center of the region of interest, while preserving the contextual information around the defect boundary. Step S44: Double boundary constraints. First, apply image boundary constraints to prevent the expanded region of interest from exceeding the image range. Then, apply wafer circular effective domain constraints. Based on the wafer center and radius, retain only the region within the circular effective domain and exclude invalid background outside the wafer to obtain the final candidate region of interest for defects.

7. The method for coarse localization of wafer defect mode regions based on improved YOLO11 according to claim 1, characterized in that, Step S4 is followed by a Die index mapping step for the coarse positioning results, specifically: Based on the ratio coefficient between the wafer image pixel size and the die matrix size, the coordinates of the final candidate region of interest in the pixel coordinate system are mapped to the die matrix coordinate system. A conservative envelope strategy of rounding down the upper left coordinate and rounding up the lower right coordinate is adopted to obtain the die index range of defect coverage. At the same time, the effective field constraint of the wafer circle is applied to verify the index range. Finally, the result is encapsulated into a coarse localization result output containing defect category, die index range, region center coordinates, region area and confidence.

8. The method for coarse localization of wafer defect mode regions based on improved YOLO11 according to claim 1, characterized in that, In step S2, the wafer defect dataset with weakly supervised pseudo-boundary annotations is constructed in the following way: Based on the WM-811K public wafer dataset, after removing defect-free samples, samples of eight typical defect patterns were retained: central type, annular type, edge local type, edge ring type, local type, near full type, random type, and scratch type. Based on graph-level defect labels, instance-level pseudo-label boxes were automatically generated through connected component analysis and boundary adaptive expansion as supervision information for network training.