Template extraction method and system based on sparse coding
By employing sparse coding methods and utilizing the structural information of grain images to construct a shared dictionary and sparse coefficient vectors, the problems of wasted storage space and low efficiency in existing technologies are solved. This enables the application of efficient technology in grain detection, improving detection efficiency and flexibility.
Patent Information
- Application Number
- CN202510466909.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-04-15
AI Technical Summary
In existing wafer inspection technologies, template extraction methods based on pixel information lead to wasted storage space and low efficiency, especially when the die pattern is composed of multiple modules, failing to effectively utilize structural information.
By employing a sparse coding method, through dictionary learning and sparse coding, structural information in the grain image is identified and utilized to construct a shared dictionary and sparse coefficient vector, forming a comprehensive grain template.
It significantly reduces template storage space requirements, improves detection efficiency and flexibility, adapts to the detection of different types of wafers and dies, and enhances the versatility and adaptability of the system.
Smart Images

Figure CN120107235B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial visual inspection, and in particular to a template extraction method and system based on sparse coding. BACKGROUND
[0002] In the field of industrial visual inspection, especially in the detection of die defects, the method based on template comparison is a common strategy for defect detection. The core of this method is to identify any abnormalities on the surface or inside of an object by comparing it with a pre-defined standard template without defects. In order to further improve the efficiency and accuracy of detection, current optimization practices tend to complete the extraction of the complete template of the detected object at the beginning of the detection process.
[0003] Specifically, this template extraction process usually includes the following steps: first, a series of high-resolution images are obtained from a plurality of objects of the same type. This process aims to ensure that the collected data can cover all possible variations, thereby improving the representativeness and reliability of the subsequent template. Then, advanced image processing techniques are used to accurately align these images, ensuring that each pixel point can correspond to each other in spatial position. This step is crucial to ensure the quality of the final template, as it directly affects the consistency of features between different images.
[0004] Finally, the mean image or median image of the aligned image set is calculated as the final template for use. The choice of using the mean image or the median image depends on the specific application scenario and its requirements for noise sensitivity. The mean image can effectively smooth random noise, but it is sensitive to extreme values; while the median image performs better in removing outliers, suitable for environments with more interference factors. Through a series of carefully designed steps, an accurate and robust standard template can be constructed, providing a solid foundation for subsequent defect detection. This method not only improves the speed of detection, but also enhances the reliability and repeatability of the results.
[0005] The existing method only uses pixel information without using structure information when extracting the template, which will cause the template to record the value of each pixel, and the storage space occupied is relatively large. In particular, in wafer detection applications, the pattern of a single die may be composed of repeated combinations of patterns of several modules, in which case recording each pixel will waste a lot of space. SUMMARY
[0006] Therefore, the purpose of the present application is to provide a template extraction method and system based on sparse coding, which can solve the existing problems.
[0007] Based on the above purpose, the application provides a template extraction method based on sparse coding, comprising:
[0008] At least one complete image of the wafer to be detected is taken;
[0009] In the at least one complete image, a group of basic images is determined as a dictionary by optimizing the objective function, and the dictionary is trained and learned;
[0010] The learned dictionary is used to code the wafer image to obtain a sparse coefficient vector;
[0011] The dictionary, the non-zero value and its position in the sparse coefficient vector are combined to form a comprehensive wafer template.
[0012] Further, according to the specific application requirement, acceptable processing time and available computing resources, the relationship between the number of images and the computing efficiency is balanced;
[0013] When taking pictures, ensure that all images have a preset high resolution to capture the fine features of the wafer surface;
[0014] The consistency of the shooting conditions is controlled to reduce the error caused by the change of external factors and ensure the authenticity and comparability of the obtained images.
[0015] Further, the objective function is used to minimize the reconstruction error while maximizing the sparsity, and the form of the objective function is as follows:
[0016] ,
[0017] In the formula:
[0018] represents the input wafer image;
[0019] is a dictionary composed of basic images to be determined;
[0020] represents a coefficient vector, which describes how to approximate the input image by combining the basic images in the dictionary;
[0021] is a parameter for balancing the reconstruction error and the sparsity, which adjusts the preference of the model for sparsity;
[0022] is a parameter for balancing the reconstruction error and the periodicity, which adjusts the preference of the model for periodicity;
[0023] represents the L2 norm, which is used to measure the difference between matrices;
[0024] represents L1 norm, used to promote sparsity of solution;
[0025] represents Fourier transform of X, used to calculate spectrum;
[0026] represents modulus, used to calculate spectrum amplitude;
[0027] Entropy() represents calculating entropy value of spectrum, the lower the entropy, the stronger the periodicity, the calculation formula is as follows:
[0028] ,
[0029] ,
[0030] wherein and represent frequency position in spectrum.
[0031] Further, the algorithm for optimizing the objective function is K-SVD algorithm or gradient descent method.
[0032] Further, the training and learning of the dictionary comprises:
[0033] de-noising the input image;
[0034] strictly aligning die pattern on wafer;
[0035] selecting appropriate dictionary size according to complexity of wafer design;
[0036] based on normal die images under different batches and different process conditions, performing the training and learning.
[0037] Further, the specific process of encoding is:
[0038] (1), preparation stage: first, obtaining a dictionary obtained through dictionary learning ;
[0039] (2), input image processing: taking the complete die image to be encoded as input ;
[0040] (3), selecting algorithm: selecting preset algorithm according to specific situation to perform sparse coding;
[0041] (4), executing encoding: running the preset algorithm, using the dictionary to encode the input image , to obtain sparse coefficient vector ;
[0042] (5) Verification and optimization: check the quality of the resulting sparse coefficient vector, adjust parameters or use different algorithms to optimize the results.
[0043] Further, the non-zero values and their positions in the sparse coefficient vector are used to indicate which base images are used to reconstruct the original image and the weight of each base image contributes to the final image.
[0044] Based on the above purposes, the present application also proposes a template extraction system based on sparse coding, comprising:
[0045] A data preparation module is configured to capture at least one complete image of a die to be detected;
[0046] A dictionary learning module is configured to determine a set of base images as a dictionary by optimizing a target function in the at least one complete image, and train the dictionary;
[0047] A coefficient coding module is configured to code the die image using the learned dictionary to obtain a sparse coefficient vector;
[0048] A template combination module is configured to combine the dictionary, the non-zero values and their positions in the sparse coefficient vector to form a comprehensive die template.
[0049] In general, the advantages of the present application and the experience brought to the user are:
[0050] For wafers with similar patterns, they can share the same dictionary. This means that different wafers or dies can use common base patterns (i.e. dictionaries) to construct their templates, while differences are reflected through their respective sparse coefficient vectors. This method not only greatly reduces the storage space required for templates, but also improves the versatility and flexibility of templates. For example, during the detection process, if a new die is encountered, we do not need to generate a new set of templates, but can use the existing dictionary to calculate a new coefficient vector to represent the unique features of the die.
[0051] The comprehensive effects of the present application are as follows:
[0052] 1. Reduce storage requirements: Through the above two ways, the present application effectively reduces the space required for template storage, especially when dealing with a large number of dies with similar patterns.
[0053] 2. Improve efficiency: Due to the existence of shared dictionaries, the algorithm can process new input die images more quickly, as a large amount of preprocessing work (such as dictionary learning) only needs to be performed once.
[0054] 3. Enhanced adaptability: the method enables the system to be more flexible to different types of wafers and dies, and new situations can be adapted by adjusting the coefficient vector without substantially changing the underlying model.
[0055] In summary, the present application provides a more efficient and economic way to deal with wafer defect detection problem, especially suitable for large-scale industrial production environment. BRIEF DESCRIPTION OF DRAWINGS
[0056] In the drawings, like reference numerals refer to same or similar elements throughout the several views. These drawings are not necessarily to scale. It should be understood that these drawings are merely schematic and certain
[0057] Figure 1 A flow chart of a sparse coding based template extraction method according to an embodiment of the present application is shown.
[0058] Figure 2 A schematic diagram of a collected die image according to an embodiment of the present application is shown.
[0059] Figure 3 A schematic diagram of a dictionary according to an embodiment of the present application is shown.
[0060] Figure 4 A schematic diagram of template combination according to an embodiment of the present application is shown.
[0061] Figure 5 A configuration diagram of a sparse coding based template extraction system according to an embodiment of the present application is shown.
[0062] Figure 6 A schematic diagram of an electronic device according to an embodiment of the present application is shown.
[0063] Figure 7 A schematic diagram of a storage medium according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0064] The present application will be further described below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are intended to be illustrative only and not limiting of the present application. In addition, it should be noted that only parts of the relevant application are shown in the drawings.
[0065] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the drawings and embodiments.
[0066] The prior art mainly relies on pixel-level information for processing when extracting templates, and fails to effectively utilize the rich information provided by the internal structural features of the object. This template extraction method based only on pixel information results in the template having to accurately record the specific values of each pixel point, thereby occupying a large amount of storage space. Especially in the application scenario of wafer detection, the pattern on a single die is often formed by the repeated combination of several basic module patterns. In this case, the method of recording each pixel value not only has low efficiency, but also greatly wastes storage resources.
[0067] More specifically, in the process of wafer defect detection, if the structural information of these repeatedly appearing basic module patterns can be identified and utilized, the amount of data required for storage can be greatly reduced. For example, by individually defining and encoding the basic modules and then building the entire die pattern based on these modules, the storage capacity required for the final template can be significantly reduced. This method not only effectively compresses data, but also improves the speed and accuracy of subsequent image processing, because it reduces unnecessary redundancy, enabling the algorithm to focus more on actual structural features, thereby improving overall detection performance and efficiency. In addition, the use of structural information can also enhance the robustness of the system to local changes or noise, because structural features reflect the essential properties of the object more than purely pixel-level comparisons.
[0068] As shown in Figure 1 , a sparse coding-based template extraction method of the present application includes the following steps.
[0069] S1, data preparation
[0070] In this step, in the data preparation stage of die defect detection, the present application first needs to take a complete image of the die to be detected. In order to ensure the accuracy and representativeness of the template, it is recommended to collect as many image samples as possible. Although the minimum requirement is to provide one image as the basic template, increasing the number of images can significantly improve the quality of the template and the accuracy of the detection. This is because more image samples can better reflect the various variations that may occur in the production process of the die, making the finally generated template more comprehensive and reliable.
[0071] However, it is worth noting that as the number of images increases, the calculation time and resource consumption will also increase accordingly. This is because each additional image requires additional calculation steps to align the images and integrate them into the template, whether by calculating the mean image or the median image. Therefore, in actual operation, the relationship between the number of images and the calculation efficiency needs to be balanced according to the specific application requirements, acceptable processing time, and available computing resources.
[0072] In addition, to ensure the accuracy of subsequent processing, it is necessary to ensure that all images have a high enough resolution when shooting so that the fine features of the grain surface can be captured. At the same time, attention should also be paid to controlling the consistency of the shooting conditions (such as lighting, angle, etc.) to reduce errors caused by changes in external factors and ensure the authenticity and comparability of the images obtained. This step is crucial for building an accurate and efficient template and directly affects the effectiveness of the final defect detection.
[0073] As shown in Figure 2 , a schematic diagram of a grain image collected by the present application.
[0074] S2, Dictionary Learning
[0075] In this step, the goal of the present application is to find a set of basis images (so-called "dictionary") such that the input grain image can be represented in a sparse manner by these basis images. This method not only effectively captures the key features of the image, but also reduces redundant information while improving processing efficiency.
[0076] In this step, the dictionary learning method is used to identify and store the repeated basic patterns in the wafer, reducing the waste of space caused by repeated storage of the same pattern. Each basis image in the dictionary represents a typical pattern or feature on the wafer.
[0077] In dictionary learning, the above goal is usually achieved by optimizing a specific objective function. This objective function aims to minimize the reconstruction error while maximizing the sparsity. Specifically, one form of the objective function used in the present application is as follows:
[0078] ,
[0079] In the formula:
[0080] represents the input grain image;
[0081] is the dictionary composed of the basis images we are trying to find;
[0082] represents the coefficient vector, which describes how to combine the basis images in the dictionary to approximate the input image;
[0083] is a parameter used to balance the reconstruction error and sparsity, adjusting the model's preference for sparsity;
[0084] is a parameter used to balance the reconstruction error and periodicity, adjusting the model's preference for periodicity;
[0085] denotes L2 norm, used to measure the difference between matrices;
[0086] denotes L1 norm, used to promote the sparsity of the solution
[0087] denotes Fourier transform on X, used to calculate the spectrum;
[0088] denotes modulo operation, used to calculate the spectrum amplitude;
[0089] Entropy() denotes the calculation of the entropy value of the spectrum, the lower the entropy, the stronger the periodicity, the calculation formula is as follows:
[0090] ,
[0091] ,
[0092] wherein and denote the frequency position in the spectrum.
[0093] Due to the possibility of wafer defects (such as scratches, particles) being mistaken for normal patterns, a robust optimization objective needs to be introduced in dictionary learning, for example, using norm or norm instead of norm to suppress the influence of outliers.
[0094] The process of solving the above objective function is usually iterative, and various algorithms can be used. The following is the solving method used in the present application:
[0095] (1) K-SVD (K-Singular Value Decomposition): This is a classic dictionary learning algorithm, which gradually approaches the optimal solution by alternately updating the dictionary and the coefficient matrix .
[0096] (2) Gradient descent method: based on the gradient information of the objective function with respect to the variable, adjust the parameters along the negative gradient direction to gradually reduce the objective function value, until it converges to a local optimal solution.
[0097] Specific to the learning of die images, the following needs to be noted:
[0098] (1) Noise suppression: wafer images may have noise due to shooting conditions (such as uneven lighting, lens distortion) or wafer surface defects. It is necessary to first perform noise reduction processing (such as local histogram matching, median filtering, distortion correction) on the input image, otherwise the noise may be mistaken for effective features, leading to biased dictionary learning results.
[0099] (2) Image alignment: The die pattern on the wafer needs to be strictly aligned (such as through feature point matching or template matching), otherwise the misalignment of the pattern at different positions will lead to the inability to correctly capture the features of the repeated modules during dictionary learning.
[0100] (3) Dictionary size: An excessively large dictionary will increase the computational complexity and may lead to overfitting and reduced generalization ability; an excessively small dictionary may not be able to cover the complex pattern of the die. A suitable dictionary size needs to be selected according to the complexity of the wafer design (such as through pre-experiment cross-validation of different dictionary sizes).
[0101] (4) Diversity of training data: Dictionary training needs to be based on a sufficient number of diversified normal die images (covering normal variations under different batches and different process conditions), otherwise it may lead to overfitting and be unable to adapt to natural variations in actual detection.
[0102] In this step, through dictionary learning, the application can provide a more compact and effective template representation method for die defect detection, thereby helping to improve detection accuracy and speed. The dictionary obtained by the application is shown in Figure 3 , which includes four basic images A, B, C, and D.
[0103] S3, Sparse coding
[0104] In this step, the process of using the learned dictionary to code the die image to obtain the sparse coefficient vector is a key step in the application of dictionary learning. This process calculates the corresponding sparse coefficient vector by identifying how the input image is linearly combined from the basic images (i.e. atoms) in the dictionary. The algorithms used by the application include Matching Pursuit (MP) and Orthogonal Matching Pursuit (OMP), which are both greedy algorithms designed to select a small number of optimal elements from an overcomplete dictionary to approximately represent a given image.
[0105] Matching Pursuit (MP): Matching Pursuit is an iterative algorithm used to find a set of bases in an overcomplete dictionary that best matches the input signal (in this case, the die image). The basic idea is to select the dictionary atom that is most relevant to the current residual at each iteration and update the residual until a preset stopping condition (such as a sparsity limit or a reconstruction error threshold) is reached.
[0106] Orthogonal Matching Pursuit (OMP): OMP is an improvement over MP, which not only selects one best-matching atom at each iteration, but also ensures that the selected atom is orthogonal to all previously selected atoms. This allows for more efficient reduction of reconstruction error and often results in better sparse representation than MP. OMP approximates the original signal step by step through orthogonal projection, updating the coefficients of all selected atoms at each iteration to make the final sparse coefficient vector more accurate.
[0107] In particular, the encoding process of the present application is as follows:
[0108] (1) Preparation phase: First, there needs to be a dictionary that has been obtained through dictionary learning methods .
[0109] (2) Input image processing: The complete image of the grain to be encoded is taken as input .
[0110] (3) Selection of algorithm: According to the specific situation, select the appropriate algorithm (for example, when the image is relatively simple or the reconstruction accuracy requirement is not high, select MP; when the image is relatively complex or the reconstruction accuracy requirement is high, select OMP) to perform sparse coding.
[0111] (4) Execution of encoding: Run the selected algorithm, use the dictionary to encode the input image , and obtain the sparse coefficient vector .
[0112] (5) Verification and optimization: Check the quality of the obtained sparse representation (the smaller the image reconstruction error, the better, the greater the sparsity, the better), and if necessary, adjust the parameters or try different algorithms to optimize the results.
[0113] Through this method, complex grain images can be effectively represented as sparse linear combinations of their corresponding base images in the dictionary. The encoding result is as follows, where v represents the non-zero values in the coefficients, and x and y represent the coordinates of the non-zero values:
[0114] Coefficient vector:
[0115] [(v_A, x_A, y_A), (v_B, x_B, y_B), (v_C1, x_C1, y_C1), (v_C2, x_C2,y_C2), …, (v_C2, x_C9, y_C9), (v_D, x_D, y_D)]
[0116] In this step, the present application uses algorithms such as Matching Pursuit (MP), Orthogonal Matching Pursuit (OMP), etc. to encode the grain image, obtaining a sparse coefficient vector. This vector indicates how to use the basic image combinations in the dictionary to approximately represent the input image. Only the non-zero values in the coefficient vector and their positions are recorded, thereby further reducing storage requirements.
[0117] S4, Template combination
[0118] In this step, after completing dictionary learning and sparse coding, the next step is to combine the dictionary, the non-zero values in the coefficient vector, and their positions to form a comprehensive grain template. This step is crucial for subsequent wafer grain positioning and defect detection. The following is a detailed process:
[0119] (1) Record the dictionary: This is the basic image set obtained through the dictionary learning process. Each basic image represents a certain feature or pattern in the grain pattern. The dictionary is the core component of the template, as it provides all the "building blocks" needed to construct a complete grain image.
[0120] (2) Record the non-zero values in the coefficient vector and their positions: All non-zero values in the coefficient vector and their specific positions need to be recorded. This information indicates which specific basic images (i.e., atoms in the dictionary) are used to reconstruct the original image, and the weight of each atom's contribution to the final image.
[0121] (3) Combine into a grain template: Combine the dictionary, the non-zero values in the coefficient vector, and their positions to form a complete grain template. This template not only contains all the basic information needed to reconstruct the grain image, but also significantly reduces the storage space requirement, as the entire coefficient vector does not need to be saved, but only the non-zero values and their positions.
[0122] Finally, the template combination obtained by an embodiment of the present application is as shown in Figure 4 .
[0123] In the present application, for wafers with similar patterns, the same dictionary can be shared, and only different coefficient vectors need to be calculated for each wafer or grain to construct its template. This method not only saves storage space, but also improves processing efficiency and the universality of the template.
[0124] The application embodiment provides a sparse coding-based template extraction system, which is used to execute the sparse coding-based template extraction method described in the above embodiment, as shown in Figure 5 , and the system comprises:
[0125] The data preparation module 501 is used to take at least one complete image of the grain to be detected.
[0126] The dictionary learning module 502 is configured to determine a set of basis images as a dictionary by optimizing a target function in the at least one complete image, and train the dictionary;
[0127] The coefficient coding module 503 is configured to code the die image by using the learned dictionary to obtain a sparse coefficient vector.
[0128] The template combination module 504 is configured to combine the dictionary, the non-zero values and their positions in the sparse coefficient vector to form a comprehensive die template.
[0129] The sparse coding-based template extraction system provided by the above-mentioned embodiments of the present application and the sparse coding-based template extraction method provided by the embodiments of the present application have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0130] The embodiments of the present application further provide an electronic device corresponding to the sparse coding-based template extraction method provided by the above-mentioned embodiments, to execute the sparse coding-based template extraction method. The embodiments of the present application are not limited.
[0131] Please refer to Figure 6 , which shows a schematic diagram of an electronic device provided by some embodiments of the present application. As Figure 6 shown, the electronic device 20 includes a processor 200, a memory 201, a bus 202 and a communication interface 203, the processor 200, the communication interface 203 and the memory 201 are connected through the bus 202; the memory 201 stores a computer program that can run on the processor 200, and the processor 200 runs the computer program to execute the sparse coding-based template extraction method provided by any one of the preceding embodiments of the present application.
[0132] Among them, the memory 201 can contain a high-speed random access memory (RAM: Random Access Memory), and can also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 203 (which can be wired or wireless), and the Internet, wide area network, local network, metropolitan area network, etc. can be used.
[0133] The bus 202 can be an ISA bus, a PCI bus, an EISA bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, and the like. The memory 201 is configured to store a program, and the processor 200 executes the program after receiving an execution instruction. The sparse coding-based template extraction method disclosed in any of the embodiments of the present application can be applied to the processor 200 or implemented by the processor 200.
[0134] The processor 200 can be an integrated circuit chip with a processing capability of signals. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 200 or an instruction in the form of software. The processor 200 described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), and the like; or can be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. Each method, step, and logic block diagram disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware coding processor for execution, or a combination of hardware and software modules in the coding processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, or other mature storage media in the art. The storage medium is located in the memory 201, and the processor 200 reads information in the memory 201 and combines hardware to complete the steps of the above method.
[0135] The electronic device provided by the embodiments of the present application and the sparse coding-based template extraction method provided by the embodiments of the present application have the same beneficial effects as the method adopted, run, or implemented by them.
[0136] The embodiments of the present application also provide a computer-readable storage medium corresponding to the sparse coding-based template extraction method provided by the foregoing embodiments. Please refer to Figure 7 The computer-readable storage medium shown in the figure is an optical disc 30, and a computer program (i.e., a program product) is stored on the optical disc 30. When the computer program is run by a processor, the sparse coding-based template extraction method provided by any of the foregoing embodiments is executed.
[0137] It should be noted that examples of the computer-readable storage medium can include but are not limited to 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, magnetic storage, and the like, which are not listed one by one here.
[0138] The computer-readable storage medium provided by the above embodiments of the present application has the same beneficial effects as the method adopted, run or implemented by the application program stored in the computer-readable storage medium based on the sparse coding template extraction method provided by the embodiments of the present application.
[0139] It should be noted that:
[0140] The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with these teachings, with or without accompanying specific hardware. In addition, those skilled in the art will recognize that the present application is not limited to the specific programming languages described herein. The present application can be implemented in various programming languages. The specific language described above is used merely to convey the best mode of the present application.
[0141] In the specification provided herein, a large number of specific details are described. However, it can be understood that the embodiments of the present application can be practiced without these specific details. In some examples, well-known methods, structures and techniques are not described in detail in order not to obscure the understanding of the specification.
[0142] Similarly, it is to be understood that the embodiments of the present application can be used in other ways, and that the individual features of the present application can sometimes be grouped into single embodiments, figures or descriptions of them. However, this disclosure method should not be interpreted as reflecting the intention that the claimed present application requires more features than the features explicitly recorded in each claim. More precisely, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiments disclosed earlier. Therefore, the claims following the specific embodiments are hereby expressly incorporated into this specific embodiment, wherein each claim itself is a separate embodiment of the present application.
[0143] Those skilled in the art will appreciate that the modules in the apparatuses in the embodiments can be adapted and placed in one or more apparatuses other than the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and furthermore can be split into multiple sub-modules or sub-units or sub-components. Any combination of all the features disclosed in the specification (including the accompanying claims, abstract and drawings), and any method or process or device of any combination of the features disclosed in the specification (including the accompanying claims, abstract and drawings) can be taken, except that at least some of such features and / or processes or units are mutually exclusive, unless explicitly stated otherwise. Each feature disclosed in the specification (including the accompanying claims, abstract and drawings) can be replaced by alternative features providing the same, equivalent, or similar functionality unless stated explicitly otherwise.
[0144] Furthermore, those skilled in the art will appreciate that different embodiments of the application have different features and that the features of one embodiment can not be included in another embodiment. For example, in the following claims, any of the claims can be used to enable a single claim, multiple claims or single and multiple claims in combination. The following claims are therefore merely exemplary and are not intended to limit the application or scope of the application in any way.
[0145] Various component embodiments of the present application can be implemented in hardware, or as software modules running in one or more processors, or in combinations thereof. Those skilled in the art will appreciate that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the system for creating a virtual machine according to the embodiments of the present application. The present application can also be implemented as a device or system program (e.g., a computer program and a computer program product) for performing part or all of the methods described herein. Such an implementation of the present application can be stored on a computer readable medium, or can be of a form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.
[0146] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that those skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of both hardware and software, and any combination thereof. In a system claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The mere fact that certain measures are recited in mutually different claims does not indicate that a combination of these measures cannot be used to advantage. The use of relative terms such as 'about','substantially', 'approximately' and the like is intended to broadly describe variations that can exist in the embodiments described herein. The scope of the application is not intended to be limited to the embodiments described herein but is intended to include any variations that come within the scope of the claims.
[0147] The foregoing is merely illustrative of the principles of this application and various modifications can be made by those skilled in the art without departing from the scope of the application. The above description is embodied in the form of specific examples and embodiments, but the scope of the application is not limited thereto.
Claims
1. A template extraction method based on sparse coding, characterized in that, include: Take at least one complete image of the grain to be inspected; In the at least one complete image, a set of base images is determined by optimizing the objective function, which serves as a dictionary, and the dictionary is trained and learned. The learned dictionary is used to encode the grain image to obtain a sparse coefficient vector; The non-zero values and their positions in the dictionary and sparse coefficient vector are combined to form a comprehensive grain template; The objective function is used to maximize sparsity while minimizing the reconstruction error, and the objective function has the following form: , In the formula: This represents the input grain image; It is a dictionary composed of the basic images we are trying to find; The coefficient vector represents how the input image is approximated by a combination of basic images from the dictionary; It is a parameter used to balance reconstruction error and sparsity, adjusting the model's preference for sparsity; It is a parameter used to balance reconstruction error and periodicity, adjusting the model's preference for periodicity; L2 norm is used to measure the difference between matrices; This represents the L1 norm, used to promote sparsity of solutions; This indicates that a Fourier transform is performed on X to calculate the spectrum; This indicates modulo operation, used to calculate the spectral amplitude. Entroy() calculates the entropy value of the spectrum. The lower the entropy, the stronger the periodicity. The calculation formula is as follows: , , in and Indicates the frequency position in the spectrum.
2. The method according to claim 1, characterized in that, The acquisition of at least one complete image of the grain to be inspected further includes: The relationship between the number of images and computational efficiency should be balanced based on specific application requirements, acceptable processing time, and available computing resources. Ensure all images are taken at a preset resolution to capture subtle features on the grain surface. Maintaining consistency in shooting conditions reduces errors caused by changes in external factors, ensuring the authenticity and comparability of the acquired images.
3. The method according to claim 1, characterized in that, The algorithm for optimizing and solving the objective function is either the K-SVD algorithm or the gradient descent method.
4. The method according to claim 1, characterized in that, The training and learning of the dictionary includes: Denoise the input image; Strictly align the grain patterns on the wafer; Choose an appropriate dictionary size based on the complexity of the wafer design; The training and learning are performed based on normal grain images covering different batches and different process conditions.
5. The method according to claim 1, characterized in that, The specific encoding process is as follows: (1) Preparation stage: First, obtain a dictionary that has been learned through dictionary study. ; (2) Input image processing: The complete image of the grain to be encoded is used as input. ; (3) Algorithm selection: Select a preset algorithm for sparse coding; (4) Execute the encoding: Run the preset algorithm using a dictionary. For the input image Encode to obtain a sparse coefficient vector ; (5) Verification and optimization: Check the obtained sparse coefficient vector To improve the quality of the results, adjust parameters or use different algorithms.
6. The method according to any one of claims 1-5, characterized in that, The non-zero values and their positions in the sparse coefficient vector are used to indicate which base images were used to reconstruct the original image, and the weight of each base image's contribution to the final image.
7. A template extraction system based on sparse coding, using the method described in any one of claims 1-6, characterized in that, include: The data preparation module is used to capture at least one complete image of the grain to be inspected; A dictionary learning module is used to determine a set of base images as a dictionary by optimizing the solution of an objective function in the at least one complete image, and to train and learn the dictionary. The coefficient encoding module is used to encode the grain image using the learned dictionary to obtain a sparse coefficient vector. The template combination module is used to combine the non-zero values and their positions in the dictionary and sparse coefficient vector to form a comprehensive grain template.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by a processor to implement the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Face recognition method based on rotation invariant dictionary learning model
CN104281845A
K sparseness based rapid robust target tracking method
CN107784664A