Wafer detection method and detection device using image recognition

By identifying the periodic diffraction interference characteristics of the wafer surface, separating and extracting the spatial spectrum and lattice structure periodic characteristics, and eliminating lattice periodic interference, accurate identification and classification of wafer defects are achieved, improving the accuracy of detection and production efficiency.

CN122244524APending Publication Date: 2026-06-19ZHEJIANG LISHUI XIN WAFER SEMICON TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG LISHUI XIN WAFER SEMICON TECH CO LTD
Filing Date
2026-03-23
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing image recognition methods struggle to accurately distinguish between periodic diffraction interference caused by lattice structures and real defects in wafer inspection, making it difficult to eliminate false defects and affecting inspection accuracy.

Method used

By acquiring wafer surface images, periodic diffraction interference features are identified, spatial spectrum and lattice structure periodic characteristics are separated and extracted, spectral abnormal regions are identified, lattice periodic interference is eliminated, defect classification and identification are performed, and real defect distribution data are generated.

🎯Benefits of technology

It improves the accuracy and reliability of wafer inspection, reduces the false alarm rate, provides accurate defect classification information, and supports yield analysis and defect source tracing in wafer production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122244524A_ABST
    Figure CN122244524A_ABST
Patent Text Reader

Abstract

This invention discloses a wafer inspection method and device using image recognition, specifically relating to the field of wafer inspection technology. It generates an initial wafer image by identifying periodic diffraction interference features in a wafer surface image; converts the initial wafer image into spatial spectral distribution data and lattice structure periodic distribution data; identifies spectral anomalies and judges lattice periodic intensity to obtain a distribution map of suspected real defects and a distribution map of periodic interference regions in the lattice structure; performs regional difference matching between the distribution map of suspected real defects and the distribution map of periodic interference regions in the lattice structure under a unified pixel coordinate system to obtain the real defect distribution data after interference elimination; and performs defect classification and identification based on the real defect distribution data, outputting the wafer defect detection result, thereby achieving effective separation and classification of real defect regions and periodic interference regions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wafer inspection technology, and more specifically, to a wafer inspection method and apparatus employing image recognition. Background Technology

[0002] In the process of semiconductor wafer surface defect detection, image recognition is usually used to inspect the wafer surface in order to discover various defects in the wafer manufacturing process.

[0003] Because the lattice structure of a wafer is prone to periodic diffraction interference during optical inspection, the signal of the wafer exhibits similar characteristics to that of a real defect in the image. This results in a large number of false defects that are difficult to distinguish accurately during the inspection process, making it difficult for existing image recognition and inspection methods to effectively identify and classify real defects on the wafer surface. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a wafer inspection method and inspection device using image recognition to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: A wafer inspection method using image recognition includes the following steps: S1: Acquire a wafer surface image, identify periodic diffraction interference features in the wafer surface image, and output an initial wafer image with diffraction interference markers; S2: Separate and extract the spatial spectral features in the initial wafer image and detect and identify the periodic characteristics of the lattice structure in the initial wafer image to obtain spatial spectral distribution data and lattice structure periodic distribution data; S3: Identify spectral anomalies in the spatial spectrum distribution data, extract the spectral anomaly regions corresponding to the real defects, and output a distribution map of the suspected real defect regions. S4: Determine the periodic intensity of the lattice periodic distribution data, identify the periodic location of the false defect distribution, and output the distribution map of the periodic interference region of the lattice structure. S5: Integrate the distribution map of suspected real defects with the distribution map of lattice structure periodic interference regions, eliminate false defects in the lattice periodic interference regions through regional difference matching, and output the real defect distribution data after interference elimination; S6: Based on real defect distribution data, perform defect classification and identification, and output wafer defect detection results.

[0006] In a preferred embodiment, S1 specifically refers to: The wafer surface to be inspected is coaxially illuminated, and multiple frames of original images of the wafer surface are acquired in a predetermined angle sequence. Each frame of the original wafer surface image is preprocessed to obtain a preprocessed wafer surface image. The preprocessed wafer surface image is frequency domain transformed, and the diffraction interference spectrum components that meet the requirements of periodic diffraction characteristics are extracted. The diffraction interference spectral components are mapped to the spatial domain through inverse frequency domain transformation to form a periodic diffraction interference feature mask. The periodic diffraction interference feature mask image is superimposed and marked with the preprocessed wafer surface image at the pixel level to generate an initial wafer image with diffraction interference markings.

[0007] In a preferred embodiment, S2 specifically refers to: A two-dimensional grayscale matrix is ​​constructed based on the initial image of the wafer according to a predetermined spatial sampling interval; The initial spatial spectrum data corresponding to the initial image of the wafer is obtained by performing a fast Fourier transform on the two-dimensional gray matrix. Based on the initial spatial spectrum data, frequency components with amplitudes greater than a preset amplitude threshold are extracted to form spatial spectrum distribution data; The spatial spectrum distribution data is rearranged in polar coordinates according to the frequency radius and frequency angle to obtain the frequency distribution curve; The set of periodic frequency points of the crystal lattice is extracted based on the frequency distribution curve and converted into periodic distribution data of the crystal structure.

[0008] In a preferred embodiment, S3 specifically refers to: Based on spatial spectrum distribution data, multiple frequency band regions are divided according to frequency radius; Within each frequency band region, the spatial spectrum distribution data is segmented according to a preset amplitude threshold to obtain a set of frequency points that meet the abnormal conditions. By marking the connected components of the frequency point set, multiple spectral anomaly regions are obtained; For each spectral anomaly region, a reverse mapping is performed according to the correspondence between frequency coordinates and spatial coordinates to generate a spatial location mask map of the spectral anomaly region in the initial wafer image. The spatial location mask image is superimposed on the initial wafer image according to pixel coordinates to generate a distribution map of suspected defect areas.

[0009] In a preferred embodiment, S4 specifically refers to: A polar coordinate lattice periodic diagram was established based on the periodic distribution data of the lattice structure. The mean amplitude is calculated for each frequency radius position in the polar coordinate lattice periodic diagram, and the amplitude intensity is filtered to obtain the set of frequency radii that satisfy the periodic intensity condition. In each set of frequency radii, local maxima of amplitude are extracted in ascending order of frequency angle to form a set of periodic extreme points; The periodicity of the set of periodic extreme points is judged according to the frequency angle interval, and the set of lattice periodic frequency points is obtained by screening. The set of lattice periodic frequency points is mapped onto the spatial domain of the initial image of the wafer to generate a distribution map of the periodic interference region of the lattice structure.

[0010] In a preferred embodiment, S5 specifically refers to: The distribution map of suspected real defect regions is aligned with the distribution map of periodic interference regions of crystal structure to establish a unified pixel coordinate system and generate a binary mask. Perform a difference operation on the binary mask, delete pixels with a mask value of zero that overlap with the distribution map of the actual suspected defect area, and obtain the first difference image; Connected component marking is performed on the first difference image, and connected components with areas greater than a preset area threshold are extracted to generate the second difference image. The third difference image is obtained by performing morphological closing and hole filling operations on the second difference image; The true defect distribution data after eliminating interference is generated based on the set of pixel coordinates of connected components in the third difference image.

[0011] In a preferred embodiment, S6 specifically refers to: Extract the pixel coordinates of the boundary contour of each connected component in the real defect distribution data; The geometric and grayscale feature parameters of each connected component are calculated based on the pixel coordinates of the boundary contour of the connected component, and combined into a feature vector for defect classification. The feature vectors are matched with the standard feature vectors of various types of defects in a pre-built wafer defect classification database based on similarity. Based on the similarity matching results, determine the defect type corresponding to each connected component and label the defect type of each connected component. Wafer defect detection results are generated based on the spatial distribution of connected components with defect type labels on the initial wafer image.

[0012] On the other hand, the present invention provides a wafer inspection device employing image recognition, comprising: a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement a wafer inspection method employing image recognition.

[0013] The technical effects and advantages of the wafer inspection method and device using image recognition of the present invention are as follows: This method identifies and marks periodic diffraction interference features in wafer surface images, pre-eliminating stable false defect signals generated by lattice structure diffraction to ensure that only real defects are processed. By separating and extracting spatial spectral distribution data and lattice structure periodic distribution data, dual characterization of spectral features and lattice periodicity is achieved, providing a physical basis for distinguishing between false and real defects. Anomaly point identification in the spectral anomaly points allows for the localization of spectral anomaly regions corresponding to real defects, effectively extracting suspected areas of real defects and improving the defect detection rate. Lattice periodicity intensity judgment identifies lattice periodic interference regions, enabling accurate identification and localization of periodic false defects and reducing false alarm rates. Pixel-level difference matching between suspected real defect regions and periodic interference regions effectively eliminates residual false defects, obtaining interference-free real defect distribution data, significantly improving the accuracy and reliability of detection results. Classification and identification of the interference-free real defect distribution data allows for defect type labeling and provides classification statistics, providing precise data support for yield analysis and defect source tracing in the wafer manufacturing process, improving the accuracy and production efficiency of wafer surface defect detection. Attached Figure Description

[0014] Figure 1 This is a schematic diagram of a wafer inspection method using image recognition according to the present invention. Detailed Implementation

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

[0016] Figure 1 This invention provides a wafer inspection method using image recognition, which includes the following steps: S1: Acquire a wafer surface image, identify periodic diffraction interference features in the wafer surface image, and output an initial wafer image with diffraction interference markers; S2: Separate and extract the spatial spectral features in the initial wafer image and detect and identify the periodic characteristics of the lattice structure in the initial wafer image to obtain spatial spectral distribution data and lattice structure periodic distribution data; S3: Identify spectral anomalies in the spatial spectrum distribution data, extract the spectral anomaly regions corresponding to the real defects, and output a distribution map of the suspected real defect regions. S4: Determine the periodic intensity of the lattice periodic distribution data, identify the periodic location of the false defect distribution, and output the distribution map of the periodic interference region of the lattice structure. S5: Integrate the distribution map of suspected real defects with the distribution map of lattice structure periodic interference regions, eliminate false defects in the lattice periodic interference regions through regional difference matching, and output the real defect distribution data after interference elimination; S6: Based on real defect distribution data, perform defect classification and identification, and output wafer defect detection results.

[0017] Specifically, S1: Acquire a wafer surface image, identify periodic diffraction interference features in the wafer surface image, and output an initial wafer image with diffraction interference markers, including: The wafer surface to be inspected is coaxially illuminated, and multiple frames of original images of the wafer surface are acquired in a predetermined angle sequence. The system comprises a multi-wavelength parallel light source, an image acquisition device, and a wafer turntable. The multi-wavelength parallel light source consists of several narrowband semiconductor light sources with different wavelengths. Each narrowband semiconductor light source forms an approximately parallel beam through a collimating lens assembly. The optical axis of the multi-wavelength parallel light source coincides with the optical axis of the image acquisition device to form a coaxial illumination structure. The wafer turntable is used to place the wafer to be inspected. The rotation axis of the wafer turntable coincides with the optical axes of the multi-wavelength parallel light source and the image acquisition device to ensure that the surface of the wafer to be inspected maintains a fixed angle relationship with the imaging plane of the image acquisition device. The wavelength selection of the multi-wavelength parallel light source is determined based on the reflection characteristic curve of the material used in the wafer's process. For example, three to five narrowband light sources with wavelengths distributed at different peak reflection positions are selected in the visible and near-infrared bands. The reflection intensity distribution of each wavelength on a typical sample is measured experimentally, and the wavelength combination that highlights the periodic diffraction characteristics of the crystal structure is selected as the working wavelength combination of the multi-wavelength parallel light source. The rotation angle step interval of the wafer turntable is set according to the range of wafer orientation changes and angle resolution to be covered in one acquisition process. For example, 360 degrees is divided into 72 equal parts to obtain a step angle of 5 degrees, and an image acquisition is performed at each step angle position to obtain multiple frames of original images of the wafer surface.

[0018] Multi-wavelength parallel light sources provide coaxial illumination to the surface of the wafer under inspection according to a predetermined illumination strategy. A sequential illumination strategy is employed: first, the first wavelength light source is illuminated, and the wafer turntable rotates at a constant angular velocity from an initial angle. At each predetermined angular position, an image acquisition device captures a frame of the original wafer surface image. After one rotation, the first wavelength light source is turned off, and the other wavelength light sources are illuminated sequentially, repeating the acquisition process. The image acquisition device is an industrial camera with a fixed focal length; for example, the resolution can be set to 4096×4096 pixels, and the exposure time can be set between 0.5 milliseconds and 10 milliseconds.

[0019] Each frame of the original wafer surface image is preprocessed to obtain a preprocessed wafer surface image. Preprocessing includes grayscale conversion, brightness equalization, and background noise suppression. First, grayscale conversion is performed. If the image acquisition device captures a color image, the red, green, and blue channels are converted to a single-channel grayscale image using a weighted average. The weights are set according to the human eye's sensitivity to different colors; for example, the red channel weight is set to 0.299, the green channel weight to 0.587, and the blue channel weight to 0.114, thus obtaining the grayscale value for each pixel. If the image acquisition device directly outputs a single-channel grayscale image, the grayscale value output by the image acquisition device is directly used as the grayscale result. After grayscale conversion, brightness equalization is performed on the grayscale image. Brightness equalization uses a histogram-based grayscale mapping method. By statistically analyzing the grayscale histogram of the entire grayscale image, the pixel grayscale value distribution is compressed or stretched to a predetermined grayscale range, for example, remapping the grayscale values ​​to the range of 0 to 255.

[0020] After brightness equalization, background noise suppression is performed. Background noise suppression is done through spatial domain filtering. Spatial domain filtering can use median filtering or mean filtering to operate on the neighborhood of each pixel. For example, a 3×3 or 5×5 window can be slid across the entire image, and median or mean operations can be performed on the pixel values ​​within each window. The result is then used as the new grayscale value of the center pixel of the window. Through grayscale processing, brightness equalization, and background noise suppression, a preprocessed wafer surface image is obtained for each frame of the original wafer surface image.

[0021] The preprocessed wafer surface image is frequency domain transformed, and the diffraction interference spectrum components that meet the requirements of periodic diffraction characteristics are extracted. The frequency domain transformation employs a two-dimensional discrete Fourier transform (DFT) to convert the spatial coordinates and grayscale values ​​of each pixel in the preprocessed wafer surface image into frequency coordinates and complex spectral values. The preprocessed wafer surface image is treated as a two-dimensional matrix, where each element corresponds to the grayscale value of a pixel, and a fast Fourier transform (FFT) algorithm is applied. The frequency domain data output by the transformation is a complex matrix of the same size as the preprocessed wafer surface image, where each element contains amplitude and phase information. The frequency domain amplitude distribution data is composed of the complex modulus of each element in the complex matrix. The corresponding amplitude is obtained by calculating the square root of the sum of the squares of each complex element, thus forming the frequency domain amplitude distribution data matrix. To facilitate the extraction of diffraction interference spectral components based on frequency spacing and directional consistency conditions, the frequency domain amplitude distribution data undergoes a spectral center shift, moving the low-frequency components originally located at the four corners of the matrix to the center, allowing the frequency radius to be calculated using the distance to the matrix center.

[0022] In the frequency domain amplitude distribution data, diffraction interference spectrum components that meet the requirements of periodic diffraction characteristics are extracted based on frequency interval and directional consistency conditions. The frequency interval condition constrains the selected frequency points to maintain a near-integer multiple interval relationship along the frequency radius direction. For example, a set of candidate frequency radius intervals is selected, and the corresponding frequency radius value in the frequency domain is calculated by analyzing the theoretical period of the lattice structure in the wafer fabrication process. A frequency radius window is then constructed in the frequency domain amplitude distribution data based on the frequency radius value. The width of the frequency radius window can be set to 5% to 20% of the target frequency radius value based on experience or pre-experiment results. The directional consistency condition constrains the selected frequency points to be arranged along one or more fixed directions along the frequency angle direction. For example, in the frequency plane, a sector region can be divided with the spectral center as the center and several different angle directions. The amplitude distribution within each sector region is statistically analyzed, and the angle direction that simultaneously has a high amplitude in multiple frequency radius windows is selected as the directional consistency direction. The set of frequency points that meet the frequency spacing and direction consistency conditions is marked as the set of diffraction interference spectrum components. The corresponding spectral amplitude is retained in the frequency domain amplitude distribution data, and the amplitude at other frequency positions can be set to zero to form diffraction interference spectrum components.

[0023] The diffraction interference spectral components are mapped to the spatial domain through inverse frequency domain transformation to form a periodic diffraction interference feature mask. The inverse frequency domain transformation employs a two-dimensional discrete Fourier inverse transform corresponding to the frequency domain transformation. It takes a spectral matrix containing only diffraction interference spectral components as input and generates a spatial domain grayscale distribution by performing exponential and summative operations on the complex values ​​at each frequency position. Since only diffraction interference spectral components are retained, the spatial domain image output by the inverse frequency domain transformation mainly exhibits stripes, spots, or periodic textures caused by periodic diffraction interference. To transform the spatial domain grayscale image output by the inverse frequency domain transformation into a periodic diffraction interference feature mask for marking diffraction interference locations, the spatial domain grayscale image is binarized. By setting a grayscale threshold, pixels with grayscale values ​​higher than the threshold are marked as diffraction interference pixels, and pixels with grayscale values ​​lower than the threshold are marked as non-diffraction interference pixels. The grayscale threshold is determined by analyzing the spatial domain grayscale histogram; for example, the valley between the second peak and the first peak in the histogram is selected as the grayscale threshold, thus obtaining the periodic diffraction interference feature mask.

[0024] The periodic diffraction interference feature mask image is superimposed and marked with the preprocessed wafer surface image at the pixel level to generate an initial wafer image with diffraction interference markings. The pixel-level overlay marking process first ensures that the periodic diffraction interference feature mask and the preprocessed wafer surface image have the same image size and pixel coordinate range. If the image size was cropped or padded in the previous frequency domain processing stage, it is restored to the same size as the preprocessed wafer surface image through interpolation or cropping operations before and after the inverse frequency domain conversion. At each pixel coordinate position, the mask value of the periodic diffraction interference feature mask and the grayscale value of the preprocessed wafer surface image are read. If the mask value represents a marker value for a diffraction interference pixel, a diffraction interference marker is overlaid at the corresponding position in the initial wafer image. For example, in a grayscale image, the pixel grayscale value is replaced with a preset high grayscale value, or in a pseudo-color display, a specific color is used to represent the pixel as a diffraction interference marker pixel. If the mask value is a non-diffraction interference pixel marker value, the original grayscale value of the preprocessed wafer surface image remains unchanged in the initial wafer image. By performing the above operations on all pixels in the entire image, an initial wafer image with diffraction interference markers is obtained.

[0025] Specifically, S2: Separating and extracting the spatial spectral features in the initial wafer image and detecting and identifying the periodic characteristics of the lattice structure in the initial wafer image, obtaining spatial spectral distribution data and lattice structure periodic distribution data, including: A two-dimensional grayscale matrix is ​​constructed based on the initial image of the wafer according to a predetermined spatial sampling interval; The initial image of the wafer is a digital image arranged in rows and columns, with each pixel position corresponding to a grayscale value. Constructing the two-dimensional grayscale matrix involves mapping the row and column coordinates of each pixel in the initial wafer image to row and column indices in the two-dimensional grayscale matrix according to the resolution of the image acquisition device and the pixel arrangement, and writing the corresponding grayscale value of the pixel at the corresponding position in the two-dimensional grayscale matrix. The predetermined spatial sampling interval is determined by the imaging parameters of the image acquisition device. For example, if the physical size of a single pixel in the image acquisition device is 2 micrometers and the magnification of the imaging optical system is 2x, then the spatial size of the pixel on the wafer surface is 1 micrometer, and the predetermined spatial sampling interval is defined as 1 micrometer.

[0026] The initial spatial spectrum data corresponding to the initial image of the wafer is obtained by performing a fast Fourier transform on the two-dimensional gray matrix. The two-dimensional discrete Fourier transform (DFT) takes a two-dimensional grayscale matrix as input and converts the grayscale value at each spatial location into a complex spectral value in the frequency domain. The output of the fast Fourier transform (FFT) is a two-dimensional complex matrix, where each complex element contains amplitude and phase information. The row and column indices in the two-dimensional complex matrix map to the horizontal and vertical frequencies, respectively. The initial spatial spectrum data refers to the amplitude distribution data calculated from the two-dimensional complex matrix. The corresponding spectral amplitude can be obtained by taking the square root of the sum of the squares of the real and imaginary parts of each complex element. All spectral amplitudes are arranged according to their original row and column indices to form the initial spatial spectrum data matrix. To facilitate polar coordinate rearrangement according to frequency radius and frequency angle, a spectral center shift is performed on the initial spatial spectrum data matrix, moving the zero-frequency component to the center of the matrix.

[0027] Based on the initial spatial spectrum data, frequency components with amplitudes greater than a preset amplitude threshold are extracted to form spatial spectrum distribution data; The initial spatial spectrum data is divided into multiple frequency sub-bands according to a predetermined frequency bandwidth. Frequency sub-band division is based on the frequency radius, which is the Euclidean distance from any point on the frequency plane to the zero-frequency center point. The maximum value of the frequency radius is determined by the sampling interval and image size. Frequency sub-band division determines the range of frequency radius values; for example, the minimum frequency radius is 0, corresponding to the zero-frequency component, and the maximum frequency radius is Rmax, corresponding to the corner position of the frequency plane. The range from 0 to Rmax is divided into several non-overlapping intervals, each corresponding to a frequency sub-band. The number of intervals can be selected based on target resolution and computational resources; for example, it can be divided into 16, 32, or more frequency sub-bands. The frequency bandwidth is the length of the frequency radius interval corresponding to each frequency sub-band. For example, when Rmax is divided into 32 equal segments, the frequency bandwidth of each frequency sub-band can be Rmax divided by 32. After the frequency sub-bands are determined, each frequency point in the initial spatial spectrum data matrix is ​​assigned to its corresponding frequency sub-band according to its frequency radius.

[0028] To extract frequency components with amplitudes greater than a preset amplitude threshold within each frequency sub-band, the preset amplitude threshold needs to be determined. This threshold is obtained by statistically analyzing the amplitude distribution of all frequency points within each sub-band. For example, within a sub-band, the average and standard deviation of the amplitudes at all frequency points are calculated, and the preset amplitude threshold is determined by adding a certain multiple of the standard deviation to the average. This multiple parameter is adjusted experimentally. For instance, the preset amplitude threshold can be defined as the average amplitude within the frequency sub-band plus twice the standard deviation. For each frequency point within a sub-band, if the corresponding amplitude is greater than the preset amplitude threshold, the frequency point is marked as a valid frequency component, and the corresponding amplitude is retained in the spatial spectrum distribution data. If the corresponding amplitude is less than or equal to the preset amplitude threshold, the corresponding amplitude is set to zero in the spatial spectrum distribution data. After processing all frequency sub-bands, the spatial spectrum distribution data forms a new two-dimensional matrix. The row and column indices of this two-dimensional matrix are consistent with the initial spatial spectrum data matrix, retaining larger amplitude values ​​at frequency points that meet the amplitude criteria.

[0029] The spatial spectrum distribution data is rearranged in polar coordinates according to the frequency radius and frequency angle to obtain the frequency distribution curve; Polar coordinate rearrangement requires establishing a correspondence from the Cartesian coordinate system to the polar coordinate system. The spatial spectral distribution data is a matrix representing the frequency point positions using row and column indices. The center of the matrix is ​​considered the zero-frequency point. For each frequency point, the horizontal and vertical displacements relative to the zero-frequency point are calculated to obtain the Cartesian coordinates. The frequency radius is calculated by taking the square root of the sum of the squares of the horizontal and vertical displacements. The frequency angle is obtained by calculating the ratio of the vertical to horizontal displacements using the arctangent function. To form a regular polar coordinate grid, discrete frequency radius sampling points are set in the frequency radius direction, and discrete frequency angle sampling points are set in the frequency angle direction. The frequency radius sampling points are evenly distributed at fixed intervals between 0 and Rmax, for example, an interval of Rmax divided by N, where N can be an integer such as 128 or 256. The frequency angle sampling points can be evenly arranged within the range of 0 degrees to 360 degrees, for example, one frequency angle sampling point can be set every 1 degree, 2 degrees, or 5 degrees.

[0030] For each frequency radius sampling point and each frequency angle sampling point, a corresponding neighborhood region is determined. This neighborhood region contains multiple frequency points from the original spatial spectrum distribution data. A weighted average is used to summarize the amplitudes of the frequency points within the neighborhood into polar coordinate amplitudes corresponding to the frequency radius and frequency angle sampling points. For example, a weighted average method can be used, assigning weights based on the distance between the frequency points in the neighborhood and the target polar coordinate position; closer frequencies have higher weights. By performing a mapping operation on all frequency radius and frequency angle sampling points, a set of frequency distribution curves is obtained, with the frequency radius as the horizontal axis and the amplitude as the vertical axis, categorized by different frequency angles. Each frequency distribution curve corresponds to a fixed frequency angle, and each point on the curve represents the amplitude at a specific frequency radius position within that frequency angle.

[0031] The set of periodic frequency points of the crystal lattice is extracted based on the frequency distribution curve and converted into periodic distribution data of the crystal structure. A set of periodic frequency points of the crystal lattice is extracted from the frequency distribution curve according to predetermined frequency interval and amplitude variation conditions. The frequency interval condition is used to reflect the repetitive periodic relationship of the crystal structure in the frequency domain. The crystal structure exhibits a periodic distribution in the spatial domain and forms nearly equally spaced spectral lines in the frequency domain. Local peak points are searched on each frequency distribution curve, and the frequency radius difference between adjacent peak points is analyzed. Local peak points are determined by comparing the amplitude of a frequency radius position with the amplitudes of several frequency radius positions before and after it. For example, by scanning with a sliding window of fixed length along the frequency radius direction, if the amplitude at the center of the window is greater than the amplitudes at other positions in the window and greater than the local amplitude threshold, then the center of the window is marked as a local peak point. The local amplitude threshold is determined by the average amplitude or median of each frequency distribution curve. For example, the average value plus half the standard deviation is selected as the local amplitude threshold.

[0032] After obtaining the sequence of local peak points, the interval between adjacent local peak points along the frequency radius is calculated and compared with the predicted interval of the theoretical lattice period in the frequency domain. The predicted interval of the theoretical lattice period in the frequency domain is derived through wafer process parameters, such as using the reciprocal of the lattice constant as the reference frequency. The position corresponding to the reference frequency in the discrete frequency radius coordinates is used as a reference to find the actual peak. The frequency interval condition is set such that the difference in frequency radii between adjacent local peak points is within the tolerance range of the theoretical interval, for example, the tolerance range is set to ±20% of the theoretical interval.

[0033] The amplitude variation trend among multiple peak points on the frequency distribution curve conforms to the characteristics of lattice diffraction. For example, the amplitude of the first-order peak is greater than that of the second-order peak, the amplitude of the second-order peak is greater than that of the third-order peak, or the peak amplitude gradually decreases with increasing frequency radius. The amplitude variation condition is determined by comparing the amplitude ratio between adjacent peaks; for example, the ratio of the amplitudes of two adjacent peaks should be between 0.3 and 1. Combining the frequency interval condition and the amplitude variation condition, a set of frequency points that satisfy the periodicity characteristics of the lattice are selected from each frequency distribution curve. The positions of these frequency points on the frequency radius and frequency angle coordinates are recorded as elements in the set of periodic frequency points of the lattice.

[0034] A set of periodic frequency points in a crystal lattice contains multiple combinations of frequency radii and frequency angles. For each combination, amplitude and phase information of the corresponding frequency point can be appended. To convert the set of periodic frequency points into periodic distribution data of the crystal structure, a two-dimensional array is constructed with frequency radius and frequency angle indices as dimensions. In this two-dimensional array, parameters such as the frequency radius, frequency angle, and the corresponding lattice period length are recorded for each occurrence of a periodic frequency point, forming the periodic distribution data of the crystal structure. The lattice period length is calculated using the frequency radius and the spatial sampling interval; for example, the spatial domain lattice period length is equal to 1 divided by the frequency domain frequency value.

[0035] Specifically, S3: Identify spectral anomalies in the spatial spectral distribution data, extract spectral anomaly regions corresponding to the actual defects, and output a distribution map of suspected actual defect areas, including: Based on spatial spectrum distribution data, multiple frequency band regions are divided according to frequency radius; The frequency radius is calculated using the center position of the spatial spectrum distribution data matrix as the zero-frequency reference position. The row and column indices corresponding to the matrix center position are denoted as the center row index and center column index, respectively. For any frequency point in the spatial spectrum distribution data, the difference between the frequency point's row index and the center row index, and the difference between the frequency point's column index and the center column index are calculated. These two differences are considered as the horizontal and vertical frequency offsets, respectively. The frequency radius is obtained by taking the square root of the sum of the squares of the horizontal and vertical frequency offsets. The minimum value of the frequency radius is zero, corresponding to the zero-frequency position, and the maximum value of the frequency radius is close to the distance from the matrix corner to the matrix center. To construct multiple frequency band regions, several radius interval boundaries can be set within the frequency radius range, either through equal spacing or by combining wafer process parameters for non-uniform division. For equal spacing, the interval from 0 to Rmax can be divided into M frequency radius sub-intervals based on the maximum frequency radius Rmax and the number of target frequency band regions M. The length of each frequency radius sub-interval is equal to Rmax divided by M. For example, M can be chosen to be 32, so that each frequency band region covers a frequency radius range of the same width. Non-uniform partitioning allows for finer division of frequency radii corresponding to common defect sizes based on the typical defect size distribution in wafer fabrication processes. Each frequency point is assigned to a corresponding frequency radius sub-interval according to the calculated frequency radius, thereby completing the division of spatial spectrum distribution data into multiple frequency band regions according to frequency radius.

[0036] Within each frequency band region, the spatial spectrum distribution data is segmented according to a preset amplitude threshold to obtain a set of frequency points that meet the abnormal conditions. To determine the preset amplitude threshold for each frequency band, the amplitude set of all frequency points within each frequency band is statistically analyzed, and the mean and standard deviation of the amplitude set are calculated. The mean reflects the average level of the spectral amplitude within the frequency band, while the standard deviation reflects the dispersion of the spectral amplitude within the frequency band. The preset amplitude threshold is determined by a linear combination of the mean and the standard deviation; for example, the preset amplitude threshold can be defined as the mean plus the product of a coefficient K and the standard deviation. The value of the coefficient K can be determined through preliminary experiments. Within each frequency band, the amplitude of each frequency point within the frequency band is compared with the preset amplitude threshold for the frequency band. When the amplitude of a frequency point is greater than the preset amplitude threshold, the frequency point is marked as an abnormal candidate frequency point; when the amplitude of a frequency point is less than or equal to the preset amplitude threshold, the frequency point is marked as a non-abnormal frequency point. By performing comparisons across all frequency bands, a binary frequency map with the same size as the spatial spectrum distribution data can be constructed across the entire frequency plane. Each position in the binary frequency map corresponds to a frequency point. A position value of one indicates that the frequency point belongs to the set of frequency points that meet the outlier conditions, while a position value of zero indicates that the frequency point does not belong to the set of frequency points that meet the outlier conditions. The binary frequency map and the spatial spectrum distribution data are completely identical in terms of row and column indices.

[0037] By marking the connected components of the frequency point set, multiple spectral anomaly regions are obtained; The input for connected component labeling is a binary frequency graph. Connected components are defined based on adjacency relationships, using an eight-adjacency approach. In the eight-adjacency approach, a frequency point is adjacent to other frequency points in the eight directions: up, down, left, right, upper left, upper right, lower left, and lower right. Connected component labeling is performed row-by-row, starting from the first row and first column of the binary frequency graph. Each frequency point is visited in row-major order. For each frequency point, the visited adjacent frequencies are checked to determine if any adjacent frequencies are marked as anomalous. If multiple adjacent frequencies are marked as anomalous, the connected components containing the current frequency point and its adjacent frequencies are merged into the same connected component. A new connected component label is assigned to the first occurrence of an anomalous frequency point. After scanning, if multiple connected component labels need to be merged, they are unified using an equivalence class merging method. After connecting region labeling, a connected region label matrix with the same size as the binary frequency map is obtained. Each element in the label matrix records an integer connected region number. The integer zero can represent the location of a non-abnormal frequency point, and the integer greater than zero represents different spectral anomaly regions. Based on the number of different label values ​​in the connected region label matrix, the number of spectral anomaly regions is counted, with each non-zero label value corresponding to a spectral anomaly region.

[0038] For each spectral anomaly region, a reverse mapping is performed according to the correspondence between frequency coordinates and spatial coordinates to generate a spatial location mask map of the spectral anomaly region in the initial wafer image. The correspondence between frequency coordinates and spatial coordinates is based on the two-dimensional discrete Fourier transform (DFT) and the inverse DFT. The DFT maps a two-dimensional grayscale matrix in the spatial domain to a two-dimensional complex spectrum matrix in the frequency domain, while the inverse DFT maps the frequency domain complex spectrum matrix back to a two-dimensional grayscale matrix in the spatial domain. To obtain the response distribution of each spectral anomaly region to the spatial domain image, multiple frequency mask matrices are constructed in the frequency domain, each corresponding to a spectral anomaly region. The frequency mask matrices have the same size and index structure as the frequency domain complex matrix. In the frequency mask matrices, frequency points belonging to the target spectral anomaly region are assigned a value of one, while those not belonging to the target spectral anomaly region are assigned a value of zero. Element-wise multiplication of the frequency mask matrix and the frequency domain complex matrix yields a target frequency domain complex matrix containing only the complex spectrum values ​​corresponding to the target spectral anomaly region. A two-dimensional discrete Fourier transform is used to perform an inverse transform operation on the target frequency domain complex matrix to obtain the spatial domain response matrix. Each element in the spatial domain response matrix is ​​a complex value, and the magnitude of the complex value reflects the response intensity of the spectral anomaly region to the spatial location corresponding to the initial wafer image. To obtain the spatial location mask map from the spatial domain response matrix, the magnitude of each complex value in the spatial domain response matrix is ​​calculated to form a spatial response amplitude matrix. Then, the spatial response amplitude matrix is ​​thresholded. Pixels with amplitudes greater than the spatial response threshold are marked as spatial location pixels corresponding to spectral anomalies, while pixels with amplitudes less than or equal to the spatial response threshold are marked as non-spatial location pixels.

[0039] The spatial response threshold is set by statistically analyzing the amplitude of all pixels in the spatial response amplitude matrix, calculating the mean amplitude and standard deviation, and defining the spatial response threshold as the product of the mean amplitude and the coefficient L and standard deviation. The value of the coefficient L is determined through preliminary experiments. After spatial response thresholding, a binary spatial location mask is obtained. A mask value of one for each pixel in the binary spatial location mask indicates that the pixel belongs to the spatial location of the spectral anomaly region in the initial wafer image, while a mask value of zero indicates that the pixel does not belong to the spatial location of the spectral anomaly region. For each spectral anomaly region, frequency domain mask construction, two-dimensional discrete Fourier transform, and spatial response thresholding are performed to obtain multiple spatial location mask images corresponding to multiple spectral anomaly regions. The spatial location mask images corresponding to multiple spectral anomaly regions are merged into a total spatial location mask image.

[0040] The spatial location mask image is superimposed on the initial wafer image according to pixel coordinates to generate a distribution map of suspected real defect areas; Ensure the overall spatial location mask map is consistent with the initial wafer image in terms of row count, column count, and pixel coordinate origin. At each pixel coordinate location, read the mask value from the overall spatial location mask map and the grayscale value from the initial wafer image. When the mask value equals one, mark the corresponding pixel location as a suspected real defect area. Assign a specific grayscale value or color code to the pixel in the suspected real defect area distribution map. For example, construct the suspected real defect area distribution map as a single-channel binary image, writing the pixel value 255 to the suspected real defect area pixel location and the pixel value 0 to the non-suspected real defect area pixel location; or construct the suspected real defect area distribution map as a multi-channel pseudo-color image, writing the highlight color code to the suspected real defect area pixel location and the background color code to the non-suspected real defect area pixel location. When the mask value equals zero, maintain the same grayscale value as the initial wafer image in the suspected real defect area distribution map or fill it with a uniform background grayscale value. By overlaying at all pixel coordinate positions, a distribution map of suspected actual defect areas is obtained, which is consistent with the initial wafer image in spatial coordinates.

[0041] Specifically, S4: Determine the periodic intensity of the lattice periodic distribution data, identify the periodic locations of pseudo-defects, and output a distribution map of the periodic interference region of the lattice structure, including: A polar coordinate lattice periodic diagram was established based on the periodic distribution data of the lattice structure. The frequency radius and frequency angle are discretized into several frequency radius sampling points and several frequency angle sampling points, respectively. The frequency radius sampling points and frequency angle sampling points are consistent with those used when constructing the frequency distribution curve. For example, the frequency radius sampling points can be divided into 128 sampling points at equal intervals from zero to the maximum frequency radius Rmax, and the frequency angle sampling points can be divided into 180 sampling points at 2-degree intervals from 0 degrees to 360 degrees. For each lattice periodic frequency point in the two-dimensional array, based on the recorded frequency radius and frequency angle values, the frequency radius sampling point closest to the frequency radius value and the frequency angle sampling point closest to the frequency angle value are found, and the amplitude count is accumulated at the corresponding positions in the polar coordinate lattice periodic diagram. The amplitude count can be taken from the spectral amplitude corresponding to the lattice periodic frequency point. By performing mapping and accumulation operations on all lattice periodic frequency points, a polar coordinate lattice periodic diagram with frequency radius and frequency angle as coordinate axes is obtained. Each combination of frequency radius sampling point and frequency angle sampling point in the polar coordinate lattice periodic diagram corresponds to an amplitude accumulation result.

[0042] The mean amplitude is calculated for each frequency radius position in the polar coordinate lattice periodic diagram, and the amplitude intensity is filtered to obtain the set of frequency radii that satisfy the periodic intensity condition. For each frequency radius sampling point, the amplitude accumulation results of the frequency radius sampling point at all frequency angle sampling points are traversed, and the arithmetic mean of the set of amplitude data corresponding to the frequency radius sampling point is calculated. This arithmetic mean is used as the amplitude mean of the frequency radius sampling point. For all frequency radius sampling points, all amplitude means are arranged in frequency radius index order to obtain the corresponding amplitude mean sequence. In order to identify the set of frequency radii that meet the periodic intensity condition in the amplitude mean sequence, an amplitude mean threshold is determined for the amplitude mean sequence, and amplitude intensity screening is performed on the amplitude mean sequence. The amplitude mean threshold is determined by statistically analyzing all amplitude means in the amplitude mean sequence, calculating the global mean and global standard deviation of the amplitude mean sequence, and defining the amplitude mean threshold as a linear combination of the global mean and standard deviation. The linear combination form is the global mean plus the product of the coefficient P and the global standard deviation. The coefficient P is selected through preliminary experiments. When the amplitude mean corresponding to a frequency radius sampling point is greater than the amplitude mean threshold, the frequency radius sampling point is included in the frequency radius set. By performing a comparison operation on all frequency radius sampling points, a set of frequency radii that satisfy the periodic intensity condition is obtained. Each element in the frequency radius set is an index or value of a frequency radius sampling point.

[0043] In each set of frequency radii, local maxima of amplitude are extracted in ascending order of frequency angle to form a set of periodic extreme points; For any frequency radius sampling point in the frequency radius set, the amplitude accumulation results of all frequency angle sampling points corresponding to that frequency radius sampling point in the polar coordinate lattice periodic diagram are taken and arranged in ascending order of frequency angle from 0 degrees to 360 degrees to obtain the angular direction amplitude sequence of the corresponding frequency radius sampling point. To identify local maxima in the angular direction amplitude sequence, a sliding window search is used. The sliding window length can be set to an odd number of sampling points, such as 5 or 7 angle sampling points. For each position of the sliding window, the amplitude corresponding to the center position of the window is compared with the amplitudes corresponding to the other positions within the window. When the amplitude corresponding to the center position of the window is greater than all the amplitudes corresponding to the other positions within the window, the frequency angle sampling point corresponding to the center position of the window is marked as a candidate periodic extremum point. For each frequency radius sampling point, all angle positions that satisfy the above conditions are summarized to form a subset of periodic extremum points corresponding to the frequency radius sampling point. Perform the above processing on all frequency radius sampling points in the frequency radius set, merge all periodic extreme point subsets to obtain the periodic extreme point set. Each element in the periodic extreme point set contains a frequency radius index and a frequency angle index.

[0044] The periodicity of the set of periodic extreme points is judged according to the frequency angle interval, and the set of lattice periodic frequency points is obtained by screening. Periodicity consistency is determined based on the periodicity of the lattice structure in the spatial domain and the equidistant distribution of characteristic spectral lines in the frequency domain. For any frequency radius sampling point in the frequency radius set, all periodic extreme points with a frequency radius index equal to that sampling point are extracted from the set of periodic extreme points. These periodic extreme points are then arranged in ascending order of frequency angle index to obtain a frequency angle sequence. The frequency angle difference between two adjacent periodic extreme points in the frequency angle sequence is calculated to obtain angle interval data. The average angle interval and standard deviation of the angle interval are calculated from the angle interval data to obtain the statistical characteristics of the angle interval corresponding to the frequency radius sampling point. To determine periodicity consistency, an angle interval tolerance range is set. The angle interval tolerance range is determined by a linear combination of the average angle interval and the standard deviation of the angle interval. For example, the lower limit of the angle interval tolerance is defined as the average angle interval minus the product of the coefficient R and the standard deviation of the angle interval, and the upper limit of the angle interval tolerance is defined as the average angle interval plus the product of the coefficient R and the standard deviation of the angle interval. The coefficient R is selected through preliminary experiments, for example, R is chosen to be equal to 1. When the angular intervals between most adjacent periodic extrema in the frequency-angle sequence are within the angular interval tolerance range, it can be assumed that the periodic extrema corresponding to the frequency radius sampling point satisfy periodic consistency in the angular direction. All periodic extrema corresponding to the frequency radius sampling point are then added to the lattice periodic frequency point set. By performing a periodic consistency judgment on all frequency radius sampling points in the frequency radius set, the lattice periodic frequency point set is obtained. Each element in the lattice periodic frequency point set is a frequency point that satisfies the periodic intensity condition and the periodic consistency condition in both the frequency radius and frequency angle dimensions.

[0045] The set of lattice periodic frequency points is mapped to the spatial domain of the initial image of the wafer to generate a distribution map of the periodic interference region of the lattice structure. The set of lattice periodic frequency points is mapped to the spatial domain of the initial wafer image according to the correspondence between frequency coordinates and spatial coordinates. This correspondence is based on a two-dimensional discrete Fourier transform (DFT), which maps a two-dimensional grayscale matrix in the spatial domain to a two-dimensional complex spectrum matrix in the frequency domain. The inverse DFT maps the two-dimensional complex spectrum matrix in the frequency domain back to a two-dimensional grayscale matrix in the spatial domain. To ensure that the frequency information reflected by the lattice periodic frequency point set corresponds to a periodic interference region in the spatial domain, a lattice periodic frequency mask matrix is ​​constructed in the frequency domain. This lattice periodic frequency mask matrix has the same size and index structure as the frequency domain complex matrix. For any matrix element in the frequency domain corresponding to a frequency point in the lattice periodic frequency point set, the mask value at the corresponding position in the lattice periodic frequency mask matrix is ​​set to 1; for matrix elements in the frequency domain that do not belong to the lattice periodic frequency point set, the mask value at the corresponding position in the lattice periodic frequency mask matrix is ​​set to 0. Element-wise multiplication of the lattice periodic frequency mask matrix and the frequency domain complex matrix yields a lattice periodic frequency complex matrix containing only the complex spectral values ​​corresponding to the lattice periodic frequency points. An inverse two-dimensional discrete Fourier transform is then applied to the lattice periodic frequency complex matrix to obtain the lattice periodic spatial response matrix. Each element in the lattice periodic spatial response matrix is ​​a complex value, and the magnitude of the complex value reflects the interference response intensity of the set of lattice periodic frequency points at the spatial location corresponding to the initial wafer image.

[0046] To transform the lattice periodic spatial response matrix into a distribution map of periodic interference regions in the lattice structure, the magnitude of each complex value in the lattice periodic spatial response matrix is ​​calculated to form a lattice periodic spatial response amplitude matrix. This matrix is ​​then subjected to threshold segmentation and morphological processing. Threshold segmentation requires determining the lattice periodic spatial response amplitude threshold. This threshold can be calculated by statistically analyzing the amplitude set of all pixels in the lattice periodic spatial response amplitude matrix, calculating the mean and standard deviation of the amplitude set, and defining the lattice periodic spatial response amplitude threshold as the product of the mean amplitude plus a coefficient S and the standard deviation. The coefficient S can be selected through preliminary experiments, for example, S equals 1.5. For each pixel in the lattice periodic spatial response amplitude matrix, if the pixel amplitude is greater than the lattice periodic spatial response amplitude threshold, the pixel position is marked as a pixel in the periodic interference region of the lattice structure; if the pixel amplitude is less than or equal to the lattice periodic spatial response amplitude threshold, the pixel position is marked as a pixel in the non-interference region. Thresholding segmentation generates a binary image of the periodic interference region of the crystal structure. A pixel value of 1 indicates that the pixel belongs to the periodic interference region, while a pixel value of 0 indicates that the pixel does not belong to the periodic interference region. The image obtained after thresholding segmentation is the distribution map of the periodic interference region of the crystal structure, and this distribution map is consistent with the initial wafer image in spatial coordinates.

[0047] Specifically, S5: Integrates the distribution map of suspected real defects with the distribution map of lattice structure periodic interference regions, eliminates false defects within the lattice periodic interference regions through regional difference matching, and outputs the distribution data of real defects after interference elimination, including: The distribution map of suspected real defect regions is aligned with the distribution map of periodic interference regions of crystal structure to establish a unified pixel coordinate system and generate a binary mask. The distribution maps of suspected real-world defects and those of lattice structure periodic interference regions are aligned in terms of image width, image height, and pixel coordinate origin to establish a unified pixel coordinate system. In this unified pixel coordinate system, the top-left pixel is used as the pixel origin, the horizontal direction is defined as the x-axis, and the vertical direction as the y-axis. Each pixel in both the suspected real-world defect distribution map and the lattice structure periodic interference region distribution map has a unique pair of integer coordinates within this unified pixel coordinate system.

[0048] A binary mask is generated in a unified pixel coordinate system. The binary mask is represented by a two-dimensional array, where each element corresponds to a pixel position in the unified pixel coordinate system. To simultaneously represent the spatial coverage relationship between the distribution map of suspected real defect regions and the distribution map of periodic interference regions of the crystal structure, the binary mask includes a mask matrix for suspected real defect regions and a mask matrix for periodic interference regions of the crystal structure. The number of rows and columns of the mask matrix for suspected real defect regions corresponds to the distribution map of suspected real defect regions. Figure 1 For pixels belonging to suspected real defect regions in the distribution map of suspected real defect regions, the corresponding position in the suspected real defect region mask matrix is ​​written with the value 1; for pixels not belonging to suspected real defect regions in the distribution map of suspected real defect regions, the corresponding position in the suspected real defect region mask matrix is ​​written with the value 0. The number of rows and columns of the mask matrix for lattice structure periodic interference regions is related to the distribution of lattice structure periodic interference regions. Figure 1 To achieve this, in the distribution map of lattice structure periodic interference regions, pixels belonging to the lattice structure periodic interference region are assigned the value 1 at their corresponding positions in the lattice structure periodic interference region mask matrix; conversely, pixels not belonging to the lattice structure periodic interference region are assigned the value 0 at their corresponding positions in the lattice structure periodic interference region mask matrix. In this way, the binary mask records the pixel-level coverage relationship between the actual suspected defect region distribution map and the lattice structure periodic interference region distribution map under a unified pixel coordinate system.

[0049] Perform a difference operation on the binary mask, delete pixels with a mask value of zero that overlap with the distribution map of the actual suspected defect area, and obtain the first difference image; The difference operation treats each pixel position in a unified pixel coordinate system as the processing object, reading the mask value of the corresponding pixel position in the mask matrix of the suspected real defect region and the mask value of the corresponding pixel position in the mask matrix of the periodic interference region of the lattice structure. When the mask value of the corresponding pixel position in the mask matrix of the suspected real defect region is equal to 1 and the mask value of the corresponding pixel position in the mask matrix of the periodic interference region of the lattice structure is equal to 0, the first difference image writes the value 1 at the corresponding pixel position, indicating that the pixel position belongs to the suspected real defect region in the distribution map of the suspected real defect region but does not belong to the periodic interference region of the lattice structure in the distribution map of the periodic interference region of the lattice structure. When the mask value of the corresponding pixel position in the mask matrix of the suspected real defect region is equal to 1 and the mask value of the corresponding pixel position in the mask matrix of the periodic interference region of the lattice structure is equal to 1, the first difference image writes the value 0 at the corresponding pixel position, indicating that the pixel position spatially overlaps with the distribution map of the periodic interference region of the lattice structure in the distribution map of the suspected real defect region, and the pixel needs to be deleted by the difference operation. When the mask value at the corresponding pixel position in the mask matrix of the suspected real defect region is equal to 0, regardless of whether the mask value at the corresponding pixel position in the mask matrix of the lattice structure periodic interference region is equal to 1 or 0, the first difference image uniformly writes the value 0 at the corresponding pixel position. By performing logical operations on all pixel positions in the unified pixel coordinate system, the first difference image forms a binary image containing only the real defect candidate regions. In the first difference image, the position where the pixel value is equal to 1 represents the retained real defect candidate region pixel, and the position where the pixel value is equal to 0 represents the rejected pixel.

[0050] Connected component marking is performed on the first difference image, and connected components with areas greater than a preset area threshold are extracted to generate the second difference image. The input data for connected component labeling is a binary matrix composed of the first difference set image. Connected components are defined based on the adjacency relationships between pixels. An eight-adjacency method is used, where a pixel is adjacent to pixels in the eight directions: top, bottom, left, right, upper left, upper right, lower left, and lower right. Connected component labeling involves scanning the first difference set image row by row, starting from the first row and first column, visiting each pixel in row-major order. During the scan, when a pixel with a value of 1 is encountered, it is checked whether there are any pixels with a value of 1 among the previously visited pixels in the eight adjacent directions. If multiple adjacent pixels with a value of 1 exist, the current pixel and its adjacent pixels are grouped into the same connected component label. If no adjacent pixels with a value of 1 exist, a new connected component label is assigned to the current pixel. After the scan is complete, if there are equivalence relationships between different connected component labels (e.g., a pixel is temporarily assigned multiple labels in different scan paths), the connected component labels are unified using an equivalence class merging algorithm. After completing the connected component labeling, a connected component label matrix is ​​formed. Each matrix element in the connected component label matrix records an integer label value. An integer label value of 0 indicates that the pixel value at the location is equal to 0 and does not belong to any connected component. An integer label value greater than 0 indicates that the pixel at the location belongs to a real defect candidate connected component.

[0051] After obtaining the connected component label matrix, connected components that are too small and do not meet the requirements of the true defect size are filtered out based on the connected component area. The connected component area is calculated by counting the number of pixels with the same label value in the connected component label matrix. The number of pixels combined with the spatial sampling interval can be converted into the true physical area. For example, if the spatial sampling interval between the centers of two adjacent pixels in a unified pixel coordinate system is equal to Δx in the x-direction and Δy in the y-direction, then the physical area corresponding to the pixel is equal to Δx multiplied by Δy. The preset area threshold is set by combining the minimum true defect size of interest in wafer fabrication with process experience or statistical analysis of a large number of samples to determine the equivalent area of ​​the minimum true defect. For example, if the minimum true defect diameter to be detected in wafer manufacturing is d_min, and the true defect is approximated as a circle, then the minimum true defect area can be approximated as the area of ​​a circle. The area of ​​a circle is equal to pi multiplied by the square of d_min and then divided by 4. Dividing the minimum true defect area by the physical area of ​​a single pixel gives the minimum number of pixels corresponding to the minimum true defect size. The minimum number of pixels can be rounded up as the preset area threshold. When the number of pixels corresponding to a connected component label in the connected component label matrix is ​​less than a preset area threshold, the connected component is considered not to meet the actual defect size requirement and needs to be removed. When the number of pixels corresponding to a connected component label is greater than or equal to the preset area threshold, the connected component is considered to meet the size requirement. All connected components that meet the preset area threshold are assigned a value of 1 in the new binary image, and all connected component pixels that do not meet the preset area threshold are assigned a value of 0, thus generating the second difference image. In the second difference image, each pixel value of 1 corresponds to a candidate connected component pixel whose area meets the preset area threshold, and each pixel value of 0 corresponds to a removed connected component pixel or a pixel with a value of 0 in the original first difference image.

[0052] The third difference image is obtained by performing morphological closing and hole filling operations on the second difference image; Morphological closing and hole-filling operations are performed on the second difference image according to a preset structuring element. The morphological closing operation includes dilation and erosion. The second difference image is then dilated, and the result is eroded. The preset structuring element is a two-dimensional template used for morphological operations, and either a square or circular structuring element is selected. The size of the preset structuring element is determined by combining the roughness of the boundaries of real defect candidate connected regions and the spatial resolution of the wafer image. Experiments are conducted to compare the effects of different structuring element sizes on boundary smoothness and the preservation of fine features, selecting a structuring element size that can smooth the boundaries of real defect candidate connected regions without excessively engulfing adjacent defect regions. For example, when the spatial sampling interval is 1 micrometer, a square structuring element with a side length of 3 or 5 pixels is selected. During the dilation operation, if at least one pixel with a value of 1 exists within the coverage area of ​​the preset structuring element, the output pixel value at the center of the preset structuring element is set to 1; otherwise, it is set to 0. During the erosion operation, if all pixel values ​​within the coverage area of ​​the preset structuring element are equal to 1, the output pixel value at the center of the preset structuring element is set to 1; otherwise, it is set to 0.

[0053] To eliminate potential hole regions within the connected components of true defect candidate regions in the second difference image, a hole-filling operation is performed. The input image for the hole-filling operation is the output image of the closing operation. The goal of the hole-filling operation is to fill regions in the closing operation output image that are located within the connected components of true defect candidate regions and have pixel values ​​equal to 0 with regions having pixel values ​​equal to 1. The hole-filling operation involves background marking and inversion, followed by compositing with the original image: an outer frame with pixel values ​​equal to 0 is added around the closing operation output image, treating the closing operation output image as the internal region. On the expanded image, connected component marking is performed on the regions with pixel values ​​equal to 0. Connected components connected to the image boundary are marked as background connected components, and connected components not connected to the image boundary are marked as hole connected components. Background connected components retain pixel values ​​equal to 0, while hole connected components change pixel values ​​from 0 to 1. After processing, the outer frame is removed, resulting in a hole-filled binary image. After the closing and hole-filling operations, a third difference image is formed. In the third difference image, regions with continuous boundaries of true defect candidate connected components and pixel values ​​equal to 1 within them no longer contain holes.

[0054] Based on the set of pixel coordinates of connected components in the third difference image, generate the true defect distribution data after eliminating interference; Connected component labeling is performed on the third difference image using an eight-adjacency approach, employing the same scanning and label merging strategy as the first difference image connected component labeling stage. After connected component labeling, a connected component label matrix corresponding to the third difference image is obtained. For each connected component in the label matrix with a label value greater than 0, all pixel positions in the matrix equal to the label value are traversed in a unified pixel coordinate system. The row and column indices of each pixel position are combined into a pixel coordinate pair, and all pixel coordinate pairs are summarized into a pixel coordinate set. Each connected component corresponds to a pixel coordinate set, which records the geometry and spatial extent of the actual defect region in the initial wafer image space. The true defect distribution data after interference removal consists of the pixel coordinate set of all connected components.

[0055] Specifically, S6: Based on real defect distribution data, perform defect classification and identification, and output wafer defect detection results, including: Extract the pixel coordinates of the boundary contour of each connected component in the real defect distribution data; The boundary contour of a connected component is defined as the set of pixels in the connected component that are adjacent to at least one background pixel. Foreground pixels refer to real defect pixels with a value of 1, and background pixels refer to non-real defect pixels with a value of 0. In a working image with the same dimensions as the initial wafer image, pixel positions belonging to the current connected component are written with a value of 1, and pixel positions not belonging to the current connected component are written with a value of 0, forming a binary connected component image corresponding to the current connected component. In the binary connected component image, for each pixel position with a value of 1, the pixel values ​​in the eight adjacent directions are checked. If at least one pixel with a value of 0 exists in the eight adjacent directions, the current pixel position is marked as a boundary pixel. By performing the above judgment operation on all pixels in the binary connected component image, the pixel set of the boundary contour of the current connected component is obtained. To facilitate the calculation of boundary curvature, the set of connected domain boundary contour pixels is sorted in order. The sorting method adopts a sequential connection method based on boundary tracking. For example, a boundary pixel located in the upper left corner is selected from the set of connected domain boundary contour pixels as the starting pixel. The next boundary pixel is searched in the eight adjacent pixels in a clockwise or counterclockwise direction until the starting pixel is returned or a round of tracking is completed, thereby generating an ordered sequence of pixel coordinates of connected domain boundary contours arranged according to spatial connectivity.

[0056] The geometric and grayscale feature parameters of each connected component are calculated based on the pixel coordinates of the boundary contour of the connected component, and combined into a feature vector for defect classification. Geometric and grayscale feature parameters include area, perimeter, aspect ratio, shape factor, and boundary curvature. Area is calculated by counting the number of pixels in the connected component's pixel coordinate set and combining this with the spatial sampling interval. For example, in a unified pixel coordinate system, if the distance between the centers of two adjacent pixels in the x-direction is Δx, and the distance in the y-direction is Δy, then the area of ​​the connected component equals the number of pixels in the connected component multiplied by Δx and Δy. Perimeter is obtained by calculating and summing the Euclidean distances between adjacent pixels in the ordered pixel coordinate sequence of the connected component's boundary contour. If the absolute value of the difference between the coordinates of two adjacent boundary pixels in the x-direction or y-direction is equal to 1, and the absolute value of the difference in the other direction is equal to 0, then the distance between adjacent pixels is equal to the side length of one pixel. If the absolute value of the difference between the coordinates of two adjacent boundary pixels in both the x-direction and y-direction is equal to 1, then the distance between adjacent pixels is equal to the diagonal length. Aspect ratio is obtained by calculating the ratio of the length of the longer side to the length of the shorter side of the bounding rectangle of the connected component; the aspect ratio equals the length of the longer side divided by the length of the shorter side. The shape coefficient represents the degree of approximation between the shape of the connected component and an ideal circle. It is defined by roundness, which is 4 times pi multiplied by the area and then divided by the square of the circumference. Boundary curvature is obtained by discrete curvature estimation of the ordered pixel coordinate sequence of the connected component boundary contour. This can be achieved by selecting three adjacent points on the boundary contour using a sliding window of fixed length, calculating the change in exterior angle at the midpoint, and dividing the change in angle by the corresponding arc length to obtain the local curvature value. The mean curvature and maximum curvature are then calculated across the entire boundary contour as boundary curvature features.

[0057] Using the above method, a feature vector containing multiple components such as area, perimeter, aspect ratio, shape coefficient, and boundary curvature is constructed for each connected component. The feature vector is arranged in a fixed order, such as area, perimeter, aspect ratio, shape coefficient, mean curvature, and maximum curvature.

[0058] The feature vectors are matched with the standard feature vectors of various types of defects in a pre-built wafer defect classification database based on similarity. The wafer defect classification database is constructed by collecting and organizing a large number of labeled samples. Each labeled sample is a wafer defect image from the actual production process. Each defect region in the labeled sample has a defect type label, such as scratch defects, particle defects, void defects, and metal residue defects. For each labeled sample, connected component extraction, connected component boundary contour pixel coordinate calculation, and geometric and grayscale feature parameter calculation are performed on the defect region to obtain a set of feature vectors with known defect type labels. For each defect type, all feature vectors belonging to the same defect type label are statistically analyzed, calculating the mean and standard deviation of each feature component. The mean of the feature components is arranged in a fixed order to form a standard feature vector for the defect type, and the standard deviation of the feature components is used for weighted distance measurement or uncertainty assessment.

[0059] The feature vector of each connected component is matched with the standard feature vectors of each defect type in the wafer defect classification database using a similarity metric: Euclidean distance. For each connected component feature vector and the standard feature vector of the defect type, the square of the difference between the corresponding components is calculated. Then, the squares of all component differences are summed and the square root is taken to obtain the Euclidean distance between the connected component feature vector and the standard feature vector of the defect type. This distance is calculated sequentially for each connected component feature vector and each standard feature vector of the defect type in the wafer defect classification database, forming a distance set.

[0060] Based on the similarity matching results, determine the defect type corresponding to each connected component and label the defect type of each connected component. After obtaining the distance set, the defect type corresponding to each connected component is determined based on the similarity matching results, and a defect type label is assigned to each connected component. For each connected component, the defect type corresponding to the standard feature vector of the defect type with the smallest distance value is found from the distance set, and this defect type is used as the initial defect type candidate for the connected component. To avoid misclassification, a distance threshold is introduced. The distance threshold is set by statistically analyzing the distance distribution when samples of the same type match the standard feature vector of the correct defect type and the distance distribution when samples of different types match the standard feature vector of the incorrect defect type on the validation sample set. For example, the distance threshold can be determined by finding the intersection of the two distance distributions or by minimizing the classification error rate. When the minimum distance is less than the distance threshold, the defect type of the connected component is confirmed as the corresponding defect type; when the minimum distance is greater than the distance threshold, the defect type of the connected component is marked as an unknown defect type or an abnormal defect type. For connected components with determined defect types, the defect type label is mapped to the set of pixel coordinates of the connected component to form a record of the actual defect distribution data with defect type labels.

[0061] Based on the spatial distribution of connected components with defect type labels on the initial wafer image, wafer defect detection results are generated. Wafer defect detection results are represented in image form. The image-based wafer defect detection results are visualized by overlaying defect region boundary contours and defect type labels onto the initial wafer image. In a unified pixel coordinate system, the pixel coordinate set of each connected component is traversed, and the grayscale values ​​of the corresponding pixels in the initial wafer image are replaced with bright grayscale values ​​or overlaid with semi-transparent color markers. For example, different pseudo-color codes can be assigned to different defect types: scratches are coded in red, particle defects in green, voids in blue, and metal residue defects in yellow. For the boundary contour of each connected component, a boundary curve can be drawn on the initial wafer image using a single-pixel width outline, and defect type label text or type number can be drawn at the centroid of the connected component. Through image overlay, a wafer defect detection result image that intuitively reflects the spatial distribution of each type of defect is generated. Example 2

[0062] The difference between Embodiment 2 and Embodiment 1 is that this embodiment introduces a wafer inspection device using image recognition.

[0063] A wafer inspection device employing image recognition includes: a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement a wafer inspection method employing image recognition.

[0064] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0065] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0066] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0067] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0068] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0069] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0070] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0071] 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 scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0072] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A wafer inspection method employing image recognition, characterized in that, Includes the following steps: S1: Acquire a wafer surface image, identify periodic diffraction interference features in the wafer surface image, and output an initial wafer image with diffraction interference markers; S2: Separate and extract the spatial spectral features in the initial wafer image and detect and identify the periodic characteristics of the lattice structure in the initial wafer image to obtain spatial spectral distribution data and lattice structure periodic distribution data; S3: Identify spectral anomalies in the spatial spectrum distribution data, extract the spectral anomaly regions corresponding to the real defects, and output a distribution map of the suspected real defect regions. S4: Determine the periodic intensity of the lattice periodic distribution data, identify the periodic location of the false defect distribution, and output the distribution map of the periodic interference region of the lattice structure. S5: Integrate the distribution map of suspected real defects with the distribution map of lattice structure periodic interference regions, eliminate false defects in the lattice periodic interference regions through regional difference matching, and output the real defect distribution data after interference elimination; S6: Based on real defect distribution data, perform defect classification and identification, and output wafer defect detection results.

2. The wafer inspection method using image recognition according to claim 1, characterized in that, S1, specifically: The wafer surface to be inspected is coaxially illuminated, and multiple frames of original images of the wafer surface are acquired in a predetermined angle sequence. Each frame of the original wafer surface image is preprocessed to obtain a preprocessed wafer surface image. The preprocessed wafer surface image is frequency domain transformed, and the diffraction interference spectrum components that meet the requirements of periodic diffraction characteristics are extracted. The diffraction interference spectral components are mapped to the spatial domain through inverse frequency domain transformation to form a periodic diffraction interference feature mask. The periodic diffraction interference feature mask image is superimposed and marked with the preprocessed wafer surface image at the pixel level to generate an initial wafer image with diffraction interference markings.

3. The wafer inspection method using image recognition according to claim 2, characterized in that, S2, specifically: A two-dimensional grayscale matrix is ​​constructed based on the initial image of the wafer according to a predetermined spatial sampling interval; A fast Fourier transform is performed on the two-dimensional grayscale matrix to obtain the initial spatial spectrum data corresponding to the initial image of the wafer; Based on the initial spatial spectrum data, frequency components with amplitudes greater than a preset amplitude threshold are extracted to form spatial spectrum distribution data; The spatial spectrum distribution data is rearranged in polar coordinates according to the frequency radius and frequency angle to obtain the frequency distribution curve. The set of periodic frequency points of the crystal lattice is extracted based on the frequency distribution curve and converted into periodic distribution data of the crystal structure.

4. The wafer inspection method using image recognition according to claim 3, characterized in that, S3, specifically: Based on spatial spectrum distribution data, multiple frequency band regions are divided according to frequency radius; Within each frequency band region, the spatial spectrum distribution data is segmented according to a preset amplitude threshold to obtain a set of frequency points that meet the abnormal conditions. By marking the connected components of the frequency point set, multiple spectral anomaly regions are obtained; For each spectral anomaly region, a reverse mapping is performed according to the correspondence between frequency coordinates and spatial coordinates to generate a spatial location mask map of the spectral anomaly region in the initial wafer image. The spatial location mask image is superimposed on the initial wafer image according to pixel coordinates to generate a distribution map of suspected defect areas.

5. A wafer inspection method using image recognition according to claim 4, characterized in that, S4, specifically: A polar coordinate lattice periodic diagram was established based on the periodic distribution data of the lattice structure. The mean amplitude is calculated for each frequency radius position in the polar coordinate lattice periodic diagram, and the amplitude intensity is filtered to obtain the set of frequency radii that satisfy the periodic intensity condition. In each set of frequency radii, local maxima of amplitude are extracted in ascending order of frequency angle to form a set of periodic extreme points; The periodicity of the set of periodic extreme points is judged according to the frequency angle interval, and the set of lattice periodic frequency points is obtained by screening. The set of lattice periodic frequency points is mapped to the spatial domain of the initial image of the wafer to generate a distribution map of the periodic interference region of the lattice structure.

6. The wafer inspection method using image recognition according to claim 5, characterized in that, S5, specifically: The distribution map of suspected real defect regions is aligned with the distribution map of periodic interference regions of crystal structure to establish a unified pixel coordinate system and generate a binary mask. Perform a difference operation on the binary mask, delete pixels with a mask value of zero that overlap with the distribution map of the actual suspected defect area, and obtain the first difference image; Connected component marking is performed on the first difference image, and connected components with areas greater than a preset area threshold are extracted to generate the second difference image; The third difference image is obtained by performing morphological closing and hole filling operations on the second difference image; The true defect distribution data after eliminating interference is generated based on the set of pixel coordinates of connected components in the third difference image.

7. A wafer inspection method using image recognition according to claim 6, characterized in that, S6, specifically: Extract the pixel coordinates of the boundary contour of each connected component in the real defect distribution data; The geometric and grayscale feature parameters of each connected component are calculated based on the pixel coordinates of the boundary contour of the connected component, and combined into a feature vector for defect classification. The feature vectors are matched with the standard feature vectors of various types of defects in a pre-built wafer defect classification database based on similarity. Based on the similarity matching results, determine the defect type corresponding to each connected component and label the defect type of each connected component. Wafer defect detection results are generated based on the spatial distribution of connected components with defect type labels on the initial wafer image.

8. A wafer inspection device employing image recognition, characterized in that, include: A processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement a wafer inspection method using image recognition as described in any one of claims 1-7.