A method, apparatus, electronic device, and storage medium for wafer defect dicing.
By using frequency domain decomposition and a dual boundary supervision mechanism, the problems of boundary information loss and cross-scale feature fusion conflict in wafer segmentation are solved, and high-precision fine segmentation of target regions and boundaries is achieved.
Patent Information
- Application Number
- CN202611377099.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-17
AI Technical Summary
Existing wafer segmentation techniques suffer from problems such as easy loss of boundary information, cross-scale feature fusion conflicts, and low segmentation accuracy due to sparse boundary supervision when processing discrete mesh structures or fine edge feature images.
Frequency domain decomposition is used to separate subject and boundary features. Combined with soft and hard boundary supervision and boundary reverse guidance semantic aggregation mechanism, the image is separated into low-frequency subject features and multi-directional high-frequency boundary features through frequency domain decomposition. Hard boundary constraints and soft boundary constraints are constructed, and boundary attention weights are generated by boundary probability maps to correct semantic features.
It effectively preserves high-frequency boundary information, alleviates cross-scale fusion conflicts, improves segmentation accuracy, and achieves synchronous and fine segmentation of the target region and the boundary.
Smart Images

Figure CN123118671A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision and image processing technology, specifically to a wafer defect segmentation method, apparatus, electronic device, and storage medium. Background Technology
[0002] In fields such as semiconductor manufacturing, industrial inspection, and medical image analysis, image segmentation with discrete grid structures or fine edge features is a crucial technology. For example, in wafer test image analysis, it is necessary to accurately segment the contours of defective regions to support subsequent yield analysis and process optimization. Existing wafer segmentation technologies typically employ an encoder-decoder architecture, extracting semantic features through downsampling and then combining it with upsampling to restore spatial resolution.
[0003] However, existing technologies still have significant drawbacks when processing such images: First, conventional max pooling or stride convolution directly aggregates local responses during downsampling, causing high-frequency boundary information such as scratches and abrupt edge changes of a single pixel width to be weakened or lost in the early stages, making it difficult for deep decoders to fully recover these discrete structural details; Second, traditional skip connections usually directly concatenate or add shallow and deep features, but while shallow features contain rich boundary details, they also carry a lot of noise, while deep features are semantically stable but have weak boundary responses. This unselective fusion method easily causes conflicts between shallow noise and deep semantics, affecting segmentation accuracy; Third, single-path semantic segmentation networks mainly optimize the consistency within regions and do not adequately constrain the boundary positions that occupy only a small number of pixels. Under conditions of mixed defects, contact between adjacent abnormal regions, and slender structures, it is easy to produce overly smooth boundaries, local omissions, or region adhesion; Finally, a single loss function is difficult to handle the problems of foreground-background imbalance, sparse boundary samples, and slight boundary offsets at the same time. If only hard boundary labels are used, even a small offset of the predicted boundary will lead to unstable training gradients. Therefore, there is an urgent need for a wafer segmentation method that can effectively preserve high-frequency boundary information, alleviate cross-scale fusion conflicts, and provide stable boundary supervision. Summary of the Invention
[0004] To address the problems of easy loss of boundary information, cross-scale feature fusion conflicts, and low segmentation accuracy caused by sparse boundary supervision in existing technologies, this application proposes a wafer defect segmentation method, apparatus, electronic device, and storage medium. It utilizes frequency domain decomposition to separate the subject and boundary features and performs split processing. Combined with soft and hard dual boundary supervision and a boundary reverse-guided semantic aggregation mechanism, it achieves high-precision fine segmentation of the target region and boundary.
[0005] To achieve the above objectives, this application adopts the following technical solution:
[0006] This application provides a wafer defect segmentation method, comprising: acquiring an input image; performing frequency domain decomposition on the input image to obtain low-frequency main features and multi-directional high-frequency boundary features, and inputting the low-frequency main features and the multi-directional high-frequency boundary features into a semantic feature stream and a boundary feature stream, respectively, to obtain multi-scale semantic aggregation features, boundary features, and a boundary probability map; constructing hard boundary constraints based on morphological differences of the target region and contact relationships of adjacent sub-regions, and constructing soft boundary constraints based on positional distance attenuation; generating boundary attention weights based on the boundary probability map and the boundary features, using the boundary attention weights to correct the multi-scale semantic aggregation features to obtain refined semantic features, and generating a target segmentation mask based on the refined semantic features.
[0007] The above scheme decomposes the input image into low-frequency main features and multi-directional high-frequency boundary features in the frequency domain, and injects them into the semantic feature stream and boundary feature stream respectively from the source, avoiding the direct loss of high-frequency boundary information by traditional downsampling operations. By constructing hard boundary constraints that include morphologically different outer contours and contact zones between adjacent sub-regions, and soft boundary constraints based on distance decay, a dual supervision system that takes into account both structural position constraints and smooth gradients is formed, effectively alleviating the problems of sparse boundary samples and offset sensitivity. Furthermore, boundary attention weights are jointly generated using boundary probability maps and boundary features to perform directional correction on multi-scale semantic aggregation features, enabling boundary information to guide in reverse and directly participate in the generation of the final mask, thereby solving the problem of conflict between semantic and boundary feature fusion and achieving simultaneous fine segmentation of the target region and the boundary.
[0008] Optionally, the step of performing frequency domain decomposition on the input image to obtain low-frequency main features and multi-directional high-frequency boundary features, and inputting the low-frequency main features and the multi-directional high-frequency boundary features into the semantic feature stream and the boundary feature stream respectively, includes: performing discrete wavelet transform on the input image to decompose it into low-frequency sub-bands and high-frequency sub-bands in the horizontal, vertical and diagonal directions; inputting the low-frequency sub-bands as the low-frequency main features into the semantic feature stream, and inputting the high-frequency sub-bands in the horizontal, vertical and diagonal directions as the multi-directional high-frequency boundary features into the boundary feature stream.
[0009] Optionally, performing discrete wavelet transform on the input image to decompose it into low-frequency sub-bands and high-frequency sub-bands in the horizontal, vertical, and diagonal directions includes: dividing the input image into low-frequency sub-bands through two-dimensional discrete wavelet decomposition. Horizontal high-frequency subband Vertical high-frequency subband and diagonal high-frequency subband Wavelet decomposition features are obtained by channel splicing. It satisfies the formula:
[0010]
[0011] in, This indicates a splicing operation along the channel dimension;
[0012] For the wavelet decomposition features Channel alignment and local feature fusion are performed to obtain the input features for the next stage. It satisfies the formula:
[0013]
[0014] in, and They represent Convolution operations and Convolution operation, This indicates a batch normalization operation. This represents the activation function.
[0015] Optionally, the step of constructing hard boundary constraints based on the morphological differences of the target region and the contact relationship of adjacent sub-regions, and constructing soft boundary constraints based on positional distance attenuation, includes: obtaining the outer contour boundary based on the morphological differences of the target region, obtaining the contact zone boundary based on the intersection of the expanded adjacent sub-regions, and using the union of the outer contour boundary and the contact zone boundary as the hard boundary constraint; calculating the Euclidean distance from any position to the nearest hard boundary, and generating the soft boundary constraint based on the Euclidean distance and a preset attenuation function.
[0016] Optionally, the hard boundary constraint Satisfying the formula:
[0017]
[0018] in, The outer contour boundary, The adjacent sub-regions are spatially adjacent and the adjacent sub-regions The contact zone boundary is obtained by finding the intersection after each expansion.
[0019] The soft boundary constraint Satisfying the formula:
[0020]
[0021] in, For position Euclidean distance to the nearest hard boundary To preset the variance, This is the preset cutoff distance.
[0022] Optionally, the step of generating boundary attention weights based on the boundary probability map and the boundary features, and using the boundary attention weights to modify the multi-scale semantic aggregation features to obtain refined semantic features, includes: fusing the boundary probability map and the boundary features element-wise, and generating the boundary attention weights through convolutional mapping; using the boundary attention weights to locally reweight the multi-scale semantic aggregation features, and combining them with residual convolutional mapping to obtain the refined semantic features.
[0023] Optionally, the boundary attention weights Satisfying the formula:
[0024]
[0025] in, The boundary probability map, For the boundary feature, This represents element-wise multiplication. For the Sigmoid activation function, for Convolution operation; the refined semantic features Satisfying the formula:
[0026]
[0027] in, The multi-scale semantic aggregation features, This is the residual convolution mapping function.
[0028] Furthermore, this application also provides a wafer defect segmentation device, comprising: an image acquisition module for acquiring an input image; a frequency domain coding module for performing frequency domain decomposition on the input image to obtain low-frequency main features and multi-directional high-frequency boundary features, and inputting the low-frequency main features and the multi-directional high-frequency boundary features into a semantic feature stream and a boundary feature stream respectively to obtain multi-scale semantic aggregation features, boundary features, and a boundary probability map; a boundary supervision construction module for constructing hard boundary constraints based on the morphological differences of the target region and the contact relationship of adjacent sub-regions, and constructing soft boundary constraints based on positional distance attenuation; and a boundary guided aggregation module for generating boundary attention weights based on the boundary probability map and the boundary features, using the boundary attention weights to correct the multi-scale semantic aggregation features to obtain refined semantic features, and generating a target segmentation mask based on the refined semantic features.
[0029] The aforementioned device, through the coordinated operation of its various functional modules, executes the complete process of the aforementioned wafer segmentation method. It can achieve the technical effects of frequency domain feature splitting, dual boundary supervision construction, and boundary-guided semantic refinement at the hardware or software level, ensuring the efficiency and accuracy of image processing.
[0030] In addition, this application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the computer program, when executed by the processor, implements the wafer dicing method as described above.
[0031] In addition, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the wafer dicing method as described above.
[0032] Beneficial effects:
[0033] The wafer defect segmentation method, apparatus, electronic device, and storage medium provided in this application have the following advantages compared to the prior art:
[0034] First, this application effectively solves the problem of boundary information loss during downsampling by using frequency domain decomposition and dual-stream feature processing mechanisms. This application utilizes frequency domain decomposition techniques such as discrete wavelet transform to explicitly separate the input image into low-frequency main features and high-frequency boundary features containing horizontal, vertical, and diagonal directional information, which are then input into the semantic feature stream and the boundary feature stream, respectively. This processing method differs from conventional pooling downsampling; it reduces feature resolution while losslessly preserving boundary responses in different directions, enabling subsequent networks to simultaneously obtain stable semantic information and fine structural information, laying a feature foundation for high-precision segmentation.
[0035] Second, by constructing a dual-boundary supervision system of hard and soft boundaries adapted to the characteristics of discrete grids, the stability and accuracy of boundary learning are significantly improved. Addressing the issue of sparse boundary samples and susceptibility to offset penalties in discrete unit images, this application not only utilizes morphological differencing to extract hard boundaries of the outer contour but also innovatively introduces contact zone boundaries obtained from the dilated intersection of adjacent sub-regions, enhancing the supervision capability for mixed defects or potential cutting positions in adjacent regions. Simultaneously, continuous soft boundary constraints are constructed based on Euclidean distance and a decay function, providing smooth gradient guidance for the model. Hard boundaries ensure the geometric accuracy of the structure, while soft boundaries tolerate minor positioning deviations; the combination of these two effectively alleviates the problems of positive and negative sample imbalance and training oscillations.
[0036] Third, by employing the Boundary-Guided Geometric Aggregation (BGAM) mechanism, the fusion conflict between semantic and boundary features is eliminated, achieving end-to-end fine-grained segmentation. Unlike traditional methods where boundary branches are merely auxiliary tasks or unidirectional gating, this application utilizes boundary probability maps and boundary features to jointly generate boundary attention weights, directly reweighting and correcting residuals for multi-scale semantic aggregation features locally. This mechanism allows boundary information to be injected "backward" into the semantic flow, forcing semantic features to adaptively adjust within the boundary neighborhood. This maintains consistency within the region while accurately outlining the stepped contours and slender structures of the target region, significantly improving the fit between the segmentation mask and the true boundary.
[0037] Fourth, the technical solution of this application has good versatility and scalability. Although this application uses wafer defect segmentation as an example in the embodiments, its core frequency domain current splitting, dual supervision and reverse guidance mechanism is not limited to specific application scenarios. It is also applicable to other image processing tasks with discrete unit states or fine edge features, such as flat panel display array detection, battery array analysis, and medical image segmentation, and has broad application prospects. Attached Figure Description
[0038] Figure 1 This is a schematic flowchart of a wafer defect segmentation method according to an embodiment of this application. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0041] Example 1
[0042] like Figure 1 As shown, this application provides a wafer defect segmentation method, which achieves fine segmentation of the target region through frequency domain feature shunting and boundary reverse guidance mechanisms. Specifically, the wafer segmentation method includes the following steps:
[0043] Step S100: Obtain the input image.
[0044] Specifically, the input image is the raw data carrier to be segmented, and its format is not specifically restricted. For example, the input image can be a raw image directly acquired by an imaging device, a candidate region image obtained by cropping from an upstream detection module, or tensor data after preprocessing operations such as normalization and channel stitching. This embodiment does not limit the source and format of the input image, as long as it contains information about the target region that can be segmented. This step provides the basic data input for subsequent feature extraction and segmentation inference.
[0045] Step S200: Perform frequency domain decomposition on the input image to obtain low-frequency subject features and multi-directional high-frequency boundary features. Input the low-frequency subject features and multi-directional high-frequency boundary features into the semantic feature stream and boundary feature stream, respectively, to obtain multi-scale semantic aggregation features, boundary features, and boundary probability maps.
[0046] Specifically, frequency domain decomposition is a crucial step in transforming an image from the spatial domain to the frequency domain for processing. In the spatial domain, the main body of a target region typically represents a low-frequency signal with gradual grayscale value changes, while edges, textures, and fine structures represent high-frequency signals with dramatic grayscale value changes. Frequency domain decomposition allows for the explicit separation of these two distinctly different types of information. Low-frequency main features retain the overall structure and semantic context information of the target region and are fed into the semantic feature stream for deep semantic encoding and multi-scale aggregation to establish stable region recognition capabilities. Multi-directional high-frequency boundary features contain edge response information in multiple directions, including horizontal, vertical, and diagonal directions, and are fed into a separate boundary feature stream for specialized processing. The design principle of this dual-stream parallel architecture is that traditional downsampling operations (such as max pooling) often irreversibly discard high-frequency details, leading to blurred or broken fine boundaries. This embodiment, through frequency domain decomposition, decouples and separates high- and low-frequency information before reducing resolution, allowing the boundary feature stream to focus on refined modeling of high-frequency information without being interfered with by strong semantic signals in the semantic stream. Ultimately, the semantic feature stream output contains multi-scale semantic aggregation features with rich contextual information, while the boundary feature stream outputs boundary features that characterize edge details and a boundary probability map that reflects the possibility of boundary existence, laying the foundation for subsequent fusion correction.
[0047] Step S300: Construct hard boundary constraints based on the morphological differences of the target region and the contact relationship between adjacent sub-regions, and construct soft boundary constraints based on positional distance attenuation.
[0048] Specifically, to overcome the problems of sparse single-boundary supervision signals and sensitivity to positional shifts, this embodiment constructs a dual-boundary constraint system combining hard and soft constraints. Hard boundary constraints focus on providing precise geometric guidance, consisting of two parts: first, an outer contour boundary obtained based on the morphological differences of the target region, used to define the distinction between the target and the background; second, a contact zone boundary obtained based on the contact relationship between adjacent sub-regions. This boundary is located inside the target region and is specifically designed for scenarios where multiple sub-regions are closely adjacent or adhered, providing potential cutting supervision signals by identifying the contact interfaces between sub-regions, preventing the model from incorrectly merging adjacent independent targets. Soft boundary constraints focus on providing continuous gradient optimization guidance, based on the Euclidean distance from any position to the nearest hard boundary, calculated using a preset decay function. Within the hard boundary neighborhood, soft boundary constraints provide a smooth transition in numerical response, allowing the model to have a certain localization tolerance during training, avoiding gradient oscillations caused by overly strict pixel-level alignment; while in regions far from the hard boundary, soft boundary constraints rapidly decay to zero to reduce ineffective interference to non-boundary regions. Hard boundaries ensure the structural accuracy of the segmentation results, while soft boundaries improve the stability and convergence speed of the training process. The two work together to effectively solve the problem of scarce boundary samples and extreme imbalance of positive and negative samples in discrete grids or fine edge images.
[0049] Step S400: Generate boundary attention weights based on the boundary probability map and boundary features, use the boundary attention weights to correct the multi-scale semantic aggregation features to obtain refined semantic features, and generate a target segmentation mask based on the refined semantic features.
[0050] Specifically, this step embodies the core logic of boundary information guiding semantic aggregation in reverse. In existing technologies, boundary branches are often only used as independent outputs for auxiliary tasks, or the boundary branches are only unidirectionally gated by semantic branches, resulting in boundary information failing to substantially improve semantic segmentation quality. In this embodiment, however, the boundary probability map reflects the confidence in the existence of the boundary, and the boundary features encode the geometric details of the boundary. The two work together to generate boundary attention weights. These weights not only contain location information such as "where is the boundary" but also structural information such as "what the boundary looks like." Using these boundary attention weights to correct multi-scale semantic aggregation features essentially involves adaptively reweighting and enhancing the feature responses in the boundary neighborhood within the semantic feature space, while suppressing noise interference in non-boundary regions. This correction mechanism forces semantic features to actively adapt to the real boundary orientation while maintaining consistency within the region, thereby obtaining refined semantic features that possess both stable semantics and fine contours. Finally, a target segmentation mask is generated based on these refined semantic features, achieving high-precision end-to-end segmentation. It should be understood that although this embodiment describes a specific correction logic, in other embodiments, as long as attention generated jointly by boundary prediction results and boundary features is used to reverse-optimize semantic features, they all fall within the protection scope of this application.
[0051] Through steps S100 to S400, this embodiment establishes a complete closed-loop data processing mechanism of "frequency domain splitting - dual supervision - reverse guidance". This scheme protects high-frequency boundary information from the source, takes into account both structural constraints and gradient smoothing at the supervision level, and achieves substantial semantic correction of the boundary at the fusion level, thereby effectively solving the technical problems of blurred, entangled, and detail-lost target region segmentation boundaries in complex scenarios.
[0052] Example 2
[0053] Building upon Example 1, this example further defines the specific implementation of frequency domain decomposition. Specifically, a discrete wavelet transform is performed on the input image to decompose it into low-frequency subbands and high-frequency subbands in the horizontal, vertical, and diagonal directions. As a time-frequency analysis tool, the discrete wavelet transform, compared to traditional max pooling or stride convolution downsampling, possesses the characteristics of lossless reversibility and multi-resolution analysis. In wafer dicing tasks, conventional downsampling operations often directly discard high-frequency details, leading to blurred or broken fine boundaries. The discrete wavelet transform, however, can explicitly separate the signal into approximate and detail components while reducing the feature space resolution, thus completely preserving boundary response information in different directions and providing a high-quality feature foundation for subsequent two-stream processing.
[0054] Furthermore, the low-frequency sub-bands are input into the semantic feature stream as low-frequency main features, while the high-frequency sub-bands in the horizontal, vertical, and diagonal directions are input into the boundary feature stream as multi-directional high-frequency boundary features. This splitting mechanism ensures that the semantic feature stream focuses on modeling the overall structure and contextual information of the target region, while the boundary feature stream can independently perform fine-grained representation of edges, textures, and fine structures. This avoids the suppression of weak boundary signals by strong semantic signals and solves the problem of decreased segmentation accuracy caused by feature aliasing at its source.
[0055] To more clearly illustrate the above frequency domain decomposition and feature renormalization process, the following explanation uses specific mathematical expressions. The input image is divided into low-frequency sub-bands using two-dimensional discrete wavelet decomposition. Horizontal high-frequency subband Vertical high-frequency subband and diagonal high-frequency subband Wavelet decomposition features are obtained by channel splicing. It satisfies the formula:
[0056]
[0057] in, This indicates a stitching operation along the channel dimension. In this formula, This represents the low-frequency subband, which contains the main energy and subject contour information of the image, corresponding to the aforementioned low-frequency subject features; , and The high-frequency subbands, representing the horizontal, vertical, and diagonal directions respectively, capture edge abrupt changes and texture details in the image in different directions, collectively forming multi-directional high-frequency boundary features. Through channel concatenation, these four subbands are integrated into a unified feature tensor, preserving complete frequency domain information and facilitating unified processing by subsequent network modules.
[0058] Subsequently, wavelet decomposition features Channel alignment and local feature fusion are performed to obtain the input features for the next stage. It satisfies the formula:
[0059]
[0060] in, and They represent Convolution operations and Convolution operation, This indicates a batch normalization operation. This represents the activation function. During this process, Convolution is primarily used for channel alignment and dimensionality compression. Since the number of channels after concatenating four sub-bands is four times that of the original input, directly performing subsequent calculations would incur a huge computational overhead. Convolution can adjust the number of channels to match the next stage of the network, while also enabling cross-channel information exchange. Batch normalization operation. Used to accelerate convergence and stabilize the training process. Activation function Nonlinear transformations are introduced to enhance the network's expressive power. Finally, Convolution is used for local feature fusion, integrating frequency domain information from different sub-bands within a spatial neighborhood, resulting in more efficient and effective input features. It not only contains rich frequency components, but also possesses local spatial correlations, which can better adapt to the feature extraction needs of subsequent semantic flow and boundary flow.
[0061] It should be understood that although this embodiment uses discrete wavelet transform as an example, other transformation methods that can achieve frequency domain separation and retain directional information can also be used in other embodiments. As long as they can decompose the input image into main features and multi-directional boundary features and send them to the corresponding processing streams respectively, they all fall within the protection scope of this application.
[0062] Example 3
[0063] Building upon Example 1, this example further defines the specific construction logic and mathematical expression of the hard and soft dual boundary constraints. Specifically, the outer contour boundary is obtained based on the morphological differences of the target region, and the contact zone boundary is obtained based on the intersection of adjacent sub-regions after expansion. The union of the outer contour boundary and the contact zone boundary is used as the hard boundary constraint. This design aims to solve the problem of difficulty in accurately cutting the adhesion or mixed defects of the target region in discrete mesh images. The outer contour defines the boundary between the overall target and the background, while the contact zone boundary specifically targets spatially adjacent sub-regions (e.g., multiple adjacent failed grains in a wafer image). By performing morphological expansion operations on these adjacent sub-regions and calculating their intersection, the potential interfaces between sub-regions can be explicitly extracted. Incorporating the contact zone into the hard boundary constraint is equivalent to providing the model with an explicit "cutting supervision signal," forcing the model to focus on the separation structure within the region during inference, thereby effectively preventing the erroneous merging of multiple independent targets into a single connected region.
[0064] Furthermore, the Euclidean distance from any position to the nearest hard boundary is calculated, and soft boundary constraints are generated based on the Euclidean distance and a preset decay function. The role of the soft boundary constraints is to provide continuous gradient guidance for model training. Since hard boundaries are usually binary discrete pixel sets, directly using them for loss calculation can easily lead to sparse gradients or violent oscillations when the boundary shifts slightly. By introducing a distance-based decay function, a continuously changing transition band can be constructed within the neighborhood of the hard boundary, allowing the model to still obtain effective optimization feedback within a certain range away from the true boundary, while rapidly reducing weights in regions far from the boundary to reduce interference.
[0065] To more clearly illustrate the mathematical implementation of the aforementioned dual constraints, the following explanation uses specific formulas. Hard boundary constraints Satisfying the formula:
[0066]
[0067] in, The outer contour boundary can usually be obtained by performing an erosion operation on the target region mask and subtracting it from the original mask. Spatially adjacent sub-regions and adjacent sub-regions The contact zone boundary is obtained by intersecting the expansions of each region. This formula shows that the final hard boundary includes not only the outer contour of the target but also the internal contact interfaces between all adjacent sub-regions. This construction method is particularly suitable for wafer dicing tasks with discrete unit cell structures, significantly improving the analytical capability for complex topologies.
[0068] Soft boundary constraints Satisfying the formula:
[0069]
[0070] in, For position Euclidean distance to the nearest hard boundary The preset variance is used to control the decay rate. The preset cutoff distance is used. This formula uses a truncated Gaussian function as the attenuation model, and its physical meaning is: when the position... When located on a hard boundary, The soft boundary value is set to a maximum of 1; as the location moves further away from the boundary, the soft boundary value decreases smoothly according to a Gaussian curve; when the distance exceeds the cutoff threshold... When the soft boundary value is forced to zero, compared to the standard Gaussian function with infinite tails, the truncation design avoids imposing unnecessary constraints on the background region far from the boundary, improving computational efficiency and reducing noise interference. and The specific value can be adaptively adjusted according to the image resolution and target size. For example, in the scenario of wafer defect segmentation, it can be set according to the physical width of a single die to ensure that the coverage of the soft boundary matches the actual positioning tolerance.
[0071] It should be understood that although this embodiment uses erosion difference to obtain the outer contour, dilation intersection to obtain the contact zone, and truncated Gaussian function as examples, in other embodiments, other morphological operators (such as morphological gradients) can be used to construct hard boundaries, or functions such as exponential decay and piecewise linear decay can be used to construct soft boundaries. As long as they can achieve the dual supervision function of "structural constraint + gradient smoothing", they all fall within the protection scope of this application.
[0072] Example 4
[0073] Building upon Example 1, this example further defines the specific implementation of the boundary-guided aggregation mechanism. Specifically, the boundary probability map and boundary features are fused element-wise, and boundary attention weights are generated through convolutional mapping. This step constitutes the key entry point for the reverse injection of boundary information into the semantic flow. Unlike the common practice in existing technologies of using deep semantic features to unidirectionally gate boundary branches, this example uses boundary prediction results to guide the refinement of semantic features, i.e., the data flow direction is "from boundary to semantics". The boundary probability map represents the confidence that each pixel belongs to the boundary, while the boundary features encode the geometric structure and texture details of the edge. After element-wise fusion, both can utilize both positional and structural priors to generate a comprehensive attention signal that includes both "where is the boundary" and "what is the boundary shape". Subsequently, the boundary attention weights are used to locally reweight the multi-scale semantic aggregation features, and combined with residual convolutional mapping, refined semantic features are obtained. This processing method enables semantic features to adaptively adjust their response within the boundary neighborhood while maintaining overall regional consistency, thereby effectively solving the conflict problem caused by the direct splicing of semantic and boundary features in traditional methods.
[0074] To more clearly illustrate the mathematical principles of the boundary-guided aggregation mechanism described above, the following explanation uses specific formulas. Boundary attention weights. Satisfying the formula:
[0075]
[0076] in, For boundary probability plots, For boundary features, This represents element-wise multiplication. For the Sigmoid activation function, for Convolution operation. In this formula, This implements confidence-based feature modulation, the physical meaning of which is that boundary features are only preserved and included in subsequent calculations when the probability of a certain position being judged as a boundary is high, thus effectively suppressing the interference of background noise on attention. The Sigmoid function normalizes the values of the convolution output to the (0, 1) interval, and the subsequent increment operation adjusts the final attention weights. Mapped to the range (1, 2). This design is crucial, as it means that the boundary attention mechanism always behaves as an "enhancement" operation rather than a "suppression" operation. For boundary-related locations, the feature response is moderately amplified (maximum amplification of 2x); for non-boundary locations, the feature response remains at least at its original level (multiplied by 1). This non-suppression enhancement strategy avoids the risk of losing semantic subject information due to insufficient attention weights, ensuring the integrity of the regions inside the segmentation mask.
[0077] Furthermore, refine semantic features Satisfying the formula:
[0078]
[0079] in, For multi-scale semantic aggregation features, Let be the residual convolution mapping function. This formula illustrates a typical residual learning structure. As the main path, it is directly transmitted to the output end, ensuring the lossless flow of basic semantic information; This constitutes the detail enhancement branch. The features of this branch are weighted by boundary attention and then mapped through the residual convolution function. Nonlinear transformation and feature integration are performed. The final output is... In reality, it's the superposition of the original semantic features and the boundary-guided increment. This superposition method allows the model to accurately embed high-frequency boundary details without compromising the original semantic representation capabilities, achieving a smooth transition from "coarse semantics" to "refined semantics." It should be understood that although this embodiment uses element-wise multiplication and additive residuals as examples, other embodiments can also employ methods such as channel attention, spatial-channel joint attention, or multiplicative gating to guide semantics through boundaries. As long as the core logic utilizes boundary prediction information to reverse-correct semantic features, it falls within the scope of this application. Example 5
[0080] This application also provides a wafer defect segmentation device, which corresponds one-to-one with the steps in the method embodiment, and realizes a complete data processing flow for wafer segmentation through a modular architecture. Specifically, the wafer segmentation device includes an image acquisition module, a frequency domain coding module, a boundary supervision construction module, and a boundary guidance aggregation module.
[0081] The image acquisition module is used to acquire input images. Specifically, it serves as the data entry point for the entire device, receiving raw image data to be processed or pre-processed intermediate data. In practical deployments, this module can interface with the output interfaces of various imaging devices, storage systems, or upstream detection units, converting external data into a tensor format recognizable by the device, providing a standardized data foundation for subsequent feature extraction and segmentation inference. The module's design ensures the device's compatibility and adaptability to image data from different sources and with varying specifications.
[0082] The frequency domain coding module performs frequency domain decomposition on the input image to obtain low-frequency subject features and multi-directional high-frequency boundary features. These features are then input into the semantic feature stream and boundary feature stream, respectively, yielding multi-scale semantic aggregation features, boundary features, and a boundary probability map. Specifically, the frequency domain coding module is the core feature extraction unit of the device, integrating a frequency domain transform operator and a dual-stream processing path. During execution, this module first decouples the input image into subject information and detail information through frequency domain decomposition. Then, through a built-in routing mechanism, it directionally transmits the low-frequency components to the semantic feature stream for deep semantic modeling, while directionally transmitting the high-frequency components, containing horizontal, vertical, and diagonal information, to the boundary feature stream for fine-grained structural representation. This hardware or logical splitting design ensures that high-frequency boundary information is independently protected and enhanced from the initial stage of network entry, avoiding the loss of detail caused by traditional downsampling structures. Finally, the module outputs multi-scale aggregation features rich in contextual semantics, boundary features representing edge geometry, and a probability map reflecting boundary confidence, providing multi-dimensional feature support for downstream modules.
[0083] The boundary supervision construction module is used to construct hard boundary constraints based on the morphological differences of the target region and the contact relationships of adjacent sub-regions, and soft boundary constraints based on positional distance decay. Specifically, the boundary supervision construction module is mainly responsible for generating boundary prior information to guide model optimization or constrain inference results. This module calculates hard boundary constraints, including the outer contour and internal contact zone, by analyzing the geometric shape and topological relationships of the target region to provide accurate structural positioning benchmarks; simultaneously, it generates continuously varying soft boundary constraints based on spatial distance calculations to provide smooth gradient optimization guidance. During the training phase, this constraint information directly participates in the calculation of the loss function, forcing the model to learn the correct boundary responses; during the inference phase, the prior knowledge generated by this module can also serve as auxiliary input or post-processing basis to improve the geometric consistency and robustness of the segmentation results.
[0084] The boundary-guided aggregation module generates boundary attention weights based on boundary probability maps and boundary features. These weights are then used to refine multi-scale semantic aggregation features, resulting in detailed semantic features. Finally, a target segmentation mask is generated based on these refined semantic features. Specifically, the boundary-guided aggregation module is the feature fusion and decision output unit of the device. This module receives semantic and boundary features from the frequency domain coding module and, through an internal attention generation mechanism, transforms boundary probabilities and details into a spatially adaptive weight map. This weight map is then used to locally reweight and correct residuals in the semantic features, essentially performing a reverse injection and fine-tuning of semantic information from boundary information within the feature space. This process eliminates potential conflicts arising from direct fusion of semantic and boundary features, ensuring that the final refined semantic features maintain semantic purity within the region while possessing geometric accuracy that closely matches the real boundary. Finally, this module generates a target segmentation mask based on the refined features, completing the end-to-end transformation from the original image to the refined segmentation result.
[0085] Through the collaborative work of the aforementioned modules, the wafer dicing apparatus provided in this embodiment functionally replicates the technical solution of the aforementioned method embodiment, forming a closed-loop processing chain from data acquisition, frequency domain splitting coding, dual boundary supervision construction to boundary-guided semantic aggregation. This modular architecture not only facilitates code encapsulation and maintenance at the software level, but also provides a clear functional division basis for the design of hardware accelerators or dedicated chips, ensuring the reproducibility and scalability of the technical solution on different implementation platforms.
[0086] Example 6
[0087] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, implements the wafer segmentation method described in any of embodiments 1 to 7. Specifically, the memory and the processor can interact and transmit data via a bus or other communication interface. The memory is used to persistently or temporarily store information such as program code, model parameters, input image data, and intermediate calculation results required to implement the wafer segmentation method. Its specific form may include one or more combinations of read-only memory, random access memory, flash memory, and hard disk drive. The processor, as the computing core and control center of the electronic device, can sequentially complete a series of data processing operations, such as acquiring input images, frequency domain decomposition and feature splitting, soft and hard dual boundary constraint construction, boundary attention weight generation, and semantic feature correction, when reading and executing the computer program in the memory, and finally outputs a target segmentation mask. In practical applications, this electronic device can be a general-purpose computer server, personal computer, workstation, or an embedded edge computing device, a dedicated image processing chip, or a smart terminal integrating visual algorithms. Regardless of the hardware form factor, as long as it possesses the ability to store and execute programs, and can run the aforementioned method flow through a processor to achieve the corresponding technical effects, it falls within the protection scope of the electronic device described in this application. This tangible device implementation transforms abstract algorithmic processes into concrete industrial products or information processing tools, providing a direct material carrier for the commercialization of technical solutions.
[0088] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the wafer dicing method described in any of Embodiments 1 to 7. Specifically, a computer-readable storage medium refers to any non-transient tangible medium that can be accessed, read, and from which instructions or data can be obtained by a computer system. For example, the storage medium can be a magnetic storage device (such as a floppy disk, hard disk, magnetic tape), an optical storage device (such as a CD-ROM, DVD, Blu-ray disc), or a semiconductor storage device (such as an EPROM, EEPROM, Flash Memory, USB flash drive, SD card), etc. When the computer program stored on the medium is loaded into a processor and executed, the processor is configured to execute the various steps of the aforementioned wafer dicing method, thereby realizing technical functions such as frequency domain feature splitting, dual boundary supervision, and boundary reverse guidance semantic aggregation. It should be understood that the storage medium itself does not contain the subject performing the actions, but exists as a distribution carrier and solidified form of the technical solution. During network transmission, software licensing, or product delivery, the storage medium enables the wafer dicing method to circulate and be deployed independently, independent of a specific hardware environment. Even if the hardware platform changes subsequently, as long as the processor of the new platform is compatible with and can execute the program on the medium, the technical solution of this application can be reproduced. Therefore, the computer-readable storage medium and method claims constitute a complementary protection system, ensuring comprehensive coverage of the technical solution in different dissemination stages and usage scenarios.
[0089] By implementing the aforementioned electronic devices and computer-readable storage media, this application extends the wafer dicing method from a purely logical process to the level of concrete physical entities and data carriers. This not only improves the dimensions of patent protection, preventing others from evading infringement liability for method patents simply by manufacturing and selling related hardware or distributing software products, but also clarifies the delivery form and operating environment of the technical solution in practical applications, enhancing the stability and enforceability of patent rights.
[0090] Example 7
[0091] Based on the foregoing embodiments, this embodiment further illustrates the application and technical effects of the above-mentioned wafer dicing method in a specific industrial scenario, using fine segmentation of defects in wafer test patterns as an example. It should be understood that this application scenario is merely a specific implementation example of the technical solution of this application and does not constitute a limitation on the scope of protection.
[0092] In this application scenario, the input image specifically refers to candidate region data in a wafer test image. Specifically, after the upstream detection module or rule-based algorithm locates candidate regions containing defects, the system obtains the ROI state matrix and the corresponding coarse support mask for that region, and concatenates them along the channel dimension to form the network's actual input tensor. The ROI state matrix records the test state encoding of each discrete unit within the effective domain of the wafer, while the coarse support mask provides prior location hints for the defect region. This concatenation construction method allows the network to simultaneously utilize precise low-level state information and high-level spatial context guidance, effectively mitigating the misjudgment problem caused by local noise when relying solely on the state matrix. Correspondingly, the target region is the set of defective grains that need fine segmentation, while the discrete unit corresponds to a single grain on the wafer. This discrete mesh structure has significant stepped contours and directional boundary features, which are typical targets of the aforementioned frequency domain decomposition and dual boundary constraint mechanisms.
[0093] To support high-precision training of the model in this scenario, this embodiment employs a three-level joint loss function for optimization. Total Loss Satisfying the formula:
[0094]
[0095] in, The loss is used for the initial semantic mask, which is used to stably establish the location and coverage of the defective subject in the early stages of training; The loss for the boundary probability graph combines the weighted binary cross-entropy loss and the boundary Dice loss, and is specifically optimized for the problem of sparse boundary samples. For the final region mask loss, a combination of Focal Loss and Dice loss is used to alleviate foreground-background imbalance and improve overall segmentation accuracy. , and These are the weight coefficients for the corresponding branch losses. In a specific configuration example, , and The values are 0.4, 0.6, and 1.0 respectively, with the boundary positive sample weight set to 10, and the Focal Loss parameter... , This hierarchical supervision strategy enables the model to be optimized progressively according to the logic of "subject localization - boundary learning - region refinement", ensuring the synergistic functioning of each module.
[0096] Based on the above configuration, validation results on the MixedWM38 V2 fixed test set demonstrate that the method provided in this application achieves excellent segmentation performance. Specific metrics are as follows: Dice coefficient reaches 0.9428, IoU reaches 0.8986, Precision is 0.9477, Recall is 0.9415, BF1@1 reaches 0.9179, BF1@2 reaches 0.9318, and HD95 is 4.975 pixels. The high values of the Dice coefficient and IoU prove the accuracy of the model's coverage of the defective main region; the difference between Precision and Recall is less than 0.01, indicating that the model does not exhibit significant overexpansion or conservative undersegmentation; most importantly, the BF1@1 metric remains above 0.91 even with a strict one-pixel tolerance, directly reflecting the extremely high boundary fit of the segmentation mask after boundary-guided aggregation correction, effectively solving the common problems of overly smooth boundaries and adhesion between adjacent regions in traditional methods. Even under the WDP4 condition with high complexity of mixed defects, the Dice coefficient remains at 0.9259, further verifying the robustness of the scheme in dealing with complex topologies.
[0097] It should be specifically noted that the aforementioned wafer defect segmentation scenarios and related experimental data are only used to verify the feasibility and effectiveness of the technical solution of this application. Those skilled in the art should understand that the core concept of this application lies in solving the segmentation problem of discrete or fine-edge images through frequency domain splitting, dual boundary supervision, and boundary-guided semantic aggregation. Its applicability is not limited to wafer test images. For example, this method can also be applied to other image processing tasks with similar structural features, such as flat panel display array detection, battery array analysis, and cell or tissue segmentation in medical images. As long as the input data has separable subject and boundary features, and the segmentation target has high requirements for boundary accuracy, the method described in this application can be used to achieve high-precision segmentation. Therefore, the above specific application scenarios should not be construed as limiting the scope of protection of this application.
[0098] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. For example, the specific transformation form of frequency domain decomposition, the mathematical expression of soft and hard boundary constraints, the generation logic of attention weights, and the types of application scenarios can all be adaptively adjusted without departing from the core concept of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for wafer defect segmentation, characterized in that, include: Obtain the input image; The input image is decomposed in the frequency domain to obtain low-frequency main features and multi-directional high-frequency boundary features. The low-frequency main features and the multi-directional high-frequency boundary features are then input into the semantic feature stream and the boundary feature stream, respectively, to obtain multi-scale semantic aggregation features, boundary features, and boundary probability maps. Hard boundary constraints are constructed based on the morphological differences of the target region and the contact relationship between adjacent sub-regions, and soft boundary constraints are constructed based on the positional distance attenuation. Based on the boundary probability map and the boundary features, boundary attention weights are generated. The boundary attention weights are used to correct the multi-scale semantic aggregation features to obtain refined semantic features. Based on the refined semantic features, a target segmentation mask is generated.
2. The method according to claim 1, characterized in that, The step of performing frequency domain decomposition on the input image to obtain low-frequency subject features and multi-directional high-frequency boundary features, and then inputting the low-frequency subject features and the multi-directional high-frequency boundary features into the semantic feature stream and the boundary feature stream, respectively, includes: The input image is subjected to discrete wavelet transform to decompose it into low-frequency sub-bands and high-frequency sub-bands in the horizontal, vertical and diagonal directions; The low-frequency sub-bands are input into the semantic feature stream as the low-frequency main features, and the high-frequency sub-bands in the horizontal, vertical and diagonal directions are input into the boundary feature stream as the multi-directional high-frequency boundary features.
3. The method according to claim 2, characterized in that, The step of performing discrete wavelet transform on the input image to decompose it into low-frequency sub-bands and high-frequency sub-bands in the horizontal, vertical, and diagonal directions includes: The input image is divided into low-frequency sub-bands using two-dimensional discrete wavelet decomposition. Horizontal high-frequency subband Vertical high-frequency subband and diagonal high-frequency subband Wavelet decomposition features are obtained by channel splicing. It satisfies the formula: in, This indicates a splicing operation along the channel dimension; For the wavelet decomposition features Channel alignment and local feature fusion are performed to obtain the input features for the next stage. It satisfies the formula: in, and They represent Convolution operations and Convolution operation, This indicates a batch normalization operation. This represents the activation function.
4. The method according to claim 1, characterized in that, The construction of hard boundary constraints based on morphological differences of the target region and contact relationships between adjacent sub-regions, and the construction of soft boundary constraints based on location distance attenuation, includes: The outer contour boundary is obtained based on the morphological differences of the target region, and the contact zone boundary is obtained based on the intersection of the adjacent sub-regions after expansion. The union of the outer contour boundary and the contact zone boundary is used as the hard boundary constraint. Calculate the Euclidean distance from any position to the nearest hard boundary, and generate the soft boundary constraint based on the Euclidean distance and a preset decay function.
5. The method according to claim 4, characterized in that, The hard boundary constraint Satisfying the formula: in, The outer contour boundary, The adjacent sub-regions are spatially adjacent and the adjacent sub-regions The contact zone boundary is obtained by finding the intersection after each expansion. The soft boundary constraint Satisfying the formula: in, For position Euclidean distance to the nearest hard boundary To preset the variance, This is the preset cutoff distance.
6. The method according to claim 1, characterized in that, The step of generating boundary attention weights based on the boundary probability map and the boundary features, and using the boundary attention weights to refine the multi-scale semantic aggregation features to obtain refined semantic features, includes: The boundary probability map and the boundary features are fused element-wise, and the boundary attention weights are generated by convolutional mapping. The multi-scale semantic aggregation features are locally reweighted using the boundary attention weights, and the refined semantic features are obtained by combining residual convolution mapping.
7. The method according to claim 6, characterized in that, The boundary attention weight Satisfying the formula: in, The boundary probability map, For the boundary feature, This represents element-wise multiplication. The Sigmoid activation function is used. for Convolution operation; the refined semantic features Satisfying the formula: in, The multi-scale semantic aggregation features, This is the residual convolution mapping function.
8. A wafer defect dicing device, characterized in that, include: The image acquisition module is used to acquire the input image; The frequency domain coding module is used to perform frequency domain decomposition on the input image to obtain low-frequency main features and multi-directional high-frequency boundary features. The low-frequency main features and the multi-directional high-frequency boundary features are then input into the semantic feature stream and the boundary feature stream, respectively, to obtain multi-scale semantic aggregation features, boundary features, and boundary probability maps. The boundary supervision construction module is used to construct hard boundary constraints based on the morphological differences of the target region and the contact relationship of adjacent sub-regions, and to construct soft boundary constraints based on location distance attenuation. The boundary-guided aggregation module is used to generate boundary attention weights based on the boundary probability map and the boundary features, use the boundary attention weights to correct the multi-scale semantic aggregation features to obtain refined semantic features, and generate a target segmentation mask based on the refined semantic features.
9. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program thereon, which, when executed by a processor, implements the method as described in any one of claims 1 to 7.
