Wafer defect detection method and device, storage medium and computer equipment

By mapping the physical coordinates of the grains to the hyperbolic manifold space, calculating the hyperbolic geodesic distance, and constructing the grain relationship diagram, the problems of information congestion and model instability in wafer defect detection are solved, achieving high-precision and robust defect detection.

CN121904045BActive Publication Date: 2026-05-22NORTHEASTERN UNIV CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHEASTERN UNIV CHINA
Filing Date
2026-03-24
Publication Date
2026-05-22

Smart Images

  • Figure CN121904045B_ABST
    Figure CN121904045B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of automatic defect detection, and particularly discloses a wafer defect detection method and device, a storage medium and computer equipment, which comprises the following steps: obtaining physical coordinates of each die on a wafer, mapping Euclidean coordinate representation of the physical coordinates of each die to a hyperbolic manifold space with negative curvature to obtain hyperbolic embedding representation of each die; in the hyperbolic manifold space, calculating a hyperbolic geodesic distance between two dies based on the hyperbolic embedding representation of each two dies, and calculating the similarity between the two dies according to the hyperbolic geodesic distance; constructing a die relationship graph based on the similarities, performing feature aggregation processing on each die according to the die relationship graph to obtain a hyperbolic graph representation of each die; performing feature decoupling on the hyperbolic graph representation of each die to obtain a causal feature representing a defect essential attribute of the die, and the causal feature has cross-environment invariance; and generating a wafer defect detection result based on the causal feature of each die.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automated defect detection technology, and in particular to a wafer defect detection method and apparatus, storage medium, and computer equipment. Background Technology

[0002] Wafer defect detection is a crucial step in semiconductor manufacturing to ensure chip yield and reliability. As integrated circuit manufacturing processes continue to evolve towards smaller linewidths and higher integration densities, wafers are highly susceptible to factors such as particle contamination, equipment drift, and process window shrinkage during multiple processes including photolithography, etching, deposition, and polishing. This results in defect patterns with specific spatial distribution rules, such as edge ring defects, central cluster defects, cluster defects, and scratch defects. Accurately identifying the spatial distribution patterns of wafer defects and locating them at the grain level is of significant engineering value for quickly tracing abnormal process steps, guiding process parameter adjustments, and reducing batch scrap.

[0003] Existing Euclidean space-based wafer defect detection methods face three key bottlenecks in practical applications. First, Euclidean geometry struggles to accurately depict the ring-like hierarchical structure of a wafer from its center to the edge: the grain density at the wafer edge increases exponentially, while the capacity of Euclidean space only increases polynomially with radius. This leads to the compression and aliasing of edge grains within the embedding space, compressing the inter-class spacing and amplifying the intra-class variance of patterns such as edge ring defects and edge cluster defects, resulting in a significant decrease in detection rate. Second, statistical correlation substitutes for causality, leading to insufficient cross-domain generalization ability: existing supervised learning methods tend to utilize environmental features in the training data that are related to but not essential to the defect label (such as machine differences, batch textures, and imaging noise) as a shortcut for discrimination. Once the test data comes from a new machine, a new batch, or a new process node, the model performance is prone to a precipitous drop. Third, it has limited ability to model complex topologies: For long-range dependent defect patterns with negative curvature geometry, such as spiral scratches, non-concentric diffusion, and cross-ring chain propagation, Euclidean graph neural networks are prone to problems such as oversmoothing and gradient instability, making it difficult to effectively encode complex spatial structures in low-dimensional embeddings. Summary of the Invention

[0004] In view of this, this application provides a wafer defect detection method and apparatus, storage medium, and computer equipment. By mapping the physical coordinates of the grains to a hyperbolic manifold space, and utilizing the exponential growth of its capacity with radius, the method accurately matches the wafer annular structure, fundamentally alleviating information congestion and distance distortion in the edge region, and significantly improving the detection capability of edge-sensitive defects. The method performs causal decoupling on the aggregated hyperbolic graph representation, removing environmental confounding factors to extract causal features of the essential attributes of the defect with cross-environment invariance, thereby maintaining stable judgment performance under new equipment and new batches. The grain relationship graph and feature aggregation mechanism constructed based on hyperbolic geodesic distance can efficiently encode complex spatial patterns such as spiral diffusion and cross-annular propagation. The embodiments of this application can effectively improve the accuracy and robustness of wafer defect detection.

[0005] According to one aspect of this application, a wafer defect detection method is provided, comprising:

[0006] Obtain the physical coordinates of each grain on the wafer, and map the Euclidean coordinates corresponding to the physical coordinates of each grain to a hyperbolic manifold space with negative curvature to obtain the hyperbolic embedding representation of each grain.

[0007] In the hyperbolic manifold space, the hyperbolic geodesic distance between two grains is calculated based on the hyperbolic embedding representation of each pair of grains, and the similarity between the two grains is calculated based on the hyperbolic geodesic distance.

[0008] Based on the similarities, a grain relationship diagram is constructed, and according to the grain relationship diagram, feature aggregation processing is performed on each grain to obtain a hyperbolic graph representation of each grain.

[0009] By decoupling the hyperbolic graph representation of each grain, causal features representing the essential defect properties of the grain are obtained, wherein the causal features are invariant across environments.

[0010] Based on the causal characteristics of each grain, wafer defect detection results are generated.

[0011] According to another aspect of this application, a wafer defect detection apparatus is provided, comprising:

[0012] The coordinate acquisition module is used to acquire the physical coordinates of each grain on the wafer, and to map the Euclidean coordinate representation corresponding to the physical coordinates of each grain to a hyperbolic manifold space with negative curvature to obtain the hyperbolic embedding representation of each grain.

[0013] A similarity calculation module is used to calculate the hyperbolic geodesic distance between two grains in the hyperbolic manifold space, based on the hyperbolic embedding representation of each pair of grains, and to calculate the similarity between the two grains based on the hyperbolic geodesic distance.

[0014] The graph characterization determination module is used to construct a grain relationship graph based on each similarity, and perform feature aggregation processing on each grain according to the grain relationship graph to obtain a hyperbolic graph characterization of each grain.

[0015] The feature decoupling module is used to decouple the hyperbolic graph representation of each grain separately to obtain causal features that characterize the defect essential properties of the grain, wherein the causal features have cross-environment invariance;

[0016] The detection result generation module is used to generate wafer defect detection results based on the causal characteristics of each grain.

[0017] According to another aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the above-described wafer defect detection method.

[0018] According to another aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described wafer defect detection method.

[0019] By employing the above technical solution, this application provides a wafer defect detection method and apparatus, storage medium, and computer device. First, the physical coordinates of each independent grain on the wafer are acquired and transformed into Euclidean coordinates in Euclidean space. These coordinates are then transformed into a hyperbolic manifold space with negative curvature through a specific mathematical mapping, thereby generating a corresponding hyperbolic embedding representation for each grain. Next, for any two grains, the hyperbolic geodesic distance is calculated based on their hyperbolic embedding representations in the hyperbolic manifold space. Subsequently, this hyperbolic geodesic distance is converted into a similarity index between the two grains. Then, based on the calculated similarity between each pair of grains, a grain relationship graph capable of characterizing the spatial topology between grains is constructed. On this basis, feature aggregation operations are performed on the nodes in the grain relationship graph; that is, each grain continuously updates its own feature representation by aggregating the hyperbolic embedding representations of its neighboring grains, ultimately obtaining a hyperbolic graph representation that integrates local neighborhood structure and global spatial information. Finally, feature decoupling is performed on the hyperbolic graph representation of each grain to obtain the causal features of that grain. Finally, based on the causal characteristics of all grains, wafer defect detection results are generated. This embodiment maps the physical coordinates of the grains to a hyperbolic manifold space, utilizing its capacity to precisely match the wafer annular structure, fundamentally alleviating information congestion and distance distortion in the edge region, and significantly improving the detection capability for edge-sensitive defects. Causal decoupling is performed on the aggregated hyperbolic graph representation, stripping away environmental confounding factors to extract causal features of the essential defect attributes with cross-environment invariance, thus maintaining stable judgment performance under new equipment and new batches. The grain relationship graph and feature aggregation mechanism constructed based on hyperbolic geodesic distance can efficiently encode complex spatial patterns such as spiral diffusion and cross-annular propagation. This embodiment effectively improves the accuracy and robustness of wafer defect detection.

[0020] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0021] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0022] Figure 1 A schematic flowchart of a wafer defect detection method provided in an embodiment of this application is shown;

[0023] Figure 2This illustration shows a schematic diagram of a grain defect probability heatmap and wafer mode output provided in an embodiment of this application;

[0024] Figure 3 This illustration shows a schematic diagram of the structure of a wafer defect detection device provided in an embodiment of this application;

[0025] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation

[0026] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0027] This embodiment provides a wafer defect detection method, such as Figure 1 As shown, the method includes:

[0028] Step 101: Obtain the physical coordinates of each grain on the wafer, and map the Euclidean coordinates corresponding to the physical coordinates of each grain to a hyperbolic manifold space with negative curvature to obtain the hyperbolic embedding representation of each grain.

[0029] Step 102: In the hyperbolic manifold space, calculate the hyperbolic geodesic distance between the two grains based on the hyperbolic embedding representation of each pair of grains, and calculate the similarity between the two grains based on the hyperbolic geodesic distance.

[0030] Step 103: Based on the similarity, construct a grain relationship diagram, and perform feature aggregation processing on each grain according to the grain relationship diagram to obtain a hyperbolic graph representation of each grain.

[0031] Step 104: Decouple the hyperbolic graph representation of each grain to obtain causal features that characterize the essential defect properties of the grain, wherein the causal features are invariant across environments.

[0032] Step 105: Generate wafer defect detection results based on the causal characteristics of each grain.

[0033] This application provides a wafer defect detection method. First, the physical coordinates of each individual grain on the wafer are obtained, and these physical coordinates are transformed into Euclidean coordinates in Euclidean space. Then, through a specific mathematical mapping, these coordinates are transformed into a hyperbolic manifold space with negative curvature, thereby generating a corresponding hyperbolic embedding representation for each grain. The hyperbolic manifold space used here has the characteristic that its capacity grows exponentially with its radius, which perfectly matches the annular structure of the wafer expanding from a sparse central region to a denser edge region. This effectively avoids the distance distortion caused by information crowding at the edge grains in traditional Euclidean space, laying a geometric foundation for subsequent accurate measurement of the spatial relationship between grains. In a specific embodiment, a unified coordinate system can be established with the wafer center as the origin, and the physical coordinates of each grain can be determined based on this coordinate system. Let the maximum effective radius of the wafer be... For the physical coordinates of each grain ( , Perform normalization:

[0034]

[0035] in, It is a small constant used to avoid boundary points falling on the boundary of the unit disk, for example... The normalized Euclidean coordinates can be represented as:

[0036] .

[0037] After obtaining the hyperbolic embedding representations of all grains, for any two grains, the shortest path length between them is calculated using the hyperbolic geodesic distance formula based on their hyperbolic embedding representations in the hyperbolic manifold space. This distance metric accurately reflects the proximity of grains in the curved space. Subsequently, this hyperbolic geodesic distance is converted into a similarity index between the two grains; the closer the distance, the higher the similarity. This provides a reliable basis for subsequently constructing the correlation between grains.

[0038] Next, based on the calculated similarity between each pair of grains, a grain relationship graph capable of characterizing the spatial topology between grains is constructed. On this basis, feature aggregation is performed on the nodes in the grain relationship graph. Each grain continuously updates its own feature representation by aggregating the hyperbolic embedding representations of its neighboring grains, ultimately obtaining a hyperbolic graph representation that integrates local neighborhood structure and global spatial information. This ensures that the hyperbolic graph representation of each grain not only contains its own information but also includes collaborative information about its related process-related or spatially adjacent grains.

[0039] Subsequently, the hyperbolic graph representation of each grain is decoupled to obtain the causal characteristics of that grain. In a specific embodiment, the hyperbolic graph representation can be input into a preset feature decoupling model. Through its embedded causal intervention mechanism, the hyperbolic graph representation is decomposed into two independent parts: one part is the causal characteristics reflecting the essential attributes of the defect, and the other part is the environmental characteristics related to environmental factors. The causal characteristics are trained to have cross-environment invariance; that is, regardless of the machine, batch, or imaging conditions from which the wafer originates, as long as the defect essence is the same, the causal characteristics remain consistent, thereby fundamentally eliminating the interference of production environment differences on defect determination.

[0040] Finally, based on the causal characteristics of all grains, wafer defect detection results are generated. These results can include the defect probability and category determination at each grain level, as well as the macroscopic identification of the defect patterns of the entire wafer (such as edge rings, center aggregation, scratches, etc.), realizing comprehensive defect detection from microscopic localization to macroscopic pattern analysis.

[0041] By applying the technical solution of this embodiment, firstly, the physical coordinates of each independent grain on the wafer are obtained, and these physical coordinates are transformed into Euclidean coordinates in Euclidean space. Then, through a specific mathematical mapping, these coordinates are transformed into a hyperbolic manifold space with negative curvature, thereby generating a corresponding hyperbolic embedding representation for each grain. Next, for any two grains, the hyperbolic geodesic distance is calculated based on their hyperbolic embedding representations in the hyperbolic manifold space. Subsequently, this hyperbolic geodesic distance is converted into a similarity index between the two grains. Then, based on the calculated similarity between each pair of grains, a grain relationship graph capable of characterizing the spatial topology between grains is constructed. On this basis, feature aggregation is performed on the nodes in the grain relationship graph; that is, each grain continuously updates its own feature representation by aggregating the hyperbolic embedding representations of its neighboring grains, ultimately obtaining a hyperbolic graph representation that integrates local neighborhood structure and global spatial information. Subsequently, feature decoupling is performed on the hyperbolic graph representation of each grain to obtain the causal features of that grain. Finally, based on the causal features of all grains, wafer defect detection results are generated. This application's embodiments map the physical coordinates of the grains to a hyperbolic manifold space, leveraging the manifold's capacity to exponentially increase with radius to precisely match the wafer's annular structure. This fundamentally alleviates information congestion and distance distortion in edge regions, significantly improving the detection capability for edge-sensitive defects. Causal decoupling is performed on the aggregated hyperbolic graph representation, stripping away environmental confounding factors to extract causal features of the essential attributes of reactive defects with cross-environment invariance. This ensures stable judgment performance even under new equipment and new batches. The grain relationship graph and feature aggregation mechanism constructed based on hyperbolic geodesic distance can efficiently encode complex spatial patterns such as spiral diffusion and cross-annular propagation. This application's embodiments can effectively improve the accuracy and robustness of wafer defect detection.

[0042] In this embodiment of the application, optionally, step 101, "mapping the Euclidean coordinate representation corresponding to the physical coordinates of each grain to a hyperbolic manifold space with negative curvature to obtain the hyperbolic embedding representation of each grain," includes: constructing a hyperbolic manifold space using a Poincaré sphere model, wherein the hyperbolic manifold space is an open sphere region used for interior point constraints; for each grain, if the first module of the grain's Euclidean coordinate representation is greater than a preset module threshold, mapping the grain's Euclidean coordinate representation to the hyperbolic manifold space using exponential mapping to obtain the grain's hyperbolic embedding representation; otherwise... Then, let the hyperbolic embedding representation be equal to the Euclidean coordinate representation of the grain; for each hyperbolic embedding representation, calculate the second modulus of the hyperbolic embedding representation; when the second modulus is greater than or equal to the preset boundary threshold determined according to the interior point constraint, adjust the hyperbolic embedding point corresponding to the hyperbolic embedding representation in the radial direction until the second modulus of the hyperbolic embedding representation corresponding to the adjusted hyperbolic embedding point is reduced to less than the preset boundary threshold, thereby obtaining the final hyperbolic embedding representation of the grain, wherein the radial direction is the direction from the center of the Poincaré sphere model to the location of the hyperbolic embedding point.

[0043] In this embodiment, firstly, a hyperbolic manifold space is constructed using a Poincaré sphere model. This space is essentially an open sphere region satisfying interior point constraints, meaning that all points within this region must satisfy the geometric condition that the product of the curvature parameter and the modulus is less than 1. This step lays the geometric foundation for the entire hyperbolic embedding representation, ensuring that the hyperbolic embedding representation of all subsequent grains is confined within a curved space with negative curvature characteristics. This allows the property of the hyperbolic manifold space capacity growing exponentially with radius to match the annular hierarchical expansion structure of the wafer from the center to the edge.

[0044] Next, for each grain, the embedding method is determined by whether the first modulus of its Euclidean coordinate representation exceeds a preset modulus threshold: when the first modulus is large, an exponential mapping is used to transform the Euclidean coordinate representation from the tangent space to the hyperbolic manifold space, generating an embedding representation that conforms to hyperbolic geometry; when the first modulus is small, the Euclidean coordinate representation is directly used as the hyperbolic embedding representation. The exponential mapping is a mathematical operation that maps vectors in the tangent space to a manifold, ensuring the geometric consistency of the mapping result in the hyperbolic space. For small modulus cases, direct assignment avoids error amplification caused by numerical calculations, ensuring the numerical stability of the mapping process.

[0045] Furthermore, a modulus check is performed on each generated hyperbolic embedding representation. Its current second modulus is calculated and compared with a preset boundary threshold determined based on interior point constraints. If the second modulus exceeds or equals this threshold, it indicates that the hyperbolic embedding point may have exceeded the effective region of the hyperbolic manifold space due to numerical calculation errors or other reasons. In this case, the position of the hyperbolic embedding point needs to be adjusted radially. Here, the radial direction refers to the direction from the center of the Poincaré sphere to the location of the hyperbolic embedding point. The point is shrunk towards the center of the sphere along this direction until its second modulus is again less than the preset boundary threshold, thus obtaining the final hyperbolic embedding representation that strictly satisfies the interior point constraints. It should be noted that although this adjustment step fine-tunes the radial distance of the hyperbolic embedding point, it retains its angular information. Therefore, it does not change the relative orientation relationship between grains, only eliminating the boundary overflow risk that may be introduced by floating-point operations.

[0046] This application's embodiments, through steps such as constructing a hyperbolic manifold space, conditional exponential mapping, and modulus verification and adjustment, ensure that the hyperbolic embedding representation of each grain not only conforms to the mathematical definition of hyperbolic geometry but also possesses numerical stability for engineering implementation. This refined embedding generation method not only provides a reliable input foundation for subsequent mapping and feature aggregation based on hyperbolic geodesic distance but also fundamentally guarantees the accuracy and robustness of the entire detection process at the geometric representation level.

[0047] In an embodiment of this application, optionally, before the step of "mapping the Euclidean coordinate representation of the grain to the hyperbolic manifold space through exponential mapping", the method further includes: obtaining initial attribute features of each grain, wherein the initial attribute features include at least one of defect confidence, defect area, grayscale statistics, and defect code; mapping the initial attribute features to the same dimension as the hyperbolic embedding representation through a learnable mapping function to obtain an attribute feature representation; correspondingly, after the step of "mapping the Euclidean coordinate representation of the grain to the hyperbolic manifold space through exponential mapping", the method further includes: fusing the attribute feature representation with the hyperbolic embedding representation to obtain a fused hyperbolic embedding representation, and calculating a second modulus based on the fused hyperbolic embedding representation.

[0048] In this embodiment, prior to performing exponential mapping, initial attribute features of each grain can be additionally acquired. These features can originate from preceding inspection equipment or process records, such as defect confidence, defect area, grayscale statistics, and defect codes. Defect confidence reflects the degree to which the grain is deemed defective; defect area describes the extent of defect coverage on the grain; grayscale statistics characterize the brightness distribution of the grain image; and the defect code is a preliminary encoding identifier for the defect type. The purpose of acquiring these initial attribute features is to combine the rich information inherent in the grain itself with subsequent geometric embedding, so that the final hyperbolic embedding representation not only includes spatial relationships but also incorporates the physical and statistical properties of the grain itself, thereby providing a more comprehensive data foundation for defect detection.

[0049] Next, the acquired initial attribute features are transformed to the same dimension as the hyperbolic embedding representation using a learnable mapping function, resulting in the attribute feature representation. This mapping process is equivalent to projecting the initial attribute features, which may originally have low dimensionality or heterogeneous formats, into a high-dimensional vector space aligned with the dimension of the hyperbolic embedding representation, enabling effective fusion of the two types of features in subsequent steps. The learnable mapping function is a parameter-trainable neural network layer (such as a fully connected layer or a linear transformation layer). Its function is to map the initial attribute features of the grain from the original feature space to a dimensional space with the same dimension as the hyperbolic embedding representation. The network parameters of this function are automatically optimized and updated during training using a backpropagation algorithm to learn how to fuse the attribute feature representation with the hyperbolic embedding representation in the most suitable way, thereby improving the representational ability and discriminative performance of the fused features.

[0050] After obtaining the hyperbolic embedding representation of each grain through exponential mapping, the previously generated attribute feature representations are fused with their corresponding hyperbolic embedding representations to obtain the fused hyperbolic embedding representation. This fusion operation can be achieved through vector addition or dimensionality reduction after concatenation, with the aim of integrating the spatial location information and attribute information of the grain into a unified feature vector. It is important to note that this fusion is performed after the exponential mapping is complete. Therefore, the fused hyperbolic embedding representation retains the geometric structure of the hyperbolic manifold while incorporating the personalized attributes of the grain, enabling subsequent modulus calculation, boundary verification, and feature aggregation operations to be performed based on this more information-rich fused representation.

[0051] Finally, the second modulus length can be calculated and boundary checks performed using the fused hyperbolic embedding representation. It is important to note that the fusion operation does not violate the geometric constraints of the hyperbolic manifold space; rather, while enhancing information, it ensures that all hyperbolic embedding points are strictly located within the open sphere region, thus maintaining the integrity and numerical stability of the entire geometric framework.

[0052] The embodiments of this application introduce initial attribute features and fuse them with hyperbolic embedding representation, so that the final representation of the grain is no longer limited to pure geometric coordinates, but integrates the physical properties and statistical features of defects, which significantly improves the information richness and discrimination ability of the final hyperbolic embedding representation.

[0053] Optionally, in this embodiment of the application, the step 103 of "constructing a grain relationship graph based on similarity" includes: for each grain, selecting the top K other grains with the highest similarity as neighboring grains based on the similarity between the grain and other grains; constructing the grain relationship graph with all grains as nodes and the connection relationship between each grain and its corresponding K neighboring grains as edges.

[0054] In this embodiment, firstly, after obtaining the pairwise similarities between all grains, for each grain, the closest related objects are selected based on these similarities. Specifically, for the current grain, its similarity with all other grains is sorted in descending order, and the top K other grains with the highest similarity are selected as the neighboring grains of this grain. Here, K is a preset positive integer, the size of which determines the number of neighbors that each grain can connect to. By adjusting the value of K, the density of the grain relationship graph can be controlled, thereby achieving a balance between the sufficiency of information aggregation and computational overhead.

[0055] Next, after selecting neighbors for all grains, the connections between these individuals are integrated into a unified graph structure. Specifically, all grains are treated as nodes in the graph, and the connections between each grain and its K neighboring grains are treated as edges, thus constructing a complete grain relationship graph. In this graph, nodes represent each grain on the wafer, and edges depict the proximity relationships between grains in the hyperbolic manifold space. This graph structure, based on hyperbolic geodesic distance, can more realistically reflect the annular hierarchical characteristics of the wafer from the center to the edge, laying a solid topological foundation for subsequent feature aggregation based on graph neural networks.

[0056] This application embodiment selects K most similar neighbors for each grain and constructs a grain relationship graph accordingly. In the hyperbolic manifold space, a grain association network is established that can capture both local neighborhood structure and global spatial distribution. This graph construction method not only avoids neighborhood misjudgment caused by information crowding in the edge region in Euclidean space, but also achieves adaptability to regions with different densities through flexible adjustment of parameter K. This provides a high-quality graph structure input for subsequent feature aggregation operations, thereby effectively supporting the accurate extraction and expression of defect features.

[0057] Optionally, after "constructing the grain relationship graph", the method further includes: filtering the edges in the grain relationship graph using a nearest neighbor constraint, retaining the edges where the two nodes constituting the edges are K nearest neighbors, and removing the remaining edges; and / or, filtering the edges in the grain relationship graph using a distance threshold constraint, removing the edge connections between two grains whose hyperbolic geodesic distance is greater than or equal to a preset distance threshold; and / or, filtering the edges in the grain relationship graph using a partitioned edge connection constraint, partitioning according to the ring zone where the grain is located, determining the target edge connection to be removed from the cross-ring zone edge connections based on a preset number, and removing the target edge connection.

[0058] In this embodiment, after constructing the grain relationship graph, the edges in the graph can be further filtered using the nearest neighbor constraint. The core idea of ​​the nearest neighbor constraint is that the two nodes connected by an edge must consider each other as their nearest neighbors. That is, for any edge connecting grain A and grain B, not only must A be a K-nearest neighbor of B, but B must also be a K-nearest neighbor of A. Only edges that satisfy both conditions are retained, while other edges that only satisfy a one-way nearest neighbor relationship are discarded. This filtering strategy can effectively remove one-way strong connections caused by noise or local anomalies, making the retained edges more structurally stable and semantically reliable, thereby improving the robustness of the grain relationship graph.

[0059] Furthermore, a distance threshold constraint can be used to filter edges in the grain relationship graph. This strategy selects edges based on the magnitude of the hyperbolic geodesic distance. For any connection between two grains, if the hyperbolic geodesic distance between them is greater than or equal to a preset distance threshold, the two grains are considered to be spatially far apart, and their connection may introduce redundant information or noise interference, so these edges are discarded; conversely, edges with a distance less than the preset distance threshold are retained. This filtering method can effectively control the sparsity of the grain relationship graph, allowing subsequent feature aggregation operations to focus on truly neighboring grains and avoiding information dilution caused by excessively long edge connections.

[0060] Alternatively, a partitioned edge constraint can be used to filter edges in the grain relationship diagram. This method first partitions the area according to the zone where the grain is located, dividing it into different zone regions based on the distance from the grain to the wafer center. Then, based on a preset number, target edge connections that need to be removed are selected from the cross-zone edge connections. Specifically, cross-zone edge connections describe the correlation between grains in different zones. While these edges are valuable for capturing cross-regional patterns such as helical diffusion and radial defects, too many cross-zone edges may introduce noise or disrupt the stability of local structures, thus requiring control over their number. By limiting the number, a small number of critical cross-zone edges are retained, while the rest are removed, thereby maintaining tight connections within the same zone while controlling the preservation of long-range dependencies across regions.

[0061] This application employs three screening strategies—nearest neighbor constraints, distance threshold constraints, and partitioned edge constraints—to optimize the grain relationship graph at multiple levels. The nearest neighbor constraints enhance the bidirectional confirmability of the grain relationship graph, the distance threshold constraints control the spatial range of edges, and the partitioned edge constraints preserve cross-regional information while avoiding over-connection. If these screening strategies work synergistically, the final grain relationship graph used for feature aggregation can maintain the compactness of local neighborhoods while also possessing the ability to capture complex global topological patterns, significantly improving the accuracy of defect determination.

[0062] In this embodiment, optionally, the feature decoupling is implemented based on a preset feature decoupling model, and the wafer defect detection result is generated based on a preset defect classifier. The preset feature decoupling model and the preset defect classifier are jointly trained through the following steps: obtaining a training sample set, wherein each training sample in the training sample set includes the physical coordinates of each grain sample on the wafer sample, the defect label, and the corresponding environmental variables; calculating the hyperbolic graph representation of each grain sample based on the physical coordinates of each grain sample in the training sample set; inputting the hyperbolic graph representation of each grain sample into the initial feature decoupling model to decouple the causal features representing the essential attributes of the defects in the grain sample and the environmental features representing the production environment factors, respectively; calling the environmental feature replacement intervention module, through which the causal features are fixed unchanged in the current training batch, and based on the environmental features of each grain sample... The environmental variables are randomly permuted for each grain sample to generate counterfactual samples. The causal features and environmental features of each grain sample, as well as the causal features and permuted environmental features of the counterfactual samples, are input into the initial defect classifier to obtain the corresponding defect judgment results. Based on the joint loss function, the network parameters of the initial feature decoupling model and the initial defect classifier are jointly iteratively optimized through backpropagation algorithm until the preset convergence condition is met, resulting in the trained preset feature decoupling model and preset defect classifier. The joint loss function includes a classification loss calculated based on the defect judgment results and corresponding defect labels, a reconstruction loss used to constrain the accuracy of hyperbolic graph representation reconstruction, an independence loss used to constrain the statistical independence of causal features and environmental features, and an intervention consistency loss used to constrain the consistency of defect judgment results between each grain sample and the counterfactual samples.

[0063] In this embodiment, firstly, a training sample set is acquired to lay the data foundation for the joint training of the preset feature decoupling model and the preset defect classifier. Each training sample in the training sample set contains the physical coordinates of each grain sample on the wafer sample, the defect label, and the corresponding environmental variables. The physical coordinates are used to generate hyperbolic graph representations, the defect labels serve as supervision signals to guide the calculation of classification loss, and the environmental variables (such as machine ID, batch number, imaging conditions, etc.) are used to distinguish different production environments during training, providing a basis for subsequent environmental feature permutation and independence constraints.

[0064] Next, based on the physical coordinates of each grain sample, Euclidean coordinate transformation, hyperbolic embedding mapping, and feature aggregation based on the grain relationship graph are performed sequentially to calculate the hyperbolic graph representation of each grain sample. This process is consistent with the feature extraction process in the aforementioned detection method, ensuring that the feature representation method used in the training phase is completely consistent with that in the inference phase, thereby enabling the trained model to be seamlessly applied to real-world detection scenarios.

[0065] Subsequently, the hyperbolic graph representations of each grain sample are input into the initial feature decoupling model. This model decomposes the input features into two independent vectors using a dual-channel encoder: one is the causal feature representing the essential attributes of defects in the grain sample, and the other is the environmental feature reflecting production environment factors. Here, the causal feature focuses on the geometric and statistical characteristics of the defect itself, while the environmental feature captures background information such as batch and machine information unrelated to the defect. This explicit decoupling lays the structural foundation for subsequent elimination of environmental interference.

[0066] After obtaining the causal and environmental features, the environmental feature substitution intervention module is invoked to generate counterfactual samples. This module keeps the causal features of each grain sample constant within the current training batch, while randomly substituting the environmental features of different grain samples based on the environmental variables of each grain sample. For example, the environmental features of a grain sample from machine A are swapped with those of a grain sample from machine B. This operation simulates the counterfactual scenario of "the same defect appearing in different production environments," thus providing data support for training the initial defect classifier to adapt to environmental changes.

[0067] Furthermore, the causal and environmental features of the original grain samples, as well as the causal and permuted environmental features of the counterfactual samples, are input into the initial defect classifier to obtain the corresponding defect determination results. These results include both the defect prediction probabilities of the original grain samples and the defect prediction probabilities of the counterfactual samples, providing crucial inputs for subsequent calculation of the loss function.

[0068] Finally, the network parameters of the initial feature decoupling model and the initial defect classifier are jointly iteratively optimized using the backpropagation algorithm based on the joint loss function. Specifically, the joint loss function consists of three parts: classification loss, reconstruction loss, independence loss, and intervention consistency loss. The classification loss is calculated based on the defect judgment result and the true defect label, ensuring that the final preset defect classifier has accurate defect recognition capabilities. The reconstruction loss requires that the decoupled causal features and environmental features can be reconstructed back into the original hyperbolic graph representation, ensuring that information is not lost or collapsed during feature separation, thus maintaining the integrity of the original hyperbolic graph representation while achieving feature decoupling. The independence loss constrains the statistical independence between causal features and environmental features, forcing the preset feature decoupling model to separate the two types of information. The intervention consistency loss requires that the defect judgment results of the original grain samples and counterfactual samples remain consistent, forcing the final preset defect classifier to rely solely on causal features rather than environmental features for decision-making. When both the initial feature decoupling model and the initial defect classifier satisfy the preset convergence conditions, the trained preset feature decoupling model and preset defect classifier are obtained.

[0069] In a specific embodiment, the joint loss function can be defined as:

[0070] ;

[0071] in, These are hyperparameters used to balance the strength of various constraints; they can be fixed values ​​or adaptively scheduled during the training process.

[0072] Classification loss Definition and composition:

[0073] The classification loss can be composed of a weighted average of the grain-level classification loss and the wafer-level classification loss:

[0074] ;

[0075] in, For grain-level classification loss, For wafer-level classification loss, and These are preset coefficients. Grain-level classification loss can be calculated based on grain-level defect labels and predicted defect determination results, and wafer-level classification loss can be calculated based on wafer-level defect labels and predicted defect determination results. It should be noted that when the actual defect labels only have wafer-level defect labels or only have grain-level defect labels, the loss of the other branch can be set to zero or a semi-supervised strategy can be adopted. This application does not restrict the form of defect labels.

[0076] Reconstruction loss Definition:

[0077] The reconstruction loss is used to ensure that the information does not collapse after decoupling, preventing the encoder from pushing all the information to a single channel or learning a constant vector. Reconstructor by Reconstructed features :

[0078] ;

[0079] Reconstruction loss is defined as:

[0080] ;

[0081] in, It is the mask of the i-th grain sample, indicating whether the current grain sample i is valid (0 means invalid and not included in the calculation). This represents the original hyperbolic plot characterization of the i-th grain sample. Indicates through the refactorer R Causal characteristics of the i-th grain sample and environmental characteristics The reconstructed characterization obtained after recombination. Causal features. and environmental characteristics It is obtained by decoupling the initial feature decoupling model, which is continuously optimized during the training process.

[0082] Independence loss Definition:

[0083] Independence loss is used to make causal features With environmental characteristics Statistical independence should be maximized to reduce the risk of environmental information leakage into causal branches. The HSIC format is preferred.

[0084] ;

[0085] Among them, HSIC (Hilbert-Schmidt Independence Criterion) represents the Hilbert-Schmidt independence criterion.

[0086] Intervention Consistency Loss Definition:

[0087] This application approximates the do-operator effect through an environmental feature replacement intervention module: fixed By rearranging environmental features within a mini-batch, counterfactual samples are constructed.

[0088] ;

[0089] Let the causal characteristics of grain sample i With environmental characteristics The corresponding defect determination result is Causal characteristics of counterfactual samples Environmental characteristics after replacement The corresponding defect determination result is Then the intervention consistency loss is:

[0090]

[0091] in, This represents the KL divergence, used to measure the difference between two probability distributions.

[0092] It should be noted that each of the above losses is the cumulative loss of each grain sample.

[0093] This application embodiment uses a dual-channel encoder to decompose the hyperbolic graph representation into defect ontology causal features. With environmental characteristics And combined with independence constraints (suppression) and Stable decoupling is achieved through statistical correlation and reconstruction constraints (to prevent information collapse and maintain representation integrity). Based on this, permutation-based intervention training is introduced: maintaining... Unchanged, for Permutations are performed by resampling within a batch or across environments, so that the initial defect classifier can still maintain consistent predictions when environmental features are "interrupted / replaced". This approximates the backdoor path cutting off of the do-operator from the training mechanism, significantly weakens the interference of environmental shortcut features on the accuracy of defect judgment results, and improves cross-domain generalization and robustness.

[0094] In another specific embodiment, staged training can be used to improve convergence stability and final performance:

[0095] Phase 1: Geometric Representation Stabilization Phase: Only the reconstructed hyperbolic graph representation is trained until it converges to a stable state. Specifically, this can be achieved by letting... Larger medium, The size is relatively small to avoid excessive initial intervention that could lead to non-convergence in classification.

[0096] Phase Two: Causal Decoupling Formation Phase: Initiating causal branches / environmental branches and refactoring mechanisms, with a focus on optimization. , prompt and Clear division of labor.

[0097] Phase Three: Invariance Enhancement Phase: Improvement Strengthening the consistency of interventions makes the initial defect classifier more reliant on... Rather than environmental information.

[0098] Fourth stage: Accuracy convergence stage: Appropriately reduce and This increases the weight of the classification loss term and achieves optimal judgment accuracy.

[0099] This application's embodiments introduce environmental variables, decoupling features, construct counterfactual samples, and multi-task loss constraints, enabling the initial feature decoupling model and the initial defect classifier to learn to remove environmental interference and focus on the essence of defects during the training phase. The final trained preset feature decoupling model can extract causal features with cross-environment invariance, while the preset defect classifier has the ability to make stable judgments based solely on these causal features. Thus, it can maintain excellent generalization performance and detection robustness when facing new machines and new batches during the inference phase.

[0100] In one specific embodiment, during the wafer defect detection stage, after extracting the hyperbolic graph representation of the grains, it is input into a pre-trained preset feature decoupling model to obtain decoupled causal and environmental features. This preset feature decoupling model employs a dual-channel encoder structure. One channel focuses on extracting causal features strongly correlated with the defect category, while the other channel encodes environmental features related to the production environment (such as machine tool, batch, imaging conditions, etc.). During the wafer defect detection stage, the two encoders operate in parallel, but only output the causal features for subsequent wafer defect detection tasks. Environmental features are calculated but do not participate in the final judgment; their existence is to ensure the purity of causal features during the training phase through independence constraints and intervention consistency loss. After training and optimization, the causal features possess cross-environment invariance, meaning that regardless of the production conditions of the input wafer, as long as the defect essence is the same, its causal features remain stable and consistent, thus providing a reliable and highly generalizable input for the subsequent preset defect classifier.

[0101] Furthermore, during the training phase, both causal and environmental features are simultaneously input into the initial defect classifier. The purpose is not to make the initial classifier rely on environmental features for decision-making, but rather to force it to learn the mapping relationship that "the defect judgment result should remain unchanged when environmental features change" by intervening in the consistency loss constraint. Specifically, by fixing causal features within training batches, randomly replacing the environmental features of different grain samples to construct counterfactual samples, and constraining the consistency of defect judgment results between the original grain samples and the counterfactual samples, the initial defect classifier is repeatedly trained to isolate the influence of environmental features on decision-making, thereby anchoring its decision basis to causal features that are only related to the essence of the defect. After the above joint optimization, the final preset defect classifier has learned cross-environment invariance, meaning its internal parameters have been adjusted to a state where it can make accurate judgments based solely on causal features. At this point, environmental features have become redundant information for the preset defect classifier. If they are still input during the wafer defect detection stage, it will not only fail to improve accuracy but may also introduce interference due to differences in the environmental distribution between the training and test sets. Therefore, in the wafer defect detection stage, to maintain consistency in input dimensions, environmental features can be set as zero vectors or predefined default values, and used as placeholders concatenated with causal features before being input into the preset defect classifier. Since the preset defect classifier has learned cross-environment invariance during training, it is not sensitive to the specific values ​​of environmental placeholders. Therefore, this design ensures the consistency of the training and inference input structures without affecting the accuracy of the defect determination results.

[0102] In a specific embodiment, the model structure of the preset feature decoupling model can be as follows:

[0103] A dual-channel encoder structure is employed, along with a shared input layer. The shared input layer receives hyperbolic graph representations and passes them to the causal branch encoder and the environmental branch encoder within the dual-channel encoder structure, respectively. The causal branch encoder, composed of multiple stacked fully connected layers, extracts causal features related to the essential attributes of the defects; the environmental branch encoder, also composed of multiple fully connected layers, extracts environmental features related to production environment factors. The output dimensions of the two branches can be independently set according to actual needs, and statistical decoupling of the two types of features is ensured throughout the network training process through independence loss.

[0104] The model structure of the pre-defined defect classifier can be as follows:

[0105] The system comprises an input layer, multiple fully connected hidden layers, and an output layer. The input layer receives causal features and environment placeholders, and concatenates them. Multiple fully connected hidden layers are sequentially connected to perform non-linear transformations and feature abstraction on the concatenated result. Finally, based on the result of the last fully connected hidden layer, the output layer outputs the defect determination result. For grain-level defect determination, the output layer uses the Softmax activation function to output the probability distribution of the defect category for each grain. For wafer-level defect determination, a graph pooling layer is added before the pre-defined defect classifier to globally aggregate the causal features of all grains, and then input them along with the environment placeholders into the input layer. The output layer also uses the Softmax activation function to output the wafer-level defect determination result.

[0106] Optionally, in this embodiment, the preset defect classifier includes a grain-level defect classifier and a wafer-level defect classifier. When the wafer defect detection result includes both a grain-level defect determination result and a wafer-level defect determination result, step 105 includes: inputting the causal features of each grain into the grain-level defect classifier, outputting the defect probability and / or defect category of each grain as the grain-level defect determination result; performing graph-level pooling on the causal features of all grains to obtain wafer-level global features characterizing the defect distribution pattern of the entire wafer; inputting the wafer-level global features into the wafer-level defect classifier, and outputting the wafer-level defect determination result.

[0107] In this embodiment, firstly, the causal features of each grain are input into a grain-level defect classifier. This classifier, after pre-training, can perform refined discrimination of each independent grain based on the defect essence information contained in the causal features, and output the defect probability distribution or specific defect category label for each grain. This step achieves accurate location and classification of defects at the grain scale, providing basic data for subsequent microscopic defect analysis.

[0108] Next, graph-level pooling is performed on the causal features of all grains, aggregating the causal features of all grains on the entire wafer into a wafer-level global feature that can characterize the overall defect distribution pattern of the wafer. Graph-level pooling is an operation that aggregates node-level features into graph-level features. Common methods include global average pooling or global max pooling. Its function is to integrate scattered grain information into a wafer-level global feature that reflects the macroscopic state of the wafer. Subsequently, this wafer-level global feature is input into a wafer-level defect classifier, which outputs wafer-level defect judgment results, such as edge ring defects, center cluster defects, or scratch defects, thereby achieving a macroscopic assessment of the overall wafer yield.

[0109] It should be noted that, here, the grain-level defect classifier and the wafer-level defect classifier can be trained together with the initial feature decoupling model.

[0110] This application's embodiments employ a dual-branch collaborative output design at the grain and wafer levels. This enables precise identification of the defect state of each grain at the microscale and a grasp of the defect distribution pattern of the entire wafer at the macroscale, forming a complete detection chain from local to global. This hierarchical detection architecture fully leverages the cross-environment invariance of causal features, resulting in detection results that possess both precise localization capabilities and robust macroscopic discrimination capabilities.

[0111] In a specific embodiment, such as Figure 2 The diagram illustrates a schematic of a grain defect probability heatmap and wafer pattern output. Specifically, the grain-level defect classifier (i.e., the hyperbolic node classifier corresponding to branch A in the diagram) can also output a grain-level defect probability heatmap, where the position of each grain is rendered with different gray levels or color depths according to its defect probability value, visually presenting the spatial distribution and confidence level of defects on the wafer surface. The wafer-level defect classifier (i.e., the hyperbolic graph classifier corresponding to branch B in the diagram) can also output wafer-level pattern classification results, which can include labels for each wafer defect category (such as edge rings, center clusters, scratches, etc.) and their corresponding confidence levels. Figure 2 It can accurately locate defects at the grain scale and accurately identify macroscopic defect patterns at the wafer scale.

[0112] Furthermore, as Figure 1 In terms of specific implementation of the method, this application provides a wafer defect detection device, such as... Figure 3 As shown, the device includes:

[0113] The coordinate acquisition module is used to acquire the physical coordinates of each grain on the wafer, and to map the Euclidean coordinate representation corresponding to the physical coordinates of each grain to a hyperbolic manifold space with negative curvature to obtain the hyperbolic embedding representation of each grain.

[0114] The similarity calculation module is used to calculate the hyperbolic geodesic distance between two grains in the hyperbolic manifold space based on the hyperbolic embedding representation of each pair of grains, and to calculate the similarity between the two grains based on the hyperbolic geodesic distance.

[0115] The graph characterization determination module is used to construct a grain relationship graph based on each similarity, and perform feature aggregation processing on each grain according to the grain relationship graph to obtain a hyperbolic graph characterization of each grain.

[0116] The feature decoupling module is used to decouple the hyperbolic graph representation of each grain separately to obtain causal features that characterize the defect essential properties of the grain, wherein the causal features have cross-environment invariance;

[0117] The detection result generation module is used to generate wafer defect detection results based on the causal characteristics of each grain.

[0118] Optionally, the coordinate acquisition module is used for:

[0119] A hyperbolic manifold space is constructed using the Poincaré sphere model, wherein the hyperbolic manifold space is an open sphere region used for interior point constraints;

[0120] For each grain, if the first modulus of the Euclidean coordinate representation of the grain is greater than a preset modulus threshold, the Euclidean coordinate representation of the grain is mapped to the hyperbolic manifold space through exponential mapping to obtain the hyperbolic embedding representation of the grain; otherwise, the hyperbolic embedding representation is set to be equal to the Euclidean coordinate representation of the grain.

[0121] For each hyperbolic embedding representation, the second modulus of the hyperbolic embedding representation is calculated. When the second modulus is greater than or equal to a preset boundary threshold determined according to the interior point constraint, the hyperbolic embedding point corresponding to the hyperbolic embedding representation is adjusted in the radial direction until the second modulus of the hyperbolic embedding representation corresponding to the adjusted hyperbolic embedding point is reduced to less than the preset boundary threshold, thereby obtaining the final hyperbolic embedding representation of the grain. The radial direction is the direction from the center of the Poincaré sphere model to the location of the hyperbolic embedding point.

[0122] Optionally, the device further includes a feature acquisition module; the feature acquisition module is configured to:

[0123] Before mapping the Euclidean coordinate representation of the grain to the hyperbolic manifold space through exponential mapping, the initial attribute features of each grain are obtained, wherein the initial attribute features include at least one of defect confidence, defect area, grayscale statistics and defect code;

[0124] The initial attribute features are mapped to the same dimension as the hyperbolic embedding representation using a learnable mapping function to obtain the attribute feature representation;

[0125] Accordingly, the device further includes a feature fusion module; the feature fusion module is used for:

[0126] After mapping the Euclidean coordinate representation of the grain to the hyperbolic manifold space through exponential mapping, the attribute feature representation is fused with the hyperbolic embedding representation to obtain the fused hyperbolic embedding representation, and the second modulus is calculated based on the fused hyperbolic embedding representation.

[0127] Optionally, the graph representation determination module is used for:

[0128] For each grain, based on the similarity between the grain and other grains, the top K other grains with the highest similarity are selected as the neighboring grains of the grain.

[0129] The grain relationship graph is constructed using all grains as nodes and the connections between each grain and its corresponding K neighboring grains as edges.

[0130] Optionally, the apparatus further includes a relationship graph optimization module; the relationship graph optimization module is used for:

[0131] After constructing the grain relationship graph, the edges in the grain relationship graph are filtered using the nearest neighbor constraint, retaining edges where the two nodes constituting the edge are K nearest neighbors, and discarding the remaining edges; and / or,

[0132] Edges in the grain relationship graph are filtered using a distance threshold constraint, eliminating edge connections between two grains whose hyperbolic geodesic distance is greater than or equal to a preset distance threshold; and / or,

[0133] The edges in the grain relationship graph are filtered by using partitioned edge constraints. The graph is partitioned according to the ring zone where the grain is located. Based on a preset number, the target edge connection to be removed is determined from the cross-ring zone edge connections, and the target edge connection is removed.

[0134] Optionally, the feature decoupling is implemented based on a preset feature decoupling model, and the wafer defect detection result is generated based on a preset defect classifier. The preset feature decoupling model and the preset defect classifier are jointly trained through the following steps:

[0135] Obtain a training sample set, wherein each training sample in the training sample set includes the physical coordinates, defect labels, and corresponding environmental variables of each grain sample on the wafer sample;

[0136] Based on the physical coordinates of each grain sample in the training sample set, calculate the hyperbolic representation of each grain sample;

[0137] The hyperbolic graph representation of each grain sample is input into the initial feature decoupling model, and the causal features representing the essential attributes of defects in the grain sample and the environmental features representing production environment factors are decoupled respectively.

[0138] The environmental feature substitution intervention module is invoked. Within the current training batch, the causal features are kept unchanged, and the environmental features of each grain sample are randomly substituted based on the environmental variables of each grain sample to generate counterfactual samples.

[0139] The causal and environmental characteristics of each grain sample, as well as the causal and environmental characteristics of the counterfactual sample after replacement, are input into the initial defect classifier to obtain the corresponding defect judgment results.

[0140] Based on the joint loss function, the network parameters of the initial feature decoupling model and the initial defect classifier are jointly iteratively optimized through backpropagation algorithm until the preset convergence condition is met, thereby obtaining the trained preset feature decoupling model and preset defect classifier. The joint loss function includes a classification loss calculated based on the defect judgment result and the corresponding defect label, a reconstruction loss used to constrain the accuracy of hyperbolic graph representation reconstruction, an independence loss used to constrain the statistical independence of causal features and environmental features, and an intervention consistency loss used to constrain the consistency of defect judgment results between each grain sample and the counterfactual sample.

[0141] Optionally, the preset defect classifier includes a grain-level defect classifier and a wafer-level defect classifier; when the wafer defect detection result includes a grain-level defect determination result and a wafer-level defect determination result, the detection result generation module is used to:

[0142] The causal characteristics of each grain are input into the grain-level defect classifier, and the defect probability and / or defect category of each grain are output as the grain-level defect determination result.

[0143] Graph pooling is performed on the causal features of all grains to obtain wafer-level global features that characterize the defect distribution pattern of the entire wafer. The wafer-level global features are then input into a wafer-level defect classifier to output the wafer-level defect determination result.

[0144] It should be noted that other corresponding descriptions of the functional units involved in the wafer defect detection device provided in this application embodiment can be found by referring to... Figures 1 to 2 The corresponding descriptions in the method will not be repeated here.

[0145] This application also provides a computer device, which may specifically be a personal computer, a server, a network device, etc. Figure 4As shown, the computer device includes a bus, a processor, memory, and a communication interface, and may also include an input / output interface and a display device. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores location information. The network interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.

[0146] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0147] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, having stored thereon a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0148] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0149] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0150] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0151] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0152] The embodiments described above are merely examples of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application.

Claims

1. A method for detecting wafer defects, characterized in that, include: Obtain the physical coordinates of each grain on the wafer, and map the Euclidean coordinates corresponding to the physical coordinates of each grain to a hyperbolic manifold space with negative curvature to obtain the hyperbolic embedding representation of each grain. In the hyperbolic manifold space, the hyperbolic geodesic distance between two grains is calculated based on the hyperbolic embedding representation of each pair of grains, and the similarity between the two grains is calculated based on the hyperbolic geodesic distance. Based on the similarities, a grain relationship diagram is constructed, and according to the grain relationship diagram, feature aggregation processing is performed on each grain to obtain a hyperbolic graph representation of each grain. By decoupling the hyperbolic graph representation of each grain, causal features representing the essential defect properties of the grain are obtained, wherein the causal features are invariant across environments. Based on the causal characteristics of each grain, wafer defect detection results are generated.

2. The method according to claim 1, characterized in that, The process of mapping the Euclidean coordinates corresponding to the physical coordinates of each grain to a hyperbolic manifold space with negative curvature to obtain the hyperbolic embedding representation of each grain includes: A hyperbolic manifold space is constructed using the Poincaré sphere model, wherein the hyperbolic manifold space is an open sphere region used for interior point constraints; For each grain, if the first modulus of the Euclidean coordinate representation of the grain is greater than a preset modulus threshold, the Euclidean coordinate representation of the grain is mapped to the hyperbolic manifold space through exponential mapping to obtain the hyperbolic embedding representation of the grain; otherwise, the hyperbolic embedding representation is set to be equal to the Euclidean coordinate representation of the grain. For each hyperbolic embedding representation, the second modulus of the hyperbolic embedding representation is calculated. When the second modulus is greater than or equal to a preset boundary threshold determined according to the interior point constraint, the hyperbolic embedding point corresponding to the hyperbolic embedding representation is adjusted in the radial direction until the second modulus of the hyperbolic embedding representation corresponding to the adjusted hyperbolic embedding point is reduced to less than the preset boundary threshold, thereby obtaining the final hyperbolic embedding representation of the grain. The radial direction is the direction from the center of the Poincaré sphere model to the location of the hyperbolic embedding point.

3. The method according to claim 2, characterized in that, Before mapping the Euclidean coordinate representation of the grain to the hyperbolic manifold space via exponential mapping, the method further includes: The initial attribute features of each grain are obtained, wherein the initial attribute features include at least one of defect confidence, defect area, grayscale statistics and defect code; The initial attribute features are mapped to the same dimension as the hyperbolic embedding representation using a learnable mapping function to obtain the attribute feature representation; Accordingly, after mapping the Euclidean coordinate representation of the grain to the hyperbolic manifold space via exponential mapping, the method further includes: The attribute feature representation is fused with the hyperbolic embedding representation to obtain a fused hyperbolic embedding representation, and the second modulus is calculated based on the fused hyperbolic embedding representation.

4. The method according to claim 1, characterized in that, The construction of the grain relationship diagram based on each similarity includes: For each grain, based on the similarity between the grain and other grains, the top K other grains with the highest similarity are selected as the neighboring grains of the grain. The grain relationship graph is constructed using all grains as nodes and the connections between each grain and its corresponding K neighboring grains as edges.

5. The method according to claim 4, characterized in that, After constructing the grain relationship diagram, the method further includes: Edges in the grain relationship graph are filtered using a nearest neighbor constraint, retaining edges where the two nodes constituting the edge are K nearest neighbors, and discarding the remaining edges; and / or, Edges in the grain relationship graph are filtered using a distance threshold constraint, eliminating edge connections between two grains whose hyperbolic geodesic distance is greater than or equal to a preset distance threshold; and / or, The edges in the grain relationship graph are filtered by using partitioned edge constraints. The graph is partitioned according to the ring zone where the grain is located. Based on a preset number, the target edge connection to be removed is determined from the cross-ring zone edge connections, and the target edge connection is removed.

6. The method according to claim 1, characterized in that, The feature decoupling is implemented based on a preset feature decoupling model, and the wafer defect detection results are generated based on a preset defect classifier. The preset feature decoupling model and the preset defect classifier are jointly trained through the following steps: Obtain a training sample set, wherein each training sample in the training sample set includes the physical coordinates, defect labels, and corresponding environmental variables of each grain sample on the wafer sample; Based on the physical coordinates of each grain sample in the training sample set, calculate the hyperbolic representation of each grain sample; The hyperbolic graph representation of each grain sample is input into the initial feature decoupling model, and the causal features representing the essential attributes of defects in the grain sample and the environmental features representing production environment factors are decoupled respectively. The environmental feature substitution intervention module is invoked. Within the current training batch, the causal features are kept unchanged, and the environmental features of each grain sample are randomly substituted based on the environmental variables of each grain sample to generate counterfactual samples. The causal and environmental characteristics of each grain sample, as well as the causal and environmental characteristics of the counterfactual sample after replacement, are input into the initial defect classifier to obtain the corresponding defect judgment results. Based on the joint loss function, the network parameters of the initial feature decoupling model and the initial defect classifier are jointly iteratively optimized through backpropagation algorithm until the preset convergence condition is met, thereby obtaining the trained preset feature decoupling model and preset defect classifier. The joint loss function includes a classification loss calculated based on the defect judgment result and the corresponding defect label, a reconstruction loss used to constrain the accuracy of hyperbolic graph representation reconstruction, an independence loss used to constrain the statistical independence of causal features and environmental features, and an intervention consistency loss used to constrain the consistency of defect judgment results between each grain sample and the counterfactual sample.

7. The method according to claim 6, characterized in that, The preset defect classifier includes a grain-level defect classifier and a wafer-level defect classifier; when the wafer defect detection result includes both grain-level defect determination result and wafer-level defect determination result, generating the wafer defect detection result based on the causal characteristics of each grain includes: The causal characteristics of each grain are input into the grain-level defect classifier, and the defect probability and / or defect category of each grain are output as the grain-level defect determination result. Graph pooling is performed on the causal features of all grains to obtain wafer-level global features that characterize the defect distribution pattern of the entire wafer. The wafer-level global features are then input into a wafer-level defect classifier to output the wafer-level defect determination result.

8. A wafer defect detection device, characterized in that, include: The coordinate acquisition module is used to acquire the physical coordinates of each grain on the wafer, and to map the Euclidean coordinate representation corresponding to the physical coordinates of each grain to a hyperbolic manifold space with negative curvature to obtain the hyperbolic embedding representation of each grain. The similarity calculation module is used to calculate the hyperbolic geodesic distance between two grains in the hyperbolic manifold space based on the hyperbolic embedding representation of each pair of grains, and to calculate the similarity between the two grains based on the hyperbolic geodesic distance. The graph characterization determination module is used to construct a grain relationship graph based on each similarity, and perform feature aggregation processing on each grain according to the grain relationship graph to obtain a hyperbolic graph characterization of each grain. The feature decoupling module is used to decouple the hyperbolic graph representation of each grain separately to obtain causal features that characterize the defect essential properties of the grain, wherein the causal features have cross-environment invariance; The detection result generation module is used to generate wafer defect detection results based on the causal characteristics of each grain.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.

10. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.