Detection method and device and storage medium
By generating a distribution model and a benchmark distribution function to adapt to wafer defect characteristics, the problem of high false alarm rate and false negative rate in traditional detection methods is solved, achieving higher detection accuracy and robustness.
Patent Information
- Application Number
- CN202511304015.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2026-02-03
AI Technical Summary
Traditional wafer defect detection methods rely on a single statistical model, which is difficult to accurately describe the complex defect signal distribution characteristics, resulting in high false alarm or false negative rates, and the threshold setting lacks adaptability to local distribution characteristics.
By adopting the hybrid distribution characteristics of adaptive wafer defects, a distribution model and a baseline distribution function are generated, and feature values are set for accurate defect detection. This includes acquiring the image to be tested, generating the distribution model, acquiring the baseline distribution features, and performing anomaly detection.
It improves the accuracy and robustness of wafer defect detection, and is better able to distinguish between defects and noise in complex backgrounds.
Smart Images

Figure CN121458618A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of semiconductor technology, and more specifically to a detection method, device, and storage medium. Background Technology
[0002] In semiconductor manufacturing, wafer defect detection is a critical step in ensuring product quality and yield. Traditional defect detection methods typically rely on preset fixed thresholds or threshold settings based on a single statistical model (such as a Gaussian distribution). However, defect signals on the wafer surface often exhibit complex distribution characteristics, such as multimodal or asymmetric distributions. Using a single model alone is insufficient to accurately describe the statistical characteristics of actual defects, leading to high false alarm or false negative rates in the detection results.
[0003] In existing technologies, some methods attempt to model defect signals using mixture models (such as Gaussian mixture models), but these are typically only used for data fitting or classification, without fully utilizing the distribution characteristics of the mixture models to optimize feature values. Furthermore, traditional threshold setting methods often rely on human experience or global statistics, lacking adaptability to local distribution characteristics and struggling to effectively distinguish defects from noise in complex contexts. Therefore, there is an urgent need for a method that can adapt to the mixed distribution characteristics of wafer defects for accurate defect detection, thereby improving the accuracy and robustness of wafer defect detection. Summary of the Invention
[0004] The technical solution of this application is to provide a detection method, device and storage medium for accurate defect detection based on the mixed distribution characteristics of wafer defects, so as to improve the accuracy and robustness of wafer defect detection.
[0005] This application provides a method comprising: acquiring a test image of a sample; performing feature value acquisition processing on the test image, the feature value acquisition processing comprising: generating a distribution model based on the test image, the distribution model representing the correspondence between statistical data and pixel values, the statistical data being positively correlated with pixel probabilities, the pixel probabilities being the probability of having a corresponding pixel value, the distribution model comprising a linear combination of multiple local components; acquiring the distribution characteristics of a benchmark distribution function based on a benchmark distribution, wherein the benchmark distribution is determined based on at least some local components of each local component of the distribution model; setting feature values according to the distribution characteristics of the benchmark distribution function; and performing anomaly detection on the sample based on the feature values to obtain a detection result.
[0006] This application also provides an apparatus, including a processor configured to: acquire a test image of a sample; perform feature value acquisition processing on the test image, the feature value acquisition processing including: generating a distribution model based on the test image, the distribution model representing the correspondence between statistical data and pixel values, the statistical data being positively correlated with pixel probabilities, the pixel probabilities being the probability of having a corresponding pixel value, the distribution model including a linear combination of multiple local components; acquiring the distribution characteristics of a benchmark distribution function based on a benchmark distribution, wherein the benchmark distribution is determined based on at least some local components of each local component of the distribution model; setting feature values according to the distribution characteristics of the benchmark distribution function; and performing anomaly detection on the sample based on the feature values to obtain a detection result.
[0007] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the detection method described above.
[0008] The technical solution of the present invention has the following beneficial effects.
[0009] The invention provides a method for obtaining a baseline distribution function based on the distribution model of the image under test. Then, feature values are set using the distribution characteristics of the baseline distribution function to extract the target from the sample. This enables accurate defect detection by adapting to the mixed distribution characteristics of wafer defects, thereby improving the accuracy and robustness of wafer defect detection. Attached Figure Description
[0010] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0011] Figure 1 This is a schematic flowchart of an embodiment of the detection method of the present invention; Figures 2 to 7 This is a schematic diagram of the structure of each step in an embodiment of the detection method of the present invention; Figures 8 to 10 This is a schematic diagram of the structure of each step in the second embodiment of the detection method of the present invention; Figure 11 This is a schematic diagram of the structure of each step in the third embodiment of the detection method of the present invention; Figures 12 to 16 This is a schematic diagram of the structure of each step in the fourth embodiment of the detection method of the present invention; Figure 17This is a schematic diagram of an embodiment of the control system in this invention. Detailed Implementation
[0012] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0013] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. In this invention, "each" includes one or more quantities.
[0014] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0015] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other, and should all be considered to be within the scope of this specification.
[0016] For ease of explanation, the basic process of the detection method in this invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of the detection method of the present invention is provided below: 110. Obtain the image of the sample to be tested; In this embodiment, the image to be tested refers to an image on which no target detection has been performed on the sample. This image has not been detected to contain the target, nor has its location information been detected. The image to be tested can be a continuous image collected from the same sample, a combined image collected from different sections of the same sample, or a combined image collected from different samples. Acquiring the image to be tested can involve acquiring its pixel data, including pixel location and pixel value.
[0017] In one embodiment, the image to be tested is a sample image of the sample or a difference image of the sample, wherein the difference image is a difference map between the sample image of the sample and a preset standard image. The standard image refers to an image that does not include the target to be tested, and only includes the non-target target relative to the image to be tested. For example, the standard image only includes pattern areas and background areas. That is, the sample image includes both the target to be tested and non-target targets, while the difference image typically only includes the target to be tested.
[0018] In another embodiment, acquiring the test image of the sample includes: acquiring the test image based on multiple original images of the sample, wherein each original image includes one or more partitions, each partition includes one or more pixel units, each partition has a region pixel value, and the region pixel value of the partition is a linear combination of the pixel values of the pixel units in the partition; acquiring the test image based on the original images of the sample includes: acquiring at least one class partition group based on the multiple original images, the class partition group consisting of partitions in the multiple original images that correspond to the same sample region; and obtaining a test image based on the region pixel values of each partition in each class partition group, where each partition is used as a pixel of the test image, and each region pixel value is used as a pixel value of the test image. In this case, the original images are images collected from the same sample, and the test image is a combination image collected from different partitions of the same sample or a combination image collected from different samples.
[0019] Specifically, the number of samples is multiple, or the samples include multiple divided regions. Each sample includes at least a standard structure, and each sample includes the same standard structure, or each divided region includes the same standard structure. The multiple original images are acquired from the standard structures of the multiple samples, or the multiple original images are acquired from the standard structures of multiple divided regions of at least one sample. The standard structure includes a sample surface pattern and a sample background. The sample surface of a sample includes one pattern or multiple identical patterns arranged in a preset order. The image to be tested is acquired from the entire sample surface, or from any divided region of a pattern, where each divided region includes one pattern.
[0020] In addition, the target to be tested is a non-standard structure, which is a defect in the sample, including pattern defects, particulate contamination, scratches, etc.; the standard structure is not the target to be tested, and the pattern includes metal lines, holes, gratings or solder balls, etc.
[0021] Before obtaining at least one class partition group based on the plurality of original images, the method further includes: aligning the plurality of original images to determine partitions in the plurality of original images that correspond to the same sample region; wherein each of the original images includes a standard structural pattern, the standard structural pattern being used to represent at least a portion of the standard structure; aligning the different original images includes: aligning the standard structural patterns in the different original images.
[0022] Specifically, aligning the standard structural patterns of the different original images includes: extracting pattern features from the different original images, matching at least a portion of the pattern features of the different original images to obtain a matching result; and aligning the different original images based on the matching result.
[0023] By aligning the pattern features representing standard structures in the original images, when partitions obtained from different original images are grouped into a class partition group, each partition contains the same local pattern of the standard structure. The sample also includes non-standard structures located at random positions on the sample surface, which appear as non-standard structure patterns overlaying the standard structure patterns in the original images. That is, the original images can include some pattern features as well as non-standard structure patterns, and each original image can include different parts of the pattern features. Therefore, matching only the common pattern features included in each original image is sufficient to complete the alignment of the different original images.
[0024] Next, feature value acquisition processing is performed on the image to be tested, which includes the following steps 120-140.
[0025] 120. Generate a distribution model based on the image to be tested, wherein the distribution model represents the correspondence between statistical data and pixel values, the statistical data is positively correlated with pixel probability, the pixel probability is the probability of having a corresponding pixel value, and the distribution model includes a linear combination of multiple local components; Generating a distribution model based on the image to be tested includes: obtaining pixel distribution data based on the image to be tested, wherein the pixel distribution data is the correspondence between statistical data and pixel values, the statistical data is positively correlated with statistical probability values, and the statistical probability values are the probability that a pixel in the image to be tested has a certain pixel value; and obtaining the distribution model based on the pixel distribution data.
[0026] Obtaining the distribution model based on the pixel distribution data includes: fitting the pixel distribution data to a mixed distribution function to obtain the distribution model, wherein the mixed distribution function is a linear combination of multiple benchmark distribution functions; or, directly using the pixel distribution data as the distribution model.
[0027] In this embodiment, obtaining pixel distribution data based on the image to be tested includes: counting the number of pixel units for each pixel value in the image to be tested to obtain a statistical quantity; obtaining statistical data based on the statistical quantity; and obtaining the pixel distribution data based on the correspondence between the pixel value and the statistical data. The pixel unit is a sub-pixel, a pixel, or a region composed of multiple pixels.
[0028] Specifically, obtaining statistical data based on the statistical quantity includes: obtaining the statistical data based on the statistical quantity and the total number of pixel units; or, using the statistical quantity as the statistical data. Counting the number of pixel units for each pixel value in the image under test to obtain the statistical quantity includes: taking each pixel unit in the image under test as the smallest distribution granularity; and counting the statistical quantity of pixel units corresponding to each pixel value.
[0029] The statistical data is obtained based on the statistical count and the total number of pixel units, including: obtaining the pixel probability by the ratio of the statistical count to the total number of pixel units in the image to be tested; and obtaining the statistical data through the pixel probability. Obtaining the statistical data through the pixel probability includes: using the pixel probability as the statistical data, or multiplying the pixel probability by a weight to obtain the statistical data.
[0030] Obtaining the pixel distribution data based on the correspondence between the pixel values and the statistical data includes: establishing a statistical coordinate system with the pixel values and statistical data as coordinate axes respectively; mapping the pixel values and statistical data of the image to be tested to the statistical coordinate system to obtain the pixel distribution data, wherein the pixel distribution data can be represented in the statistical coordinate system as a histogram, line graph, etc.
[0031] The pixel distribution data is fitted with a mixed distribution function to obtain the distribution model. The mixed distribution function is a linear combination of multiple benchmark distribution functions, including: fitting a curve to the pixel distribution data in a coordinate system to obtain the distribution model of the image under test. The two coordinate axes of the coordinate system can represent statistical data and pixel values, respectively, i.e., the distribution model.
[0032] Statistical data can include pixel probability, number of pixel units, etc., and pixel values can be grayscale values, light intensity values, charge quantity, or current.
[0033] The distribution model obtained by fitting the pixel distribution data with a mixed distribution function is a continuous data model; if the pixel distribution data is directly used as the distribution model, the distribution model is a discrete data model.
[0034] In the continuous data model, each local component can be represented by a mixture distribution function, which is a linear combination of multiple standard distribution functions. In the discrete data model, each local component is represented by multiple sets of discrete data. Each set of discrete data includes one pixel value from the pixel distribution data and its corresponding statistical data. Specifically, representing each local component by multiple sets of discrete data involves fitting multiple fitting curves based on the changes in the pixel distribution data. Within each fitting curve, each set of discrete data corresponds to one local component. In this embodiment, the baseline distribution function is a normal distribution function, a Gaussian distribution function, a Poisson distribution function, or a T-distribution function. The mixture distribution function is a linear combination of at least one of the following baseline distribution functions: normal distribution function, Gaussian distribution function, Poisson distribution function, and T-distribution function.
[0035] In this embodiment, the hybrid distribution function includes multiple parameters to be adjusted. The distribution model is obtained by fitting the pixel distribution data to the hybrid distribution function, including: generating multiple initial local components by setting multiple initial values for the parameters to be adjusted of each baseline distribution function, wherein the parameters to be adjusted at least represent the distribution range of the initial local components; dividing the pixel distribution data into multiple groups of data; determining the initial probability that each group of data belongs to each initial local component; adjusting the parameters to be adjusted for each initial local component based on the initial probability; and obtaining the distribution model based on each initial local component after adjusting the parameters to be adjusted. The distribution range includes the range of the statistical data and the pixel values.
[0036] The parameters to be adjusted include a dispersion index, the mean of the pixel values, and the weights of each baseline distribution function in the mixed distribution function. The initial local components after each adjustment of the parameters to be adjusted better reflect the distribution trend of the pixel distribution data compared to before the adjustment.
[0037] Adjusting the parameters to be tuned based on the initial probability of each initial local component includes: obtaining the adjusted probability of each group of data in the pixel distribution data belonging to each adjusted initial local component and the probability deviation between the adjusted probability and the initial probability according to the adjusted parameters to be tuned; repeating the steps of obtaining the initial probability to obtaining the probability deviation until a preset condition is met to obtain each local component of the distribution model; wherein, the preset condition includes the number of repetitions reaching a preset number, the probability deviation being less than or equal to a preset value, or convergence. By adjusting the probabilities to be tuned multiple times through the preset condition, each local component of the distribution model fully satisfies the distribution trend of the pixel distribution data, so that the distribution model can be approximately equivalent to the pixel distribution data for subsequent processing.
[0038] Furthermore, the sample image and the test image, composed of multiple original image partitions, include both the target and non-target objects. The local components in the generated distribution model can be used to represent both the target and non-target objects. The difference image typically only includes the target object, and the local components in the generated distribution model can be used solely to represent the target object. In addition, the distribution models generated based on both the sample image and the difference image include local components corresponding to noise.
[0039] 130. Obtain the distribution characteristics of a benchmark distribution function based on a benchmark distribution, wherein the benchmark distribution is determined based on at least some local components of each local component of the distribution model; Before obtaining the distribution characteristics of the benchmark distribution function based on the benchmark distribution, the method further includes: obtaining at least some of the local components in each local component of the distribution model to obtain the benchmark distribution; obtaining at least some of the local components in each local component of the distribution model to obtain the benchmark distribution includes: determining the peak position of each local component in the distribution model; and selecting at least some of the local components sequentially along a preset direction to generate the benchmark distribution based on the peak position distance between each adjacent local component, wherein the preset direction is from the local component with the largest peak value to other local components.
[0040] In this embodiment, the peak value represents the maximum statistical data in each local component, the peak position represents the pixel value position corresponding to the maximum statistical data, and the peak position distance can be represented as the pixel value difference between the maximum statistical data in each local component.
[0041] The reference distribution is generated by sequentially selecting at least a portion of the local components along a preset direction based on the peak position distances between adjacent local components, where the distance between adjacent peak positions exceeds the preset distance threshold; selecting the first local component from the first group of adjacent local components to obtain the reference distribution; or, determining the last group of adjacent local components where the distance between adjacent peak positions does not exceed the preset distance threshold; selecting the last local component from the last group of adjacent local components to obtain the reference distribution; or, determining local components along the preset direction where the distance between adjacent peak positions is less than the preset distance threshold and the distance between adjacent peak positions of the next local component is greater than the preset distance threshold as the reference distribution. In this embodiment, the reference distribution is represented by one or two end local components that satisfy the preset distance threshold.
[0042] Based on the peak position distances between adjacent local components, at least a portion of the local components are sequentially selected along a preset direction to generate the benchmark distribution. This includes: sequentially determining local components whose distance from the peak position of the previous local component does not exceed a preset distance threshold along the preset direction; merging the local components whose distance from the peak position of the previous local component does not exceed the preset distance threshold to obtain the benchmark distribution; and obtaining the distribution characteristics of the benchmark distribution function based on the benchmark distribution, including: performing function fitting on the benchmark distribution using a preset distribution function to obtain the distribution characteristics of the benchmark distribution function, wherein the distribution function is a single benchmark distribution function. In this embodiment, the benchmark distribution is represented by all local components that satisfy the preset distance threshold.
[0043] The process involves merging all local components whose distance from the peak position of the previous local component does not exceed a preset distance threshold to obtain a baseline distribution. This includes: merging all local components whose distance from the peak position of the previous local component does not exceed the preset distance threshold along a preset direction; or, determining whether the distance from the peak position of the previous local component exceeds the preset distance threshold along a preset direction. If not, merging adjacent local components to obtain an initial merged component, and determining whether the distance between the adjacent peak positions of the initial merged component and the next adjacent local component exceeds the preset distance threshold. If not, merging the initial merged component and the next adjacent local component to form a new initial merged component; repeating the step of determining whether the distance between the adjacent peak positions of the initial merged component and the next adjacent local component exceeds the preset distance threshold until the distance between the adjacent peak positions of the initial merged component and the next adjacent local component exceeds the preset distance threshold.
[0044] Obtaining a baseline distribution function includes: generating a baseline distribution function based on the complete fitting of the at least some local components; or, generating a baseline distribution function based on fitting one or two end local components of the at least some local components.
[0045] The target to be tested, the non-target to be tested, and the noise in the sample image may include overlapping pixel value ranges, such that there exists a local component generated by the superposition of pixel values of at least two of the target to be tested, the non-target to be tested, and the noise.
[0046] Furthermore, the benchmark distribution can be a linear combination of at least some of the local components. That is, the benchmark distribution can be a distribution resulting from the merging of at least some of the components. Alternatively, the benchmark distribution can be a distribution of a single local component.
[0047] In this embodiment, obtaining the distribution characteristics of the benchmark distribution function based on the benchmark distribution specifically includes: obtaining the distribution characteristics of the local components corresponding to the benchmark distribution in the distribution model; or, performing function fitting on the benchmark distribution using a preset distribution function to obtain the distribution characteristics of the benchmark distribution function.
[0048] If the pixel distribution data is fitted with a mixed distribution function to obtain the distribution model, the distribution model after function fitting includes multiple local components corresponding to the baseline distribution function, and the distribution characteristics of each distribution function can be obtained through function fitting. The distribution characteristics include one or more combinations of mean and standard deviation. If the baseline distribution includes only one local component, the distribution characteristics of the local component corresponding to the baseline distribution are directly obtained in the distribution model. If the baseline distribution includes multiple local components, the distribution characteristics of the baseline distribution function are obtained based on the baseline distribution, including fitting the baseline distribution with a preset distribution function to obtain the distribution characteristics of the baseline distribution function, where the distribution function is a single baseline distribution function.
[0049] If the pixel distribution data is directly used as the distribution model, then the baseline distribution is a subset of pixel distribution data. The distribution characteristics of the baseline distribution function are obtained based on the baseline distribution, including fitting the baseline distribution with a preset distribution function to obtain the distribution characteristics of the baseline distribution function, wherein the distribution function is a single baseline distribution function.
[0050] 140. Set characteristic values according to the distribution characteristics of the benchmark distribution function; In one embodiment, the distribution characteristics include a dispersion index of the baseline distribution function and the mean of the pixel values; setting feature values according to the distribution characteristics of the baseline distribution function includes setting a linear combination of the dispersion index and the mean of the pixel values as the feature value.
[0051] Specifically, setting feature values based on the distribution characteristics of the baseline distribution function includes: if the preset direction is along the positive direction of the preset coordinate axis, the feature value T is set as: T = P + K * D; if the preset direction is along the negative direction of the preset coordinate axis, the feature value T is set as: T = PK * D; if the preset direction is along both the positive and negative directions of the preset coordinate axis, the feature value T is set as: T = (P1 - K * D, P2 + K * D); where the coordinate axis is oriented towards the distance from the peak position, P, P1, and P2 are the mean values of the pixel values of the baseline distribution function on the coordinate axis, D is the variance of the pixel values of the baseline distribution function on the coordinate axis, K is a preset multiple, and the dispersion index includes the variance.
[0052] In another embodiment, the distribution feature includes the mean of the pixel values of the baseline distribution function; setting the feature value according to the distribution feature of the baseline distribution function includes: setting the mean of the pixel values of the baseline distribution function as the feature value.
[0053] 150. Based on the feature values, perform anomaly detection on the sample to obtain the detection results.
[0054] In this embodiment, anomaly detection refers to the detection operations required during the sample processing procedure, including at least the detection of the target on the sample surface and the detection of the relative position of the sample and the working equipment. Specifically, the detection of the target includes defect detection and pattern detection, and the position detection specifically includes the detection of the eccentricity between the center of the sample and the working center of the working equipment.
[0055] In one embodiment, anomaly detection of the sample based on the feature value is performed to obtain a detection result, including: taking pixel units corresponding to pixel values exceeding the feature value along the preset direction in the distribution model as target components to be tested; detecting the target of the sample in the image to be tested based on the target components to be tested to obtain a target detection result, wherein the detection result includes the target detection result.
[0056] In this embodiment, the feature value is used to divide the boundary between the target to be tested and the non-target to be tested in the distribution model; based on the boundary, the distribution of the target to be tested in the pixel distribution data can be determined; based on the distribution of the target to be tested in the pixel distribution data, the pixel units belonging to the target to be tested in the image to be tested are determined, and thus the target to be tested in the sample is obtained.
[0057] In another implementation, the pixel distribution features of partial standard structures in multiple original images are determined in each distribution model, and a standard image representing the standard structure is generated based on the pixel distribution features, eliminating the influence of non-standard structures.
[0058] In this embodiment, there are multiple partitions and multiple images to be tested; the method includes: performing the feature value acquisition process on each image to be tested to obtain multiple feature values; performing anomaly detection on the sample based on the feature values to obtain a detection result, including: obtaining a standard image according to the correspondence between the feature values and the position of the partitions, and using the standard image to perform anomaly detection on the sample to obtain a detection result.
[0059] Specifically, anomaly detection of the sample is performed using the standard image to obtain detection results, including: comparing the difference between the standard image and the detected image of the sample, and detecting the target in the sample based on the difference to obtain a target detection result, wherein the detection result includes the target detection result; or, determining the offset between the standard image and the detected image of the sample with respect to the sample position, and determining the positioning detection result of the sample based on the offset, wherein the detection result includes the positioning detection result.
[0060] This anomaly detection based on standard images involves not only detecting the target object on the sample but also performing position detection on the sample. The detection image can be the aforementioned target image or any other image requiring anomaly detection.
[0061] When performing target detection on a sample, the standard image includes a standard structure, while the detection image may include non-standard images in addition to the standard image. The non-standard images in the detection image are determined based on the differences between the two, and the difference data of the non-standard images is the target of the sample.
[0062] When performing position detection on a sample, the standard image and the working equipment have a preset relative positional relationship. The standard image and the detection image are registered, and the positional difference between the two is represented by the offset. Based on the offset and the preset relative positional relationship, the distance information between the sample represented by the detection image and the working stage of the working equipment is determined and used as the positioning detection result.
[0063] Furthermore, when setting the labeled images, the same feature values are set at corresponding positions in the standard image based on the feature values of each image to be tested. These feature values include the mean pixel values, and the same mean pixel values are set at corresponding positions in the standard image.
[0064] Furthermore, due to the influence of the shooting scene or shooting device when each original image is acquired, there may be differences in the pixel information of the same part of the standard structure in different partitions of the same type of partition group. The distribution features obtained by the baseline distribution of the distribution model can more accurately represent the same part of the standard structure.
[0065] In this embodiment, at least a portion of the original image partitions in each of the class partition groups contain a standard structure. These partitions are recorded as standard images using pixel mean values, representing the pixel values acquired by the standard structure within the class partition group under a wide shooting scene or shooting device. Furthermore, when subsequently using this pixel mean value to detect the standard and non-standard structures within the class partition group, a smaller error range can be set to detect the standard structure.
[0066] In addition, the image containing only the standard structure of the sample is named the standard image here. In other embodiments, it can also be a reference image, a gold image, a gold sample, a template image, an ideal image, etc.
[0067] The following is in conjunction with the appendix Figures 1 to 7 The steps of one embodiment of the detection method of the present invention will be described in detail.
[0068] This embodiment uses the example of obtaining the distribution model by fitting the pixel distribution data with a hybrid distribution function to provide a detailed explanation.
[0069] Step 110: Obtain the image of the sample to be tested; In this embodiment, the image of the sample to be tested is acquired using an image acquisition device. The image acquisition device includes any one of the following: optical microscope (microstructure and defects of wafer surface), scanning electron microscope (micromorphology of wafer surface), atomic force microscope (roughness of wafer surface), ellipsometry (photoresist thickness, thin film thickness, refractive index, etc.), four-probe tester (electrical performance parameters of wafer), X-ray diffractometer (crystal structure and stress state of wafer), X-ray photoelectron spectroscopy (elemental composition and chemical state of wafer surface), focused ion beam microscope (wafer micro / nano fabrication analysis), macroscopic ADI equipment (macroscopic detection of pattern defects after photolithography), photomask defect detection equipment (defects on photomask, photolithographic patterns), and transmission electron microscope (microstructure and defects inside the wafer).
[0070] In this embodiment, the target to be tested in the image is a surface defect of the sample. In other embodiments, the target to be tested is a circuit line, solder ball, or TV hole, etc.
[0071] refer to Figure 2 and Figure 3 Step 120 is executed, generating a distribution model 200 based on the image to be tested. The distribution model represents the correspondence between statistical data and pixel values. The statistical data is positively correlated with pixel probability. The pixel probability is the probability of having a corresponding pixel value. The distribution model includes a linear combination of multiple local components 210.
[0072] In this embodiment, generating a distribution model based on the image to be tested includes: obtaining pixel distribution data based on the image to be tested, wherein the pixel distribution data is the correspondence between statistical data and pixel values, the statistical data is positively correlated with statistical probability values, and the statistical probability values are the probability that a pixel in the image to be tested has a certain pixel value; and obtaining a distribution model based on the statistical data.
[0073] In this embodiment, the statistical data is a statistical probability value. In other embodiments, the statistical data can be a statistical quantity or a product of a statistical probability value and a weight.
[0074] For details, please refer to Figure 2 The step 220 of obtaining pixel distribution data from the image to be tested includes: establishing a coordinate system with the pixel values as the horizontal axis and the statistical data as the vertical axis; and mapping the statistical data and pixel values in the coordinate system to obtain the correspondence 230. The statistical data can be pixel probability, the number of pixel units, etc., and the pixel values can be grayscale values. The more pixel units there are, the higher the pixel probability; therefore, the statistical data can be either the number of pixel units or the pixel probability, both of which are positively correlated with the pixel probability.
[0075] Specifically, in combination Figure 2 and Figure 3 Obtaining the distribution model 300 based on the statistical data includes: fitting the pixel distribution data 220 to a mixture distribution function to obtain the distribution model 300, wherein the mixture distribution function is a linear combination of multiple baseline distribution functions. In other embodiments, obtaining the distribution model based on the statistical data includes: using the pixel distribution data 220 as the distribution model 200. That is, in other embodiments, the distribution model 200 can be obtained directly without processing the pixel distribution data 220, in which case the distribution model is a discrete data model.
[0076] For example, if the pixel distribution data 220 is not processed directly, a distribution model is established by statistically analyzing the probability that each pixel value in each pixel unit of the image to be tested is a statistical pixel value; the initial distribution model is obtained based on the correspondence between the pixel value and the probability; a Cartesian coordinate system is established with the first axis and the second axis as coordinate axes, and a probability distribution map is generated in the Cartesian coordinate system based on the statistical results; the distribution model is obtained based on the probability distribution map; wherein, the first axis represents the statistical pixel value, and the second axis represents the probability. That is, relative to the coordinate system composed of the number of pixel units and the pixel value, the number of pixel units can be replaced by the probability.
[0077] Specifically, since the pixel distribution data conforms to a mixture distribution function, function fitting can be performed using the mixture distribution function. Specifically, the mixture distribution function includes a mixture of exponential family distributions, which includes one or more combinations of Gaussian mixture models, Bernoulli mixture models, Poisson mixture models, Laplace mixture models, and t-distributions, separating the target and non-target objects in the image at the pixel distribution level.
[0078] For example, such as Figure 3 As shown, a mixed distribution function is generated based on the image to be tested, resulting in a distribution model 300. The mixed distribution function includes multiple local components 310, each of which follows a standard single exponential distribution function.
[0079] Furthermore, the hybrid distribution function includes multiple parameters to be adjusted. The distribution model is obtained by fitting the pixel distribution data to the hybrid distribution function, including: generating multiple initial local components by setting multiple initial values for the parameters to be adjusted of each of the baseline distribution functions, wherein the parameters to be adjusted at least represent the distribution range of the initial local components; dividing the pixel distribution data into multiple groups of data; determining the initial probability that each group of data belongs to each initial local component; adjusting the parameters to be adjusted for each initial local component based on the initial probability; and obtaining the distribution model based on each initial local component after adjusting the parameters to be adjusted; wherein the distribution range includes the range of the statistical data and the pixel values.
[0080] The parameters to be adjusted include one or a combination of the following: the dispersion index, the mean of the pixel values, and the weights of each baseline distribution function in the mixed distribution function.
[0081] For example, if the parameters to be adjusted include a dispersion index, the mean of the pixel values, and the weights of each reference distribution function in the mixed distribution function, multiple initial values can be set for the dispersion index, the mean of the pixel values, and the weights of each reference distribution function in the mixed distribution function to determine multiple initial local components. That is, each initial local component can be represented by a set of dispersion indices, the mean of the pixel values, and the weights to indicate its distribution range. For example, if the dispersion index range is large, the initial local component will show a "wider distribution range"; if the mean is large, the initial local component will show a "righter distribution range" (the pixel value is on the horizontal axis and increases to the right); if the weight is large, the initial local component will show a "higher peak distribution range".
[0082] In addition, adjusting the parameters to be adjusted based on the initial probability of each initial local component includes: obtaining the adjustment probability of each group of data in the pixel distribution data belonging to each adjusted initial local component and the probability deviation between the adjustment probability and the initial probability according to the adjusted parameters to be adjusted; repeating the steps of obtaining the initial probability to obtaining the probability deviation until a preset condition is met to obtain each local component of the distribution model; wherein, the preset condition includes the number of repetitions reaching a preset number, the probability deviation being less than or equal to a preset value, or convergence.
[0083] Specifically, the baseline distribution function can be an exponential distribution function, which includes the normal distribution function, Gaussian distribution function, Poisson distribution function, or T distribution function, etc.
[0084] If the parameters to be adjusted for each local component include the mixing weights of the baseline distribution function, the method further includes: adjusting the mixing weights of each local component based on the initial probability, and determining the starting point for obtaining the baseline distribution function from each local component based on the magnitude of the adjusted mixing weights, that is, obtaining the local component with the largest peak value based on the magnitude of the adjusted mixing weights, to determine the starting point for the subsequent preset direction. The local component with the largest peak value has the largest weight. (Reference) Figure 4 and Figure 5 Step 130 involves obtaining the distribution characteristics of the benchmark distribution function based on the benchmark distribution 520, wherein the benchmark distribution 520 is based on at least some local components 310 of each local component of the distribution model (e.g., ...). Figure 2 (As shown) confirmed.
[0085] In this embodiment, before obtaining the distribution characteristics of the benchmark distribution function based on the benchmark distribution 520, the method further includes: obtaining at least some of the local components 310 of each local component of the distribution model 300 to obtain the benchmark distribution 520.
[0086] Specifically, the baseline distribution may include a portion of the local components. Obtaining at least a portion of the local components of the distribution model to obtain the baseline distribution includes: determining the peak position of each local component in the distribution model; and sequentially selecting at least a portion of the local components along a preset direction to generate the baseline distribution based on the peak position distance between adjacent local components, wherein the preset direction is from the local component with the largest peak value to other local components.
[0087] It should be noted that if the statistical data is distributed on both sides of the maximum peak, then there are two preset directions, which are respectively along the positive and negative directions of the coordinate system; if the statistical data is distributed on one side of the maximum peak, then there is one preset direction, which is along the positive direction of the coordinate system.
[0088] Specifically, the peak positions of the image under test can, to some extent, indicate whether a local component belongs to the target, a non-target, or noise. Peak positions that are close together are more likely to belong to the same type of region. Based on this, according to the distance between the peak positions of each local component, some local components belonging to the same type of region are selected in a preset direction, and a baseline distribution is generated based on the selected local components.
[0089] Determining the peak position of each local component in the distribution model includes: obtaining the pixel value position of the local component with the maximum statistical data, or, the parameter to be adjusted includes the mean, obtaining the mean position of each local component as the peak position.
[0090] For example, such as Figure 4 As shown, for the multiple local components generated for the image under test, the peak positions of the first local component 410 are relatively close, and it can be identified as a first type region (such as the target under test); the peak positions of the second local component 420 are also relatively close, and it can be identified as a second type region (such as a non-target under test). When selecting local components along the preset direction 430, the second local component 420 can be selected, and a reference distribution is generated based on the second local component 420.
[0091] In this embodiment, the reference distribution may include only one local component; the distance between the reference distribution and the adjacent peak position of the previous local component is less than or equal to a preset distance threshold, and the distance between the reference distribution and the adjacent peak position of the next local component is greater than or equal to a preset distance threshold; based on the peak position distance between each adjacent local component, at least some of the local components are sequentially selected along a preset direction to generate the reference distribution, including: determining a first group of adjacent local components whose adjacent peak position distance exceeds a preset distance threshold along the preset direction; selecting the first local component in the first group of adjacent local components to obtain the reference distribution; or, determining a last group of adjacent local components whose adjacent peak position distance does not exceed a preset distance threshold along the preset direction; selecting the last local component in the last group of adjacent local components to obtain the reference distribution; or, determining a local component whose adjacent peak position distance from the previous local component is less than a preset distance threshold and whose adjacent peak position distance from the next local component is greater than a preset distance threshold as the reference distribution.
[0092] In this embodiment, every two adjacent local components whose distance between adjacent peak positions does not exceed a preset distance threshold are determined to be local components belonging to the same type of region. This continues until the first group of adjacent local components whose distance between adjacent peak positions exceeds the preset distance threshold, or the last group of adjacent local components whose distance between adjacent peak positions does not exceed the preset distance threshold, is detected. Then, the preceding local component in the first group of adjacent local components, or the following local component in the last group of adjacent local components, can be determined as the boundary local component of the same type of region. A benchmark distribution function is then fitted based on this boundary local component.
[0093] Specifically, the intermediate local components can be further comprehensively judged. The intermediate local components must meet the following conditions: the distance from the peak position of the previous local component is less than a preset distance threshold, and the distance from the peak position of the next local component is greater than a preset distance threshold.
[0094] For example, such as Figure 5 As shown, the preset distance threshold is D. When the peak position distance d1 of the first group of adjacent local components 510 is detected to be greater than D along the preset direction, the local component (i.e., local component 520) that is earlier in the first group of adjacent local variables 510 is selected to generate the benchmark distribution function. When the peak position distance d2 of the last group of adjacent local components 530 is detected to be less than D along the preset direction, the local component (i.e., local component 520) that is later in the last group of adjacent local variables 430 is selected to generate the benchmark distribution function.
[0095] In this embodiment, the peak values of each local component exhibit a decreasing trend along the preset direction, and a baseline distribution is determined based on this decreasing trend. Local components representing non-target objects (such as the background) typically have larger peak values, while local components representing target objects (such as defects) typically have smaller peak values. A baseline distribution is determined from each local component, and a baseline distribution function is generated using the baseline distribution, wherein the baseline distribution includes one local component.
[0096] If a certain local component is identified among the local components, and its distance from the peak position of the preceding local component along a preset direction is less than a preset distance threshold, and its distance from the peak position of the following local component is greater than a preset distance threshold, then this certain local component is identified as the baseline distribution.
[0097] In one embodiment, based on the imaging state of the target in the image to be tested, the preset direction includes a positive direction, a negative direction, or both directions along a preset coordinate axis, wherein the coordinate axis is oriented towards the distance from the peak position. The preset coordinate axis is the abscissa axis of the statistical coordinate system.
[0098] For example, the target to be tested is a first pixel value range, and the non-target to be tested is a second pixel value range. In the pixel distribution data: the first pixel value range is generally larger than the second pixel value range (there may be some overlapping pixel value ranges), the first pixel value range is generally smaller than the second pixel value range (there may be some overlapping pixel value ranges), or the first pixel value range is within the second pixel value range.
[0099] In one embodiment, if the pixel distribution data shows that the first pixel value range is generally greater than the second pixel value range, then the preset direction is the opposite direction along the preset coordinate axis; if the imaging state shows that the first pixel value range is generally less than the second pixel value range, then the preset direction is the positive direction along the preset coordinate axis; if the imaging state shows that the first pixel value range is within the second pixel value range, then the preset direction is both the positive and negative directions along the preset coordinate axis.
[0100] In one embodiment, if the imaging state is such that the first pixel value range is generally greater than the second pixel value range, then the preset direction is the positive direction along the preset coordinate axis; if the imaging state is such that the first pixel value range is generally less than the second pixel value range, then the preset direction is the negative direction along the preset coordinate axis; if the imaging state is such that the first pixel value range is within the second pixel value range, then the preset direction is both the positive and negative directions along the preset coordinate axis.
[0101] Wherein, if the range of the second pixel value includes the first sub-range and the second sub-range, the range of the first pixel value being within the range of the second pixel value includes the range of the first pixel value being between the first sub-range and the second sub-range.
[0102] In one embodiment of this example, at least a portion of the local components are sequentially selected along a preset direction to generate the reference distribution based on the peak position distance between each adjacent local component, including: referencing Figure 6 Local components 610 whose distance from the peak position of the previous local component does not exceed a preset distance threshold are sequentially determined along a preset direction. Each local component 610 whose distance from the peak position of the previous local component does not exceed the preset distance threshold is merged to obtain a reference distribution 620. The distribution characteristics of the reference distribution function are obtained based on the reference distribution 620, including: performing function fitting on the reference distribution 620 through a preset distribution function to obtain the distribution characteristics of the reference distribution function, wherein the preset distribution function is a single reference distribution function.
[0103] In this embodiment, adjacent local components whose peak position distance does not exceed a preset distance threshold are merged to obtain a baseline distribution, which is then used to fit the baseline distribution function. Compared to using boundary local components to fit the baseline distribution function, detecting local components belonging to the same type of region from a larger dataset can avoid false detections caused by small noise fluctuations in the image under test.
[0104] For example, such as Figure 6 As shown, each adjacent local component 610 whose peak position distance does not exceed a preset distance threshold is determined, and each adjacent local component 610 is merged to obtain a reference distribution 620. A reference distribution function is then fitted based on the reference distribution 620.
[0105] The preset distribution function can be a Mixture of Exponential Family (M&A) distribution to fit the curve, such as at least one of the following baseline distribution functions: Gaussian model, Bernoulli model, Poisson model, Laplace model, or t-distribution.
[0106] Specifically, merging all local components whose distance from the peak position of the previous local component does not exceed a preset distance threshold to obtain a baseline distribution includes: merging all local components whose distance from the peak position of the previous local component does not exceed the preset distance threshold along a preset direction; or, determining whether the distance from the peak position of the previous local component exceeds the preset distance threshold along a preset direction. If not, merging adjacent local components to obtain an initial merged component, and determining whether the distance between the adjacent peak positions of the initial merged component and the next adjacent local component exceeds the preset distance threshold. If not, merging the initial merged component and the next adjacent local component respectively to form a new initial merged component; repeating the step of determining whether the distance between the adjacent peak positions of the initial merged component and the next adjacent local component exceeds the preset distance threshold until the distance between the adjacent peak positions of the initial merged component and the next adjacent local component exceeds the preset distance threshold.
[0107] For example, Figure 6 A schematic diagram is provided showing how to merge all adjacent local components 610 whose peak position distance does not exceed a preset distance threshold into a single merged component 620; in this application Figure 7 In the illustrated embodiment, the merged component is obtained by successively merging the distances adjacent to the previous peak value. Please refer to [link to previous document]. Figure 7 Two adjacent local components 710 whose peak position distance does not exceed a preset distance threshold are merged to obtain an initial merged component 720. If the peak position distance d3 between the initial merged component 720 and the next adjacent local component 730 does not exceed a preset distance threshold D, the initial merged component 720 and the next adjacent local component 730 are merged again. If the peak position distance d3 between the initial merged component 720 and the next adjacent local component 730 exceeds the preset distance threshold D, the initial merged component 720 is taken as the merging result, and a benchmark distribution function is fitted based on the initial merged component 720.
[0108] The merging includes: linearly combining the local components; specifically, in this embodiment, the parameters to be fitted include weights, and linearly combining the local components includes: weighting each local component using the weights.
[0109] Step 140: Set feature values according to the distribution characteristics of the baseline distribution function; perform anomaly detection on the sample based on the feature values to obtain the detection results.
[0110] In this embodiment, the distribution features are related to the parameters to be adjusted. The parameters to be adjusted include a dispersion index, the mean of the pixel values, and the weights of each baseline distribution function in the mixed distribution function. The distribution features include one or more of the dispersion index, the mean of the pixel values, and the weights. Based on the feature values set for different distribution features, corresponding algorithms are used to determine the target to be tested in the sample.
[0111] For example, if the feature value is set based on the dispersion index and the mean of the pixel values, a filtering algorithm is used to determine the target in the sample, such as screening or removing a portion of the image in the image to be tested to determine the target; if the feature value is set based on the mean of the pixel values, a template matching algorithm is used to determine the target in the sample, such as generating a standard image to match the original image / image to be tested to determine the target.
[0112] Figures 8 to 10 This is a schematic diagram of the structure of the second embodiment of the detection method of the present invention.
[0113] The following is combined with Figures 8-10 In this embodiment, the pixel distribution data is used as the distribution model. The similarities between this embodiment and the previous embodiment will not be repeated here. The differences include: Perform step 110 to obtain the image of the sample to be tested; In this embodiment, the pixel resolution of the image to be tested is obtained, and the total number of pixel units in the image to be tested is determined based on the pixel resolution; for example, if the pixel resolution of the image to be tested is x*y, then the total number of pixel units in the image to be tested is N=x*y; for example, the pixel resolution can be 4096*3000, 3680*2760, 1920*1080, 640*640, 512*512, etc.
[0114] Please refer to Figure 8 Step 120: Generate a distribution model based on the image to be tested. The distribution model represents the correspondence between statistical data and pixel values. The statistical data is positively correlated with pixel probability. The pixel probability is the probability of having a corresponding pixel value. The distribution model includes a linear combination of multiple local components. Generating a distribution model based on the image to be tested includes: obtaining pixel distribution data based on the image to be tested, wherein the pixel distribution data is the correspondence between statistical data and pixel values, the statistical data is positively correlated with statistical probability values, and the statistical probability values are the probability that a pixel in the image to be tested has a certain pixel value; and obtaining the distribution model based on the pixel distribution data.
[0115] In this embodiment, the pixel values contained in the image to be tested include: P1, P2, ..., Pi. Statistical data K1, K2, ..., Ki for each pixel value P1, P2, ..., Pi are obtained. A correspondence between each statistical data point and the pixel value is established: {(P1, K1), (P2, K2), ..., (Pi, Ki)}, resulting in pixel distribution data. The statistical data includes either the number of pixel units for each pixel value or the pixel probability for each pixel value. If the statistical data is the number of pixel units, then K1 + K2 + ... + Ki = N; if the statistical data is the pixel probability, then K1 + K2 + ... + Ki = 1.
[0116] In one embodiment, the pixel value is a grayscale value, and the pixel values P1, P2, ... Pi range from 0 to 255. Further, the pixel values P1, P2, ... Pi are sequentially set from 0 to 255 according to their size.
[0117] In this embodiment, obtaining pixel distribution data based on the image to be tested includes: counting the number of pixel units for each pixel value in the image to be tested to obtain a statistical quantity; obtaining statistical data based on the statistical quantity; and obtaining the pixel distribution data based on the correspondence between the pixel value and the statistical data.
[0118] Specifically, the number of pixel units is the statistical quantity, which is used as the statistical data. The ratio of the statistical quantity to the total number of pixel units in the image under test is used as the pixel probability, and this pixel probability is used as the statistical data. Alternatively, the pixel probability can be multiplied by a weight to obtain the statistical data.
[0119] Obtaining the pixel distribution data based on the correspondence between the pixel values and the statistical data includes: establishing a statistical coordinate system with the pixel values and statistical data as coordinate axes respectively; mapping the pixel values and statistical data of the image to be tested to the statistical coordinate system to obtain the pixel distribution data 810, wherein the pixel distribution data can be represented as a histogram, line graph, etc. in the statistical coordinate system.
[0120] For example, such as Figure 8As shown, the statistical coordinate system illustrates two presentation formats for pixel distribution data: a histogram 810 and a line graph 820. In the histogram 810, the height of each bar 811 on the vertical axis represents the statistical data size of a certain pixel value or range of pixel values; in the line graph 820, the height of each point 821 on the vertical axis represents the statistical data size of a certain pixel value or range of pixel values. In this embodiment, the pixel distribution data is used as the distribution model, meaning that the histogram 810 or the line graph 820 can be directly used as the distribution model.
[0121] refer to Figure 9 Step 130: Obtain the distribution characteristics of the benchmark distribution function based on the benchmark distribution, wherein the benchmark distribution is determined based on at least some local components of each local component of the distribution model; Before obtaining the distribution characteristics of the benchmark distribution function based on the benchmark distribution, the method further includes: obtaining at least some of the local components in each local component of the distribution model to obtain the benchmark distribution; obtaining at least some of the local components in each local component of the distribution model to obtain the benchmark distribution includes: determining the peak position of each local component in the distribution model; and selecting at least some of the local components sequentially along a preset direction to generate the benchmark distribution based on the peak position distance between each adjacent local component, wherein the preset direction is from the local component with the largest peak value to other local components.
[0122] In this embodiment, determining the peak position of each local component in the distribution model includes: fitting multiple fitting curves based on the changes in pixel distribution data. Each fitting curve corresponds to each local component, and the maximum statistical data in each fitting curve is the peak value, with the pixel value corresponding to the maximum statistical data being the peak position. The pixel distribution data of each fitting curve exhibits an inverted U-shaped variation, i.e., the statistical data is small at both ends and large in the middle.
[0123] For example, the fitted curve of the distribution model is obtained by fitting a multinomial function, and the coefficient of determination (R²) is used to determine the curve. 2 The fitting curve is used to measure the fit of the distribution model; wherein, a determination coefficient threshold is set, and when the determination coefficient exceeds the determination coefficient threshold, the fitting curve is determined to satisfy the fit of the distribution model.
[0124] like Figure 9 As shown, the distribution model is a histogram, generating a fitting curve 910 for the distribution model. Based on the inverted U-shaped variation of the pixel distribution data, the fitting curve 910 is divided into three fitting curves 920. The maximum statistical data corresponding to each fitting curve 920 is determined by the bar 930, thereby obtaining the peak value and peak position.
[0125] In another implementation, determining the peak position of each local component in the distribution model includes: determining each minimum statistical data in the distribution model, using the pixel distribution data corresponding to the minimum statistical data as a boundary, and dividing the distribution model into multiple local components; wherein, the pixel distribution data corresponding to every two minimum statistical data in the distribution model constitutes a local component; the maximum statistical data in each local component is the peak value, and the pixel value corresponding to the maximum statistical data is the peak position.
[0126] In this embodiment, at least some of the local components are selected sequentially along a preset direction to generate the benchmark distribution based on the peak position distance between each adjacent local component. This includes: determining the peak position distance between the maximum statistical data in each local component, selecting local components whose peak position distance does not exceed a preset distance threshold along the preset direction, and obtaining the benchmark distribution based on the selected local components.
[0127] The baseline distribution is a partial pixel distribution data. The distribution characteristics of the baseline distribution function are obtained based on the baseline distribution, including fitting the baseline distribution with a preset distribution function to obtain the distribution characteristics of the baseline distribution function. The distribution function is a single baseline distribution function.
[0128] In this embodiment, a preset distribution function is used to fit the pixel distribution data corresponding to the baseline distribution to obtain the distribution characteristics of the baseline distribution function. For example, as shown... Figure 10 As shown, the local component corresponding to the fitted curve 1010 is the baseline distribution. The pixel distribution data corresponding to the baseline distribution (as shown in each bar 1020) is fitted using a preset distribution function to obtain the baseline distribution function (as shown in distribution 1030). The distribution characteristics are determined on the baseline distribution function generated by the fitting.
[0129] Step 140: Set feature values according to the distribution characteristics of the baseline distribution function; perform anomaly detection on the sample based on the feature values to obtain the detection results.
[0130] Figure 11 This is a schematic diagram of the third embodiment of the detection method of the present invention.
[0131] Please continue reading below. Figures 1-3 and combination Figure 11 In this embodiment, the images to be tested are continuous images acquired from the same sample. The similarities between this embodiment and the previous embodiment will not be repeated here. The differences include: Step 110: Obtain the image of the sample to be tested; In this embodiment, the image to be tested is a difference image of the sample, which is a difference map between the sample image and a preset standard image. The standard image refers to an image that does not include the target to be tested, and only includes the non-target target relative to the image to be tested. In other embodiments, the surface to be tested on the sample is a smooth surface or a surface with uniform roughness; the target to be tested is a defect; and the image to be tested is a sample image of the sample.
[0132] The steps for acquiring the image to be tested include: taking a picture of the sample using an image acquisition device to acquire a sample image of the sample surface to be tested; and performing a difference analysis between the sample image and a preset standard image to obtain the difference image.
[0133] The method of differentially analyzing the sample image and a preset standard image includes: obtaining the difference values of pixels at corresponding positions in the sample image and the preset standard image to obtain the differential image. The difference values are either the difference between the pixel values at corresponding positions in the sample image and the preset standard image, or the pixel difference is the absolute value of the difference between the pixel values at corresponding positions in the sample image and the preset standard image.
[0134] In this embodiment, the target to be tested is a surface defect of the sample. In other embodiments, the target to be tested is a circuit line, solder ball, or TV hole, etc.
[0135] In this embodiment, the difference map represents the feature region of the target under test. After generating the distribution model, most of the local components at the peak position are used to represent the feature region of the target under test.
[0136] Specifically, in this embodiment, the standard image is an image of a standard sample that includes only the pattern area and the background area, but has no defects; or the standard image is a design drawing.
[0137] Step 120: Generate a distribution model based on the image to be tested. The distribution model represents the correspondence between statistical data and pixel values. The statistical data is positively correlated with pixel probability. The pixel probability is the probability of having a corresponding pixel value. The distribution model includes a linear combination of multiple local components. Generating a distribution model based on the image to be tested includes: obtaining pixel distribution data based on the image to be tested; and obtaining a distribution model based on the statistical data.
[0138] Please continue reading. Figure 2The pixel distribution data acquisition 220 based on the image to be tested includes: establishing a coordinate system with the pixel values as the abscissa and the statistical data as the ordinate; mapping the statistical data and the pixel values in the coordinate system to obtain the correspondence 230. In this embodiment, if the image to be tested is a difference value and the statistical data is the difference value, then the correspondence 230 is a distribution that is approximately symmetrical with respect to the ordinate axis, and the statistical data is distributed on both sides of the maximum peak of the correspondence; if the statistical data is the absolute value of the difference, then the statistical data is only distributed on one side of the maximum peak of the correspondence.
[0139] Please continue reading. Figure 2 and Figure 3 Obtaining the distribution model 300 based on the statistical data includes: fitting the pixel distribution data 220 to a mixture distribution function to obtain the distribution model 300, wherein the mixture distribution function is a linear combination of multiple baseline distribution functions. In this embodiment, the mixture distribution function includes a mixture Gaussian distribution, which is a linear combination of multiple Gaussian distributions, i.e., each local component 310 follows a standard Gaussian distribution.
[0140] For example, in this embodiment, the statistical data is pixel probability, and the image to be tested is a difference image. The statistical data and the pixel values have a Gaussian mixture distribution. The mixture distribution function is a Gaussian mixture distribution function, and the baseline distribution function is a Gaussian distribution. For example, the Gaussian mixture distribution function is multiple Gaussian distributions. A linear combination of (local components) is used, and density modeling is performed using the probability density function. The details are as follows: ; ; Where x represents the pixels of each pixel or region as the minimum distribution granularity, and μ is the mean. For mean squared error, For the j-th Gaussian distribution, The weights are for the j-th Gaussian distribution, which includes a total of k Gaussian distributions.
[0141] Furthermore, the hybrid distribution function includes multiple parameters to be adjusted. The distribution model is obtained by fitting the pixel distribution data to the hybrid distribution function, including: generating multiple initial local components by setting multiple initial values for the parameters to be adjusted of each of the baseline distribution functions, wherein the parameters to be adjusted at least represent the distribution range of the initial local components; dividing the pixel distribution data into multiple groups of data; determining the initial probability that each group of data belongs to each initial local component; adjusting the parameters to be adjusted for each initial local component based on the initial probability; and obtaining the distribution model based on each initial local component after adjusting the parameters to be adjusted; wherein the distribution range includes the range of the statistical data and the pixel values.
[0142] For example, this embodiment will continue to use the probability density function of the mixture Gaussian distribution function to represent the distribution model as an example for illustration: This section details the methods for obtaining the distribution model, including: (1) Generate multiple initial local components by setting multiple initial values for the parameters to be adjusted of each of the aforementioned reference distribution functions, including: the number of local components is k, such as k being any number from 3 to 10, or a variable number, and pre-setting the parameters to be adjusted ( Each component is given k initial values, generating k initial local components. In this embodiment, the mixture distribution function is a Gaussian mixture distribution function, and the reference distribution function is a Gaussian distribution function. Specifically, the reference distribution function is... ; (2) Dividing the pixel distribution data into multiple groups, including dividing the pixel distribution data into n groups; determining the initial probability that each group of data in the pixel distribution data belongs to each of the initial local components, including: obtaining the initial probability that the x-th group of pixel distribution data belongs to the j-th initial local component: ; (3) Based on probability Adjust the parameter to be adjusted ( The parameter value of ), where, , , ; (4) Based on the adjusted parameters to be adjusted ( This allows us to obtain the distribution range of each new local component and generate a distribution model. In this embodiment, (1)-(4) are executed once or (1)-(4) are repeated until a preset number of times or convergence is achieved, resulting in multiple optimized parameters to be adjusted. Obtaining the optimized parameters to be adjusted determines the standard distribution function of each optimization, which in turn yields each local component. Each local component can be used to obtain the distribution model of the image under test.
[0143] Adjust the parameter to be adjusted The parameter values are used to adjust the number of pixel units and the range of pixel values belonging to each local component. The parameters to be adjusted include a dispersion index. The average value of the pixel values and the weights of each benchmark distribution function in the mixed distribution function. .
[0144] The parameters to be adjusted for each of the local components include the mixed weights of the baseline distribution function. The mixing weights of each local component are adjusted based on the probability. The subsequent baseline components are determined based on the adjusted mixed weights to obtain the starting point of the baseline distribution function; wherein, the mixed weights can be set in any order of magnitude after adjustment. The local component (i.e. the i-th local component) is used as the reference component.
[0145] Step 130: Obtain the distribution characteristics of the benchmark distribution function based on the benchmark distribution, wherein the benchmark distribution is determined based on at least some local components of each local component of the distribution model; Before obtaining the distribution characteristics of the benchmark distribution function based on the benchmark distribution, the method further includes: obtaining at least some of the local components in each local component of the distribution model to obtain the benchmark distribution, specifically including: determining the peak position of each local component in the distribution model; and selecting at least some of the local components sequentially along a preset direction to generate the benchmark distribution based on the peak position distance between each adjacent local component, wherein the preset direction is from the local component with the largest peak value to other local components.
[0146] In this embodiment, when the image to be tested is a sample image, the peak position can indicate whether the local component belongs to the target to be tested or not. When the image to be tested is a difference image, the peak position usually represents the target to be tested, and the distance between the peak positions may represent noise. Based on the different peak positions, the local components are selected to generate a baseline distribution.
[0147] Please see Figure 11 Step 140: Set feature values according to the distribution characteristics of the benchmark distribution function; perform anomaly detection on the sample based on the feature values to obtain the detection results.
[0148] In this embodiment, the distribution characteristics include the dispersion index of the baseline distribution function and the mean of the pixel values; setting feature values based on the distribution characteristics of the baseline distribution function includes setting a feature value as a linear combination of the dispersion index and the mean of the pixel values. The mean of the pixel values can be the pixel values at the peak positions of the baseline distribution function.
[0149] Specifically, dispersion indexes are indicators that measure the dispersion or clustering of pixel values, including indicators such as range, variance, and standard deviation.
[0150] If the coefficient of the mean of the pixel value is zero, then the linear combination of the dispersion index and the mean of the pixel value is a multiple of the dispersion index; the linear combination of the dispersion index and the mean of the pixel value is set as a feature value, including: setting the multiple value of the dispersion index as the detection threshold.
[0151] By setting a multiple of the dispersion index as the feature value, most pixel values concentrated in the baseline distribution function are filtered out. The remaining local components likely represent the target being measured.
[0152] For example, the distribution model could be the probability density function of the aforementioned Gaussian mixture model, and the baseline distribution function could also be a Gaussian distribution: Then the eigenvalues are set as the dispersion index. The preset multiple value K can be 2, 3, 4, 5, 6, etc.; in other embodiments, the multiple K may not be an integer. If the coefficient of the dispersion index in the linear combination is 1, the linear combination of the dispersion index and the mean of the pixel value is set as the feature value, including: If the preset direction is along the positive direction of the preset coordinate axis, then the feature value T is set as: T = P + K * D; if the preset direction is along the negative direction of the preset coordinate axis, then the feature value T is set as: T = PK * D; if the preset direction is along both the positive and negative directions of the preset coordinate axis, then the feature value T is set as: T = (P1 - K * D, P2 + K * D); where the coordinate axis is oriented towards the distance from the peak position, P, P1, and P2 are the mean values of the pixel values of the baseline distribution function on the coordinate axis, D is the variance of the pixel values of the baseline distribution function on the coordinate axis, K is a preset multiple, and the dispersion index includes the variance. The relationship between P1 and P2 can be: P1 = P2, or P1 ≠ P2.
[0153] For example, such as Figure 11 If the preset direction 1110 is the opposite direction along the preset coordinate axis, then the feature value T is set to: T = PK * D; if the preset direction 1120 is the positive direction along the preset coordinate axis, then the feature value T is set to: T = P + K * D; if the preset direction 1130 is both the positive and negative directions along the preset coordinate axis, then the feature value T is set to: T = (P1 - K * D, P2 + K * D), where P1 = P2 = P.
[0154] In addition, if the preset direction is the positive or negative direction along the preset coordinate axis, the feature value T is also set as: T = (P1 - K * D, P2 + K * D), where one side may not have local components.
[0155] In this embodiment, the pixel units corresponding to pixel values exceeding the feature values along the preset direction in the distribution model are taken as target components to be tested; the target components to be tested are used to detect the target of the sample in the image to be tested, and a target detection result is obtained, the detection result including the target detection result.
[0156] In addition, the parameters of the preset coordinate axis represent pixel values, used to determine the peak position of each local component. The other coordinate axis, perpendicular to it, represents the number of pixel units or pixel probability, used to determine the peak value of each local component. Feature values are set on the coordinate axis containing the pixel values. After determining the pixel values of the feature values, the pixel units corresponding to pixel values exceeding the feature values are identified as the target component to be measured. The region containing the pixel values of the target component to be measured is extracted from the image to be measured; this extracted region is the target component to be measured in the image to be measured.
[0157] Figures 12 to 16 This is a schematic diagram of the fourth embodiment of the detection method of the present invention.
[0158] The following is combined with Figures 12-17 In this embodiment, the image to be tested is an image collected from different partitions of the same sample or a combination of images from different samples. The similarities between this embodiment and the previous embodiment will not be repeated here. The differences include: See Figure 12 Perform step 110 to obtain the image of the sample to be tested; In this embodiment, the number of samples is multiple, or the samples include multiple divided regions, wherein each sample includes at least a standard structure, and each sample includes the same standard structure, or each divided region includes the same standard structure; the multiple original images are respectively acquired from the standard structures of multiple samples; or, the multiple original images are respectively acquired from the standard structures of multiple divided regions of at least one sample. Figure 12 As shown, an original image is acquired for the entire sample 1210, or an original image is acquired for any segmented region 1220 of the sample.
[0159] Before obtaining at least one class partition group based on the plurality of original images, the method further includes: aligning the plurality of original images to determine partitions in the plurality of original images that correspond to the same sample region; wherein each of the original images includes a standard structural pattern, the standard structural pattern being used to represent at least a portion of the standard structure; aligning the different original images includes: aligning the standard structural patterns in the different original images.
[0160] In this embodiment, the standard structure includes at least a sample surface pattern and a sample background. A first standard structure pattern is generated based on the surface pattern, and a second standard structure pattern is generated based on the sample background. The different original images are aligned using at least one of the first and second standard structure patterns.
[0161] In one implementation, an alignment algorithm is directly performed on each of the original images, and the output result aligns the standard structural patterns of the different original images. However, since the original images include randomly occurring non-standard structural patterns, the alignment result may be affected and reduced by these non-standard structural patterns. In another implementation, alignment is performed only on the first standard structural pattern or the second standard structural pattern. The original images are further preprocessed so that at least a portion of the first or second standard structural pattern is extracted and processed from the original images before the alignment algorithm is executed.
[0162] In addition, the standard structure also includes an identifier structure, which includes: flat edges, grooves, and preset directional identifiers (such as arrows, triangles, or other fixed-shape patterns that can simultaneously identify position and direction, etc., which are not surface patterns). Aligning the different original images includes aligning the identifier structure patterns in the different original images.
[0163] See Figures 13-15 Step 120: Generate a distribution model based on the image to be tested. The distribution model represents the correspondence between statistical data and pixel values. The statistical data is positively correlated with pixel probability. The pixel probability is the probability of having a corresponding pixel value. The distribution model includes a linear combination of multiple local components. In this embodiment, non-standard structures and standard structures present different pixel information in the image under test. Based on the image under test, a distribution model representing each partition in the class partition group is generated, and the pixel distributions of the partitions of the multiple original images containing non-standard structures and standard structures are significantly distinguished in the distribution model.
[0164] The method for generating a distribution model based on the image under test includes: obtaining pixel distribution data from the image under test, wherein the pixel distribution data is the correspondence between statistical data and pixel values, the statistical data is positively correlated with statistical probability values, and the statistical probability values are the probability that a pixel in the image under test has a certain pixel value; and fitting the pixel distribution data to a mixed distribution function to obtain the distribution model, wherein the mixed distribution function is a linear combination of multiple benchmark distribution functions.
[0165] In this embodiment, if each original image includes m partitions, then m class partition groups, m images to be tested, m sets of pixel distribution data, and m distribution models are obtained.
[0166] If the original image contains n images, a class partition group consists of n partitions, corresponding to a set of pixel distribution data, and generates a distribution model. For example... Figure 13 As shown, there are n original images {C1, C2, C3, ..., Cn-2, Cn-3, Cn}. Pixel information of pixel units in n partitions is obtained from the n original images to obtain pixel information 1310 of a partition group. Pixel distribution data of the partition group is generated based on the pixel information of the n partitions and used to generate the distribution model 1320 of the partition group.
[0167] Each partition includes one or more pixel units. When each partition includes one pixel unit, the localization granularity is finer, and when each partition includes multiple pixel units, fewer distribution models need to be processed. The former generates more accurate standard images, while the latter generates standard images with higher detection efficiency.
[0168] In one implementation, each partition includes a pixel unit, and each class partition group corresponds to one pixel position in the original image. A set of pixel distribution data for a class partition group is obtained from the same pixel position in the multiple original images, and a distribution model is generated. For example... Figure 14 As shown, n pixel units of the target pixel position 1410 are obtained from n original images {C1, C2, C3, ..., Cn-2, Cn-3, Cn} respectively; the pixel values 1420 of the n pixel units are counted to obtain the pixel distribution data of the class partition group, and used to generate the distribution model 1430 of the target pixel position 1410.
[0169] In another embodiment, the partition comprises multiple pixel units, such as Figure 15As shown, each partition includes 3*3 pixel units; the pixel units of target partition 1510 are obtained from n original images {C1, C2, C3, ..., Cn-2, Cn-3, Cn} respectively; the pixel mean 1520 of each target partition in the n target partitions 1510 is determined, and the pixel distribution data of the partition group is obtained. For example, the pixel values of each pixel unit in target partition 1530 of original image C3 are {87, 88, 88, 91, 90, 89, 89, 89, 90}, and the pixel mean of target partition 1530 is determined to be 89; the distribution model 1540 of target partition 1510 is generated based on the pixel distribution data.
[0170] Furthermore, if the partition comprises multiple pixel units, the following steps are performed: target segmentation is performed on each of the original images to obtain a segmentation result; multiple segmentation regions are determined on each of the original images based on the segmentation result; multiple partitions are determined for each of the original images based on the segmentation regions, wherein each partition is located within one of the segmentation regions. Dividing the same segmentation region into multiple partitions makes the pixel values of each pixel unit within the partition closer, which facilitates accurate representation of the pixel values of the partition and the generation of the final standard image.
[0171] In this embodiment, the segmentation regions include standard structures such as surface patterns and sample backgrounds on the original image, as well as non-standard structures such as various types of defects. Each image to be tested is segmented based on these multiple segmentation regions. Partitions containing multiple pixel units are grouped into the same segmentation region, such as belonging to one of the segmentation regions of surface patterns, sample backgrounds, or defects. This ensures that the pixel values of each pixel unit within the partition are the same or similar, and the average pixel value can more accurately represent the partition.
[0172] Furthermore, if the partition comprises multiple pixel units, then the partition can specifically be a linear partition containing multiple pixel units, wherein the linear partition satisfies at least one of the following conditions: each linear partition partially overlaps or contacts but does not overlap, or each linear partition has a preset angle, or the linear partition is located at the edge of the sample. Standard images can be established for linear defects such as edge chipping, lattice defects, and scratches, without considering other types of defects such as systematic defects, pattern defects, and particulate contamination.
[0173] In this embodiment, the preset angle includes 0°-360°, and each linear partition can also be set to at least one of intervals of 15, 30, 45, 60, and 90°; preferably, the preset angle is 0° (180°, 360°) or 90° (180°), that is, the horizontal angle and the vertical angle.
[0174] See Figure 16Step 130: Obtain the distribution characteristics of the benchmark distribution function based on the benchmark distribution, wherein the benchmark distribution is determined based on at least some local components of each local component of the distribution model; In this embodiment, non-standard structures (such as defects) are randomly generated at any location in the sample and displayed in the original image. The defects in the sample follow these generation characteristics: the probability of a defect being generated at the same location in multiple samples or multiple segmented regions decreases as the number of generated defects increases; for example, the probability of a defect being generated at the same location in a preset number of samples or segmented regions is lower than a preset threshold; preferably, a defect will not be generated at the same location in any two samples or any two segmented regions. In this embodiment, this can be expressed as: the probability of a defect existing in the same corresponding partition of multiple original images decreases as the number of existing defects increases, and preferably, the defect will not exist in partitions of the same type of partition group in any two original images.
[0175] In this embodiment, based on the aforementioned generation characteristics of non-standard structures, the number of original images with non-standard structures in the same type of partition group is far less than the number of original images with standard structures. Therefore, the pixel distribution of the concentrated pixel distribution in the distribution model is determined as the pixel distribution of the standard structure, which is used as the range for determining the baseline distribution. Conversely, the baseline distribution is set as the pixel distribution of the concentrated pixel distribution in the distribution model, and the pixel distribution characteristics of the baseline distribution are the pixel distribution characteristics of the concentrated pixel distribution.
[0176] In this embodiment, the pixel distribution of the multiple original images in the same partition group includes at least a pixel-concentrated distribution region, and may further include a pixel-sparse distribution region; the pixel-concentrated distribution region is generated by pixel units of a standard structural pattern, and the pixel-sparse distribution region is generated by pixel units of a non-standard pattern; a baseline distribution is determined based on the pixel units of at least a portion of the original images represented by the pixel-concentrated distribution region.
[0177] like Figure 16As shown, the pixel distribution data of the multiple original images in the first class partition group 1610 generates the first distribution model 1611, the pixel distribution data of the multiple original images in the second class partition group 1620 generates the second distribution model 1621, and the pixel distribution data of the multiple original images in the third class partition group 1630 generates the third distribution model 1631. A first baseline distribution 1612, a second baseline distribution 1622, and a third baseline distribution 1632 are obtained from the first distribution model 1611, the second baseline distribution 1622, and the third baseline distribution 1631, respectively. A first pixel mean 1613, a second pixel mean 1623, and a third pixel mean 1633 are determined from the first baseline distribution 1612, the second baseline distribution 1622, and the third baseline distribution 1632, respectively, and used as the pixel distribution features of the first distribution model 1611, the second distribution model 1621, and the third distribution model 1631, respectively. This process continues until the pixel distribution features of all partitions are obtained.
[0178] Continue reading Figure 16 Step 140: Set feature values according to the distribution characteristics of the benchmark distribution function; perform anomaly detection on the sample based on the feature values to obtain the detection results.
[0179] In this embodiment, a pixel distribution feature is obtained for a class partition group, and the pixel value of the partition is determined based on the pixel distribution feature; based on the pixel values determined by all partitions, a reference image of the sample is obtained.
[0180] The distribution features include the mean pixel value of the baseline distribution function; setting feature values according to the distribution features of the baseline distribution function includes: setting the mean pixel value of the baseline distribution function as the feature value; the number of partitions is multiple, and the number of images to be tested is multiple; the method includes: performing the feature value acquisition process on each image to be tested to obtain multiple feature values; performing anomaly detection on the sample based on the feature values to obtain detection results, including: obtaining a standard image according to the correspondence between the feature values and the position of the partitions, and using the standard image to perform anomaly detection on the sample to obtain detection results.
[0181] In this embodiment, when generating the standard image of the sample based on the average pixel value obtained from each of the images to be tested, please refer to [the relevant documentation]. Figure 16The first partition group 1610, the second partition group 1620, and the third partition group 1630 of the plurality of test images have corresponding first pixel units 1614, second pixel units 1624, and third pixel units 1634 in the standard image 1640. Based on the pixel units of the first partition group 1610, the second partition group 1620, and the third partition group 1630, the three test images are processed by feature value acquisition to obtain the mean value 1613 of the first pixel value, the mean value 1623 of the second pixel value, and the mean value 1633 of the third pixel value. Based on the correspondence between the mean value of these three pixel values and the partition they belong to, they are respectively used as the pixel values of the first pixel unit 1614, the second pixel unit 1624, and the third pixel unit 1634 in the reference image 1640.
[0182] Anomaly detection of the sample using the standard image to obtain detection results includes: comparing the difference between the standard image and the detected image of the sample, and detecting the target in the sample based on the difference to obtain a target detection result, the detection result including the target detection result; or, determining the offset between the standard image and the detected image of the sample with respect to the sample position, and determining the positioning detection result of the sample based on the offset, the detection result including the positioning detection result.
[0183] In this embodiment, comparing the difference between the standard image and the detected image of the sample includes: performing differential processing on the standard image and the detected image to obtain a difference map to represent the difference between them; detecting the target in the sample based on the difference to obtain a target detection result includes: filtering the difference map based on a preset threshold, and determining the target in the sample based on the filtering result. Further, before comparing the difference between the standard image and the detected image of the sample, the method further includes: registering the standard image and the detected image such that at least a portion of the standard structure of the detected image is aligned with the standard structure of the standard image.
[0184] In this embodiment, the standard image and the detection image are registered to determine a first offset between them regarding the sample position; a second offset between the standard image and the working device is obtained; based on the first offset and the second offset, a third offset between the detection image and the working device is determined; and the positioning detection result of the sample is determined based on the third offset. Preferably, the second offset is 0.
[0185] Specifically, the first offset includes a global offset, and a first center offset representing the sample center between the standard image and the detection image is determined based on the global offset; a second center offset between the sample center of the standard image and the working center of the working device is obtained; a third center offset between the sample center of the detection image and the working center is determined based on the first center offset and the second center offset; and the positioning detection result of the sample is determined based on the third center offset.
[0186] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the application device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0187] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0188] Those skilled in the art will recognize that the units 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 implementations should not be considered beyond the scope of this invention.
[0189] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / terminal devices and methods can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units 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 devices or units may be electrical, mechanical, or other forms.
[0190] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected based on actual needs to achieve the purpose of this embodiment.
[0191] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0192] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed based on the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, based on legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0193] This application also provides a control system. Please refer to... Figure 17 This illustrates a schematic diagram of the structure of a control system provided in an embodiment of this application. Figure 17 As shown, the control system 1700 includes: a processor 170, a memory 171, a bus 172, and a communication interface 173. The processor 170, the communication interface 173, and the memory 171 are connected via the bus 172. The memory 171 stores computer program instructions that can be executed by the processor 170. When the processor 170 executes the computer program instructions, it executes the detection method provided in any of the foregoing embodiments of this application.
[0194] The memory 171 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this device network element and at least one other network element is achieved through at least one communication interface 173 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.
[0195] Bus 172 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. Memory 171 is used to store programs. After receiving an execution instruction, processor 170 executes the program. The detection method disclosed in any of the foregoing embodiments of this application can be applied to processor 170, or implemented by processor 170.
[0196] Processor 170 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 170 or by instructions in software form. Processor 170 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), an Off-the-shelf Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 171. Processor 170 reads the information in memory 171 and, in conjunction with its hardware, completes the steps of the above method.
[0197] The control system provided in this application embodiment and the detection method provided in this application embodiment are based on the same inventive concept and have the same beneficial effects as the methods they adopt, operate or implement.
[0198] This application also provides a computer-readable storage medium corresponding to the detection method provided in the foregoing embodiments, which stores computer program instructions that, when executed by a processor, implement the detection method provided in any of the foregoing embodiments.
[0199] It should be noted that examples of the computer-readable storage medium may include, but are not limited to, optical discs, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other optical and magnetic storage media, which will not be elaborated here.
[0200] The computer-readable storage medium provided in the above embodiments of this application and the detection method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0201] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the above-described method embodiments.
[0202] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A detection method, characterized in that, The detection method includes: Acquire the image of the sample to be tested; The image to be tested is subjected to feature value acquisition processing, which includes: A distribution model is generated based on the image to be tested. The distribution model represents the correspondence between statistical data and pixel values. The statistical data is positively correlated with pixel probability. The pixel probability is the probability of having a corresponding pixel value. The distribution model includes a linear combination of multiple local components. The distribution characteristics of the benchmark distribution function are obtained based on the benchmark distribution, wherein the benchmark distribution is determined based on at least some local components of each local component of the distribution model; The feature values are set according to the distribution characteristics of the benchmark distribution function; and, Anomaly detection is performed on the sample based on the aforementioned feature values to obtain the detection results.
2. The detection method according to claim 1, characterized in that, Before obtaining the distribution characteristics of the benchmark distribution function based on the benchmark distribution, the method further includes: obtaining at least some of the local components in each local component of the distribution model to obtain the benchmark distribution; Obtaining at least some of the local components of the distribution model to obtain the baseline distribution includes: Determine the peak positions of each local component in the distribution model; Based on the peak position distance between each adjacent local component, at least some of the local components are sequentially selected along a preset direction to generate the reference distribution, wherein the preset direction is from the local component with the largest peak value to other local components.
3. The detection method according to claim 2, characterized in that, The distance between the reference distribution and the adjacent peak position of the previous local component is less than or equal to a preset distance threshold, and the distance between the reference distribution and the adjacent peak position of the next local component is greater than or equal to a preset distance threshold. Based on the peak position distance between each adjacent local component, at least a portion of the local components are sequentially selected along a preset direction to generate the reference distribution, including: Determine a first group of adjacent local components whose distance to adjacent peak positions exceeds a preset distance threshold along a preset direction; select the leading local component from the first group of adjacent local components to obtain the baseline distribution; or... Determine the last group of adjacent local components whose distance to adjacent peak positions does not exceed a preset distance threshold along a preset direction; select the later local component in the last group of adjacent local components to obtain the baseline distribution; or, The local component along the preset direction is determined as the reference distribution if the distance between the adjacent peak position of the previous local component and the adjacent peak position of the next local component is less than a preset distance threshold and the distance between the adjacent peak position of the next local component and the preset distance threshold is greater than a preset distance threshold.
4. The detection method according to claim 1, characterized in that, The distribution characteristics of the benchmark distribution function are obtained based on the benchmark distribution, including: In the distribution model, obtain the distribution characteristics of the local components corresponding to the baseline distribution; or, The distribution characteristics of the benchmark distribution function are obtained by fitting the benchmark distribution function with a preset distribution function.
5. The detection method according to claim 2, characterized in that, Based on the peak position distance between each adjacent local component, at least some of the local components are selected sequentially along a preset direction to generate the benchmark distribution, including: sequentially determining local components whose distance from the peak position of the previous local component does not exceed a preset distance threshold along the preset direction; merging each local component whose distance from the peak position of the previous local component does not exceed the preset distance threshold to obtain the benchmark distribution; Obtaining the distribution characteristics of a benchmark distribution function based on a benchmark distribution includes: fitting the benchmark distribution to a preset distribution function to obtain the distribution characteristics of the benchmark distribution function, wherein the preset distribution function is a single benchmark distribution function.
6. The detection method according to claim 5, characterized in that, Local components whose distance from the peak position of the previous local component does not exceed a preset distance threshold are merged to obtain a baseline distribution, including: Merge all local components whose distance from the peak position of the previous local component does not exceed a preset distance threshold along a preset direction; or, Along a preset direction, determine whether the distance between the peak position of the previous local component and the previous local component exceeds a preset distance threshold. If not, merge the adjacent local components to obtain an initial merged component. Then, determine whether the distance between the adjacent peak positions of the initial merged component and the next adjacent local component exceeds the preset distance threshold. If not, merge the initial merged component and the next adjacent local component to form a new initial merged component. Repeat the step of determining whether the distance between the adjacent peak positions of the initial merged component and the next adjacent local component exceeds the preset distance threshold until the distance between the adjacent peak positions of the initial merged component and the next adjacent local component exceeds the preset distance threshold.
7. The detection method according to claim 1, characterized in that, A distribution model is generated based on the image to be tested, including: Pixel distribution data is obtained from the image to be tested. The pixel distribution data is the correspondence between statistical data and pixel values. The statistical data is positively correlated with the statistical probability value. The statistical probability value is the probability that a pixel in the image to be tested has a certain pixel value. The pixel distribution data is fitted with a hybrid distribution function to obtain the distribution model, wherein the hybrid distribution function is a linear combination of multiple baseline distribution functions.
8. The detection method according to claim 7, characterized in that, The baseline distribution function is a normal distribution function, a Gaussian distribution function, a Poisson distribution function, or a T-distribution function.
9. The detection method according to claim 7, characterized in that, Obtain pixel distribution data from the image to be tested, including: The number of pixel units for each pixel value in the image under test is counted to obtain the statistical quantity; The statistical data is obtained based on the statistical quantity and the total number of pixel units in the image to be tested; The pixel distribution data is obtained based on the correspondence between the pixel values and the statistical data.
10. The detection method according to claim 7, characterized in that, The hybrid distribution function includes multiple parameters to be adjusted. The pixel distribution data is fitted using the hybrid distribution function to obtain the distribution model, including: Multiple initial local components are generated by setting multiple initial values for the parameters to be adjusted of each of the aforementioned benchmark distribution functions, wherein the parameters to be adjusted are used to at least represent the distribution range of the initial local components; The pixel distribution data is divided into multiple groups of data; Determine the initial probability that each group of data in the pixel distribution data belongs to each of the initial local components; The parameters to be tuned for each initial local component are adjusted based on the initial probability of each initial local component; a distribution model is obtained based on each initial local component after adjusting the parameters to be tuned. The distribution range includes the range of the statistical data and the pixel values.
11. The detection method according to claim 10, characterized in that, Adjusting the parameters to be tuned for each initial local component based on the initial probability of each initial local component includes: Based on the adjusted parameters to be adjusted, obtain the adjustment probability of each group of data in the pixel distribution data belonging to each adjusted initial local component, as well as the probability deviation between the adjustment probability and the initial probability. Repeat the steps of obtaining the initial probability to obtaining the probability deviation until the preset conditions are met to obtain each local component of the distribution model; The preset conditions include the number of repetitions reaching a preset number, the probability deviation being less than or equal to a preset value, or convergence.
12. The detection method according to claim 10, characterized in that, The parameters to be adjusted include the dispersion index of the baseline distribution function, the mean of the pixel value, and the weights of each baseline distribution function in the hybrid distribution function.
13. The detection method according to any one of claims 1-12, characterized in that, The image to be tested is either a sample image of the sample or a difference image of the sample, wherein the difference image is a difference map between the sample image of the sample and a preset standard image.
14. The detection method according to claim 13, characterized in that, The distribution characteristics include the dispersion index of the baseline distribution function and the mean of the pixel values; Setting feature values based on the distribution characteristics of the baseline distribution function includes setting a feature value as a linear combination of the dispersion index and the mean of the pixel values.
15. The detection method according to claim 13, characterized in that, Setting a feature value as a linear combination of the dispersion index and the mean of the pixel values includes: If the preset direction is the positive direction along the preset coordinate axis, then the feature value T is set as: T = P + K * D; If the preset direction is the opposite direction along the preset coordinate axis, then the feature value T is set as: T = PK * D; If the preset direction is the positive and negative directions along the preset coordinate axis, then the feature value T is set as: T = (P1 - K*D, P2 + K*D). Wherein, the coordinate axis is oriented in the direction of distance from the peak position, P, P1, and P2 are the mean values of the pixel values of the reference distribution function on the coordinate axis, D is the variance of the pixel values of the reference distribution function on the coordinate axis, K is a preset multiple, and the dispersion index includes the variance.
16. The detection method according to claim 13, characterized in that, Anomaly detection is performed on the sample based on the aforementioned feature values to obtain detection results, including: In the distribution model, pixel units corresponding to pixel values exceeding the feature value are taken as target components to be tested along a preset direction; the target to be tested of the sample is detected in the image to be tested based on the target components to be tested, and a target detection result is obtained, the detection result including the target detection result.
17. The detection method according to any one of claims 1-12, characterized in that, Acquiring the test image of the sample includes: acquiring the test image based on multiple original images of the sample, wherein each original image includes one or more partitions, each partition includes one or more pixel units, each partition has a region pixel value, and the region pixel value of the partition is a linear combination of the pixel values of the pixel units in the partition; The image to be tested is obtained based on the original image of the sample, including: At least one class partition group is obtained based on the plurality of original images, and the class partition group is composed of partitions in the plurality of original images that correspond to the same sample region; A test image is obtained based on the region pixel values of each partition in each of the class partition groups, with each partition serving as a pixel of the test image and each region pixel value serving as a pixel value of the test image.
18. The detection method according to claim 17, characterized in that, The number of samples is multiple, or the samples include multiple divided regions, wherein the samples include at least a standard structure, each sample includes the same standard structure, or each divided region includes the same standard structure; The multiple original images are acquired from the standard structures of multiple samples, respectively; or, the multiple original images are acquired from the standard structures of multiple divided regions of at least one sample, respectively.
19. The detection method according to claim 18, characterized in that, Before obtaining at least one class partition group based on the plurality of original images, the method further includes: aligning the plurality of original images to determine partitions in the plurality of original images that correspond to the same sample region; Each of the original images includes a standard structural pattern, which represents at least a portion of the standard structure; Aligning the different original images includes aligning the standard structural patterns in the different original images so that the partitions of each original image obtained from the same position of each standard structure correspond one-to-one.
20. The detection method according to claim 17, characterized in that, The distribution feature includes the mean of the pixel values of the baseline distribution function; Setting feature values based on the distribution characteristics of the baseline distribution function includes setting the mean value of the pixel values of the baseline distribution function as the feature value.
21. The detection method according to claim 17, characterized in that, The number of partitions is multiple, and the number of images to be tested is multiple; The method includes: performing the feature value acquisition process on each of the images to be tested to obtain a plurality of the feature values; Anomaly detection of the sample based on the feature values to obtain detection results includes: obtaining a standard image based on the correspondence between the feature values and the location of the partitions; and using the standard image to perform anomaly detection on the sample to obtain detection results.
22. The detection method according to claim 21, characterized in that, Anomaly detection is performed on the sample using the standard image to obtain detection results, including: By comparing the difference between the standard image and the detected image of the sample, and detecting the target in the sample based on the difference, a target detection result is obtained, wherein the detection result includes the target detection result; or, The offset between the standard image and the detection image of the sample with respect to the sample position is determined, and the positioning detection result of the sample is determined based on the offset, wherein the detection result includes the positioning detection result.
23. A testing device, characterized in that, Includes a processor for performing the detection method of any one of claims 1 to 16, configured as follows: Acquire the image of the sample to be tested; The image to be tested is subjected to feature value acquisition processing, which includes: A distribution model is generated based on the image to be tested. The distribution model represents the correspondence between statistical data and pixel values. The statistical data is positively correlated with pixel probability. The pixel probability is the probability of having a corresponding pixel value. The distribution model includes a linear combination of multiple local components. The distribution characteristics of the benchmark distribution function are obtained based on the benchmark distribution, wherein the benchmark distribution is determined based on at least some local components of each local component of the distribution model; The feature values are set according to the distribution characteristics of the benchmark distribution function; and, Anomaly detection is performed on the sample based on the aforementioned feature values to obtain the detection results.
24. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the detection method as described in any one of claims 1-22.