Method for establishing defect classification model and defect classification method

By using a multi-layered AI model architecture, the problem of time-consuming and labor-intensive defect classification in traditional methods is solved, and accurate classification of highly similar defect categories is achieved, improving classification efficiency and accuracy.

CN122336446APending Publication Date: 2026-07-03NEXCHIP SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610789298.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-03
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Traditional deep learning-based defect classification methods are time-consuming, labor-intensive, and costly to acquire large-scale labeled data, and they struggle to accurately classify newly emerging or rare defect categories, resulting in low work efficiency.

Method used

A multi-layered AI model architecture is adopted, including a model-independent meta-learning algorithm, a semantic parsing model, a Transformer model, and a compressed fine-grained model. Through feature similarity calculation, multi-layer semantic parsing, dynamic sparse masking, and compressed fine-grained techniques, defect samples with high similarity groups are accurately classified.

Benefits of technology

It improves the classification accuracy of highly similar defect categories, reduces training time and cost, and enhances classification efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122336446A_ABST
    Figure CN122336446A_ABST
Patent Text Reader

Abstract

This application relates to a method for establishing a defect classification model and a defect classification method. The method includes: establishing a first AI model based on the original defect features of multiple defect samples; the first AI model is used to divide the multiple defect samples into a high-similarity group and a normal-similarity group; establishing a second AI model based on the high-similarity groups divided by the first AI model; the second AI model is used to classify each defect sample in the high-similarity group; and verifying the defect classification model formed by combining the first AI model and the second AI model to complete the establishment of the defect classification model. This method can improve the classification accuracy of highly similar defect categories.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of defect classification technology, and in particular to a method for establishing a defect classification model and a defect classification method. Background Technology

[0002] In the semiconductor industry, defect detection has always been of paramount importance, and defect classification is a crucial step in ensuring product quality. With the continuous refinement of manufacturing processes, a large number of highly similar but different types of defects have emerged, posing a significant challenge to accurate defect classification.

[0003] Traditional deep learning-based defect classification methods often rely on large-scale labeled data for model training. However, in practical applications, acquiring a large number of precisely labeled defect samples is not only time-consuming and labor-intensive but also costly. Furthermore, for some newly emerging or rare defect categories, traditional methods struggle to achieve ideal classification results due to the extremely limited sample size. In such cases, to ensure accurate classification, engineers need to spend a significant amount of time re-examining the automatic classification results, wasting time and manpower, resulting in extremely low efficiency and failing to meet the demands of today's industry development. Summary of the Invention

[0004] Therefore, it is necessary to provide a method for establishing a defect classification model and a defect classification method that can achieve accurate classification, in order to address the above-mentioned technical problems.

[0005] A method for establishing a defect classification model, the method comprising:

[0006] Based on the original defect features of multiple defect samples, the first AI model is established; the first AI model is used to divide the multiple defect samples into a high similarity group and a normal similarity group.

[0007] Based on the highly similar groups identified by the first AI model, a second AI model is established; the second AI model is used to classify each defect sample in the highly similar groups.

[0008] The defect classification model formed by combining the first AI model with the second AI model is verified to complete the establishment of the defect classification model.

[0009] In one embodiment, the first AI model includes a model-independent meta-learning algorithm model.

[0010] The establishment of the first AI model based on the original defect features of multiple defect samples includes:

[0011] Based on feature similarity calculation, the multiple defect samples are divided into a high similarity group and a normal similarity group;

[0012] Furthermore, during the establishment of the model-independent meta-learning algorithm model, the highly similar group adopts a first learning rate and a first learning round, while the ordinary similar group adopts a second learning round and a second learning rate; the first learning rate is less than the second learning rate, and / or the first learning round is greater than the second learning round.

[0013] In one embodiment, the second AI model includes a semantic parsing model.

[0014] The establishment of the second AI model based on the highly similar groups identified by the first AI model includes:

[0015] Multi-layer semantic parsing is performed on the text descriptions of the original defect features in the high similarity groups identified by the first AI model to establish a semantic parsing model; the semantic parsing model is used to perform a first classification on each defect sample in the high similarity groups.

[0016] In one embodiment, the multi-layer semantic parsing includes three layers: a base layer, a feature layer, and a scene layer. The base layer is used to parse the defect category name of the defect sample, the feature layer is used to parse the physical attributes of the defect sample, and the scene layer is used to parse the production process of the defect sample.

[0017] In one embodiment, the second AI model further includes a Transformer model.

[0018] The step of establishing the second AI model based on the highly similar groups identified by the first AI model also includes:

[0019] Based on defect samples that cannot be classified by the semantic parsing model, a Transformer model is established; the Transformer model is used to perform a second classification on defect samples that cannot be classified by the semantic parsing model.

[0020] Furthermore, the process of establishing the Transformer model based on defect samples that cannot be classified by the semantic parsing model includes:

[0021] For defect samples that cannot be separated by the first classification of the semantic parsing model, locate the core defect region;

[0022] Based on the core defect region, a dynamic sparse mask is generated for the defect sample.

[0023] Based on the dynamic sparse mask, a second classification is performed on defect samples that cannot be classified by the semantic parsing model.

[0024] In one embodiment, during the process of building the Transformer model, the number of Transformer layers and / or the number of attention heads are dynamically adjusted according to the complexity of the original defect features.

[0025] In one embodiment, the second classification of defect samples that cannot be classified by the semantic parsing model based on the dynamic sparse mask includes:

[0026] Obtain classification results with probabilities across multiple dimensions;

[0027] Based on the classification results of each dimension, the classification result of the defect sample is calculated by weighting.

[0028] In one embodiment, the second AI model further includes a compressed refined model.

[0029] The step of establishing the second AI model based on the highly similar groups identified by the first AI model also includes:

[0030] Based on defect samples that cannot be classified by the Transformer model, a compressed and refined model is established; the compressed and refined model is used to perform a third classification on defect samples that cannot be classified by the Transformer model.

[0031] Furthermore, the process of establishing a compressed, refined model based on defect samples that cannot be classified by the Transformer model includes:

[0032] For defect samples that cannot be classified by the Transformer model, second-order derivative pruning is performed to strengthen the signal strength of key parameters and remove redundant parameters.

[0033] By using context-aware quantization and dynamically adjusting the quantization accuracy, a third classification is performed on defect samples that cannot be classified by the Transformer model.

[0034] In one embodiment, a multi-layer knowledge distillation framework is used in the process of establishing the defect classification model.

[0035] A defect classification method, the method comprising:

[0036] Obtain multiple defect samples to be classified;

[0037] The defect classification model established based on any one of the above methods is used to classify the multiple defect samples.

[0038] The aforementioned defect classification model and method first establish a first AI model that divides multiple defect samples into highly similar groups and normally similar groups. Then, a second AI model is established to further classify the defect samples in the highly similar groups. This allows the final defect classification model to accurately and effectively distinguish between highly similar defect categories, thereby improving the classification accuracy of highly similar defect categories. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a schematic diagram illustrating the process of establishing a defect classification model in one embodiment;

[0041] Figure 2 This is a schematic diagram illustrating the process of establishing a defect classification model in another embodiment;

[0042] Figure 3 This is a flowchart illustrating the establishment of a defect classification model in yet another embodiment;

[0043] Figure 4 This is a flowchart illustrating the process of establishing a defect classification model in another embodiment;

[0044] Figure 5 This is a schematic diagram of the core defect region in one embodiment. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0046] The defect classification model and defect classification method provided in this application can be applied, but are not limited to, to the classification and identification of defect categories with a small number of samples. It can be understood that the defect classification model is a model with defect classification capabilities.

[0047] In one embodiment, see Figure 1 This paper provides a method for establishing a defect classification model, which includes the following steps:

[0048] Step S100: Based on the original defect features of multiple defect samples, the first AI model is established; the first AI model is used to divide multiple defect samples into a high similarity group and a normal similarity group according to the original defect features of the defect samples.

[0049] Step S200: Based on the highly similar groups identified by the first AI model, the second AI model is established; the second AI model is used to classify each defect sample in the highly similar groups.

[0050] Step S300: Verify the defect classification model formed by combining the first AI model with the second AI model to complete the establishment of the defect classification model.

[0051] In step S100, during the establishment of the first AI model, an original first AI model can be obtained first. Then, the original first AI model undergoes multiple rounds of iterative learning, training, and verification to ensure that the first AI model meets the requirements, thereby completing the establishment of the first AI model.

[0052] For example, in each round of learning, training, and validation of the first AI model, the original defect features of some defect samples can be obtained from the original database and input into the first AI model. The grouping answers for the "high similarity group and ordinary similarity group" of these defect samples can also be input into the first AI model, thereby enabling the model to learn and train. Then, the original defect features of another set of defect samples can be obtained from the original database and input into the first AI model, thereby validating the grouping ability of the continuously updated first AI model until its grouping ability meets the requirements.

[0053] The first AI model categorizes multiple defect samples into highly similar and normally similar groups based on their original defect features. First, it uses an existing knowledge base to perform a preliminary classification of each defect sample, obtaining an initial defect category. Then, based on these initial defect categories, the defect samples are further divided into "highly similar" and "normally similar" groups.

[0054] For example, a high similarity group may contain defect samples from multiple initial defect categories, and these defect samples from multiple initial defect categories are difficult to distinguish accurately. A normal similarity group may contain defect samples from one or more initial defect categories. Furthermore, each defect sample in an initial defect category in a normal similarity group can be easily distinguished from defect samples in any other initial defect category. Here, "multiple" means two or more.

[0055] At the same time, it can be understood that the initial defect categories obtained by preliminary classification of each defect sample are not the classification results of the defect categories in the final established defect classification model, but only the basis for grouping "high similarity group" and "normal similarity group".

[0056] After the first AI model is established, the original defect features of multiple defect samples are input into the first AI model. The first AI model can accurately classify the multiple defect samples into a high similarity group and a normal similarity group.

[0057] In step S200, after the first AI model is established, multiple defective samples can be grouped and divided into a high similarity group and a normal similarity group based on the first AI model that meets the requirements.

[0058] The "multiple defect samples" here can refer to multiple defect samples obtained from the original database after the first AI model has been built, in order to build the second AI model.

[0059] Then, defect samples can be extracted from the highly similar groups identified by the first AI model to build the second AI model.

[0060] In the process of building a second AI model, an original second AI model can be obtained first. Then, the original second AI model is subjected to multiple rounds of iterative learning, training, and validation to ensure that the second AI model meets the requirements, thereby completing the establishment of the second AI model.

[0061] For example, the second AI model may include multiple (e.g., two) sub-models built sequentially. Specifically, after building one sub-model through multiple rounds of iterative learning, training, and validation, another sub-model may be built through multiple rounds of iterative learning, training, and validation. Furthermore, the later-built sub-model can be built upon the earlier-built sub-model. This facilitates accurate classification of defect samples in highly similar groups. Of course, the second AI model may also include only one AI model. This application does not impose any limitations on this.

[0062] In step S300, after the establishment of the second AI model is completed, the defect classification model formed by combining the first AI model and the second AI model can be verified as a whole. When the verification is successful, the establishment of the defect classification model can be completed.

[0063] In this embodiment, a first AI model is first established to divide multiple defect samples into highly similar groups and normally similar groups. Then, a second AI model is established to further classify each defect sample in the highly similar group, so that the final defect classification model can accurately and effectively distinguish and classify highly similar defect categories.

[0064] In one embodiment, the first AI model includes a model-independent meta-learning algorithm model.

[0065] Step S100 includes:

[0066] Step S110: Based on feature similarity calculation, multiple defect samples are divided into a high similarity group and a normal similarity group.

[0067] Specifically, the feature similarity (e.g., cosine similarity) between the initial defect categories described above can be calculated. Then, when the feature similarity (e.g., cosine similarity) between two initial defect categories is greater than a preset similarity (e.g., 0.85 or 0.6), they can be considered similar and thus classified into the same high-similarity group. When the feature similarity between an initial defect category and any other initial defect category is not greater than the preset similarity, the defect samples in that initial defect category can be classified into a normal similarity group. For those in the normal similarity group, their initial defect categories can be used as the final defect category classification result of the defect classification model.

[0068] In one embodiment, during the model-independent meta-learning algorithm model building process, the high-similarity group uses a first learning rate and a first learning epoch, while the ordinary-similarity group uses a second learning epoch and a second learning rate.

[0069] The first learning rate is less than the second learning rate. Or, the first learning epoch is longer than the second learning epoch. Or, the first learning rate is less than the second learning rate, and the first learning epoch is longer than the second learning epoch.

[0070] In this case, during the training process of the model-independent meta-learning algorithm, a low learning rate (e.g., 1e-5) and / or multiple rounds of fine-tuning are used for the "high similarity group" to avoid the model "confused subtle features" during parameter updates. A high learning rate (e.g., 1e-3) and / or fast convergence are used for the "ordinary similarity group" to improve training efficiency.

[0071] For example, in the classification of defects in electronic component pins, defect samples from the two initial defect categories of "slight deformation" and "microcracks" can be classified into a high similarity group through 10 rounds of low learning rate iterations.

[0072] In one embodiment, the second AI model includes a semantic parsing model.

[0073] Please see Figure 2 Step S200 includes:

[0074] Step S210: Perform multi-layer semantic parsing on the text descriptions of the original defect features in the high similarity group divided by the first AI model to complete the establishment of the semantic parsing model; the semantic parsing model is used to perform the first classification of each defect sample in the high similarity group.

[0075] Specifically, "multi-layer" in "multi-layer semantic parsing" can mean two or more layers (such as three layers).

[0076] First, multi-layer semantic parsing can be performed on the textual description of the original defect features of the defect samples. Then, the parsed fine-grained semantics can be semantically transformed to form semantics that the algorithm can recognize, thus enabling feature mapping. Finally, the algorithm performs a first classification on each defect sample in the highly similar group based on the parsed fine-grained semantics.

[0077] For example, the CLIP model can be used to perform "cross-modal fine-grained matching" between the parsed fine-grained semantics and CLIP visual features, so as to perform semantic transformation on the parsed fine-grained semantics and form semantics that the algorithm can recognize.

[0078] In this embodiment, by performing multi-layer semantic parsing on the textual description of the original defect features of the defect samples, multi-layer information can be combined to classify each defect sample in the high similarity group, thereby obtaining the defect category of each defect sample and improving the classification accuracy.

[0079] In one embodiment, multi-layer semantic parsing includes three layers: a base layer, a feature layer, and a scene layer.

[0080] The base layer is used to parse the defect category name of the defect sample (such as "scratch", "indentation" etc.), the feature layer is used to parse the physical properties of the defect sample (such as "depth 0.1mm, smooth edge" etc.), and the scene layer is used to parse the production process of the defect sample (such as "from stamping process" etc.).

[0081] It is understandable that for a defect sample, the textual description of its original defect features may contain three complete semantic layers: the base layer, the feature layer, and the scene layer, or it may contain one or two of these three semantic layers. The number and types of semantic layers contained in the textual descriptions of the original defect features of different defect samples may be the same or different.

[0082] For example, the textual description of the original defect features of a defect sample includes "minor linear surface defects (generated by the stamping process)". During semantic parsing, the scene-level semantic term "stamping process" can be used to identify "indentation" (rather than "scratches," which are more often associated with the cutting process). Then, the feature-level semantic parsing can be used to further classify the defect sample by checking for metal buildup at the edges, thereby effectively improving classification accuracy.

[0083] In one embodiment, the second AI model also includes a Transformer model.

[0084] Please see Figure 3 Step S200 further includes:

[0085] Step S220: Based on the defect samples that cannot be classified by the semantic parsing model, complete the establishment of the Transformer model; the Transformer model is used to perform a second classification on the defect samples that cannot be classified by the semantic parsing model.

[0086] At this point, based on the Transformer model, the defect samples in the highly similar group that cannot be classified by the semantic parsing model can be further refined and classified, thereby distinguishing these defect samples.

[0087] In one embodiment, step S220 includes:

[0088] Step S221: For defect samples that cannot be separated by the first classification of the semantic parsing model, locate the core defect region;

[0089] Step S222: Generate a dynamic sparse mask for the defect sample based on the core defect region;

[0090] Step S223: Based on the dynamic sparse mask, perform a second classification on defect samples that cannot be classified by the semantic parsing model.

[0091] In step S221, please refer to Figure 5 Figures (a) to (d) show how a "defect region detection network" (such as YOLOv8-tiny) can locate the core defect region in the sample image of a defect sample. The core defect region can, for example, occupy 15%-20% of the entire defect sample image.

[0092] In step S222, a dynamic sparse mask that only covers the core region of the defect can be generated.

[0093] In step S223, based on the dynamic sparse mask, the Transformer model can perform attention calculations only on the original defect features of the key region (defect core region).

[0094] In this embodiment, by focusing on the core area of ​​the defect, the amount of redundant feature calculations can be greatly reduced, thereby improving operating efficiency.

[0095] In one embodiment, during the construction of the Transformer model, the number of Transformer layers and / or the number of attention heads are dynamically adjusted based on the complexity of the original defect features.

[0096] Specifically, before step S220 (establishing the Transformer model based on defect samples that cannot be classified by the semantic parsing model), a "category feature complexity estimator" can be introduced to at least evaluate the complexity of defect samples that cannot be classified by the semantic parsing model.

[0097] Then, during the execution of step S220, the number of Transformer layers and / or the number of attention heads are dynamically adjusted according to the complexity of the original defect features.

[0098] For example, the number of Transformer layers can be adjusted from 2 to 6 layers. The number of attention heads can be adjusted from 2 to 8 heads.

[0099] For example, the original defect feature of "slight deformation" has low complexity, while the original defect feature of "microcrack + edge oxidation" has high complexity.

[0100] For example, for low-complexity defect samples in a high-similarity group, a "2-layer + 2-head" structure can be used to focus on fine-grained features. For high-complexity defect samples in a high-similarity group, a "6-layer + 8-head" structure can be used to mine multi-dimensional correlation features.

[0101] At this point, the utilization rate of key features of defective samples in highly similar groups can be effectively improved, thereby effectively improving classification accuracy.

[0102] In one embodiment, step S223 includes:

[0103] Step S21: Obtain the classification results of multiple dimensions of probability;

[0104] Step S22: Based on the classification results of each dimension, calculate the classification results of the defect samples using a weighted average.

[0105] For example, the classification result of multiple probabilities may include the classification result of the feature similarity probability dimension, the classification result of the category prior probability dimension, and the classification result of the historical confidence probability dimension.

[0106] The classification result based on the feature similarity probability dimension can be determined by the feature matching degree between the defect sample to be classified and defect samples of known defect categories. The classification result based on the category prior probability dimension can be determined by the frequency of occurrence of defect categories in production data. The classification result based on the historical confidence probability dimension can be determined by the historical classification accuracy of the model for defect categories.

[0107] After obtaining the classification results of multiple probabilities, the defect sample to which the defect sample to be classified belongs can be calculated by using a weighted fusion formula.

[0108] For example, the weight of the feature similarity probability dimension can be 0.4. The weight of the category prior dimension can be 0.3. The weight of the historical confidence dimension can be 0.3.

[0109] In the weighted fusion formula, the final probability = 0.4 × feature similarity probability + 0.3 × category prior probability + 0.3 × historical confidence probability. Based on this, the final decision result can be generated.

[0110] For example, the classification result of the feature similarity probability dimension is: the probability of "slight deformation" is 0.75, and the probability of "micro-crack" is 0.72.

[0111] The classification result of the prior dimension of the category is: the probability of "slight deformation" is 0.8, and the probability of "micro-crack" is 0.05.

[0112] The classification results for the historical confidence dimension are: the probability of "slight deformation" is 0.92, and the probability of "micro-crack" is 0.88.

[0113] The final probability that the current defect sample is "slight deformation" is 0.4 × 0.75 + 0.3 × 0.8 + 0.3 × 0.92 = 0.816. The final probability that the current defect sample is "micro-crack" is 0.4 × 0.72 + 0.3 × 0.05 + 0.3 × 0.88 = 0.567. Based on this, the defect category of the defect sample to be classified can be determined as "slight deformation".

[0114] In this embodiment, when the probabilities of two defect categories are close in the classification results of the feature similarity probability dimension, the results of other dimensions can be combined to more accurately and effectively determine the defect category of the defect sample to be classified. For example, as mentioned above, in terms of the feature similarity probability dimension, the probability of the defect sample to be classified as "slight deformation" is 0.75, and the probability of it being "micro-crack" is 0.72. At this time, the defect sample can be locked as "slight deformation" through the category prior probability dimension.

[0115] In one embodiment, the second AI model also includes a compressed refined model.

[0116] Please see Figure 4 Step S200 further includes:

[0117] Step S230: Based on the defect samples that cannot be classified by the Transformer model, complete the establishment of the compressed fine model; the compressed fine model is used to perform a third classification on the defect samples that cannot be classified by the Transformer model.

[0118] Step S230 includes:

[0119] Step S231: For defect samples that cannot be classified by the Transformer model, perform second derivative pruning to strengthen the signal strength of key parameters and remove redundant parameters.

[0120] Step S232: Through context-aware quantization, the quantization accuracy is dynamically adjusted to perform a third classification on defect samples that cannot be classified by the Transformer model.

[0121] In step S231, the second derivative of the parameters in the defect classification model building process with respect to the "highly similar defect classification loss" can be calculated. Based on this second derivative, key parameters with "low weight but high contribution" (such as edge detection-related convolution kernel parameters) can be identified. After identifying the key parameters, the signal strength of these key parameters can be enhanced, making the key features clearer and facilitating classification. Simultaneously, parameters with "high weight but low contribution" are pruned to remove redundant parameters. For example, parameters with a "second derivative < 0.01" are considered redundant parameters. For example, the pruning ratio can be controlled within 40% to avoid losing key features.

[0122] For example, for two defect samples with high similarity, “scratches” and “pits”, “scratches” are produced by chemical mechanical polishing (CMP) and “pits” are produced by physical vapor deposition (PVD).

[0123] Please see Figure 5 In Figure (a), the image edges of "scratches" are prone to exhibiting a "tailing" feature. To address this, when identifying whether a defect sample is classified as a "scratch," after locating the core defect region, second-derivative pruning can be used to identify key parameters, thereby making the "tailing" feature of the "scratch" more clearly visible and facilitating classification. Please refer to [link to relevant documentation]. Figure 5 In Figure (c), when identifying whether the defect category of a defect sample is "deep pit", after locating the core defect region, if the core defect region contains two deep pits, redundant parameters can be removed by second derivative pruning, and one of the deep pits can be removed, thereby reducing the amount of computation.

[0124] In step S232, for example, the quantization precision can be dynamically adjusted according to the function of the layer where the parameter resides (e.g., shallow layers are responsible for edge extraction, and deep layers are responsible for semantic fusion). For example, shallow layer parameters can use 16-bit quantization to preserve fine-grained features. Deep layer parameters can use 8-bit quantization to reduce computation. For example, 32-bit precision can be preserved for "highly similar defect-sensitive parameters" (e.g., gradient detection parameters).

[0125] In this embodiment, the compressed fine-grained model performs a third classification of defect samples by combining joint pruning and context-aware quantization. This strategy reduces the number of parameters and computational cost of the defect classification model without significantly decreasing the classification accuracy of highly similar defects, thus improving operational efficiency while maintaining defect classification accuracy.

[0126] In one embodiment, a multi-layered knowledge distillation framework is employed throughout the process of building the defect classification model.

[0127] For example, a multi-layer knowledge distillation framework may include output layer distillation, intermediate layer distillation, and classification logic distillation.

[0128] Output layer distillation can pass on the teacher model’s soft labels for defective samples in highly similar groups (e.g., “scratches” 0.92, “indentations” 0.08).

[0129] Intermediate layer distillation can transmit the feature distribution of the teacher model’s “shallow edge feature layer”, “middle shape feature layer”, and “deep semantic feature layer”, enabling the student model to learn the hierarchical feature differences of defective samples in highly similar groups.

[0130] Classification logistic distillation can introduce "feature contrast loss" to guide the student model to learn the teacher model's "classification criteria" for defective samples in highly similar groups (e.g., "judging as "scratches" based on edge smoothness > 0.8).

[0131] Experiments show that this distillation framework can effectively improve the F1 score of the lightweight student model for classifying defective samples in highly similar groups, thereby improving the model's accuracy.

[0132] In one embodiment, a defect classification method is provided, comprising the following steps:

[0133] Step S10: Obtain multiple defect samples to be classified;

[0134] Step S20: Based on the defect classification model established by any of the above methods, classify multiple defect samples.

[0135] Specifically, after obtaining multiple defect samples to be classified, the defect features of the multiple defect samples can be input into the defect classification model, thereby classifying the multiple defect samples through the defect classification model.

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

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

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

Claims

1. A method for establishing a defect classification model, characterized in that, The method includes: Based on the original defect features of multiple defect samples, the first AI model is established; the first AI model is used to divide the multiple defect samples into a high similarity group and a normal similarity group. Based on the highly similar groups identified by the first AI model, a second AI model is established; the second AI model is used to classify each defect sample in the highly similar groups. The defect classification model formed by combining the first AI model with the second AI model is verified to complete the establishment of the defect classification model.

2. The method according to claim 1, characterized in that, The first AI model includes a model-independent meta-learning algorithm model. The establishment of the first AI model based on the original defect features of multiple defect samples includes: Based on feature similarity calculation, the multiple defect samples are divided into a high similarity group and a normal similarity group; Furthermore, during the establishment of the model-independent meta-learning algorithm model, the highly similar group adopts a first learning rate and a first learning round, while the ordinary similar group adopts a second learning round and a second learning rate; the first learning rate is less than the second learning rate, and / or the first learning round is greater than the second learning round.

3. The method according to claim 1, characterized in that, The second AI model includes a semantic parsing model. The establishment of the second AI model based on the highly similar groups identified by the first AI model includes: Multi-layer semantic parsing is performed on the text descriptions of the original defect features in the high similarity groups identified by the first AI model to establish a semantic parsing model; the semantic parsing model is used to perform a first classification on each defect sample in the high similarity groups.

4. The method according to claim 3, characterized in that, The multi-layer semantic parsing includes three layers: a base layer, a feature layer, and a scene layer. The base layer is used to parse the defect category name of the defect sample, the feature layer is used to parse the physical attributes of the defect sample, and the scene layer is used to parse the production process of the defect sample.

5. The method according to claim 3, characterized in that, The second AI model also includes the Transformer model. The step of establishing the second AI model based on the highly similar groups identified by the first AI model also includes: Based on defect samples that cannot be classified by the semantic parsing model, a Transformer model is established; the Transformer model is used to perform a second classification on defect samples that cannot be classified by the semantic parsing model. Furthermore, the process of establishing the Transformer model based on defect samples that cannot be classified by the semantic parsing model includes: For defect samples that cannot be separated by the first classification of the semantic parsing model, locate the core defect region; Based on the core defect region, a dynamic sparse mask is generated for the defect sample. Based on the dynamic sparse mask, a second classification is performed on defect samples that cannot be classified by the semantic parsing model.

6. The method according to claim 5, characterized in that, During the process of building the Transformer model, the number of Transformer layers and / or the number of attention heads are dynamically adjusted according to the complexity of the original defect features.

7. The method according to claim 5, characterized in that, The second classification of defect samples that cannot be classified by the semantic parsing model based on the dynamic sparse mask includes: Obtain classification results with probabilities across multiple dimensions; Based on the classification results of each dimension, the classification result of the defect sample is calculated by weighting.

8. The method according to claim 5, characterized in that, The second AI model also includes a compressed fine-grained model. The step of establishing the second AI model based on the highly similar groups identified by the first AI model also includes: Based on defect samples that cannot be classified by the Transformer model, a compressed and refined model is established; the compressed and refined model is used to perform a third classification on defect samples that cannot be classified by the Transformer model. Furthermore, the process of establishing a compressed, refined model based on defect samples that cannot be classified by the Transformer model includes: For defect samples that cannot be classified by the Transformer model, second-order derivative pruning is performed to strengthen the signal strength of key parameters and remove redundant parameters. By using context-aware quantization and dynamically adjusting the quantization accuracy, a third classification is performed on defect samples that cannot be classified by the Transformer model.

9. The method according to claim 1, characterized in that, In establishing the defect classification model, a multi-layer knowledge distillation framework is employed.

10. A defect classification method, characterized in that, The method includes: Obtain multiple defect samples to be classified; The defect classification model established based on the method described in any one of claims 1-9 is used to classify the plurality of defect samples.