Defect detection method and device, electronic device and storage medium

By performing feature extraction and prompt learning module training on the image to be tested of wafers or wafer particles, and combining with the language model to generate detection results, the problem of inaccurate detection of complex defects in the prior art is solved, and higher detection accuracy and flexibility are achieved.

CN119741280APending Publication Date: 2025-04-01SUZHOU MEGAROBO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411880306.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect complex and numerous defects in wafers or wafer particles, and the deep learning model's detection ability for a single defect type is reduced when detecting multiple defects.

Method used

Feature extraction is performed on the image to be tested of the object to be tested, input it to the trained prompt learning module to obtain enhanced features, and input it into the language model to generate detection results in combination with query information. This method uses training text features to align with image features and adjusts the parameters of the prompt learning module to improve the accuracy of defect detection.

Benefits of technology

It improves the accuracy of detection of complex defects of wafers or wafer particles, and can flexibly describe multiple defect types and adapt to complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741280A_ABST
    Figure CN119741280A_ABST
Patent Text Reader

Abstract

The present invention provides a defect detection method and device, electronic device and storage medium. The above-mentioned detection method includes: performing a feature extraction operation on a test image of an object to be tested to obtain a first image feature of the test image; inputting the first image feature into a trained prompt learning module to obtain a first enhanced feature of the object to be tested; inputting the first enhanced feature and the first query information into a language model to obtain a detection result. On the one hand, the present invention obtains a first enhanced feature related to the defects of a wafer or a wafer grain through a trained prompt learning module, thereby enabling the language model to focus on describing the defects of the wafer or the wafer grain in the test image; on the other hand, the text content of the detection result can be more flexible, which is conducive to adapting to the scene where there are complex and numerous defects in the wafer or the wafer grain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and more specifically to a defect detection method, a defect detection device, an electronic device, a storage medium and a computer program product. Background Art

[0002] In the industrial field, with the continuous development of production technology, people have put forward higher requirements for the production quality and production efficiency of industrial products. With the development of image processing technology, more and more product inspections are based on images.

[0003] Since there may be many types of defects in wafers or wafer grains, the process of defect detection based on the image of wafers or wafer grains is relatively complicated. If the deep learning model in the related art is used to detect defects in wafers or wafer grains, as the number of defect types that the deep learning model can detect increases, its detection ability for a single defect type will decrease. In addition, it is difficult for deep learning models to accurately detect the complex and numerous defects in wafers or wafer grains. Therefore, how to detect wafers or wafer grains more accurately is a technical problem that technicians in this field urgently need to solve. Summary of the invention

[0004] The present invention is proposed in view of the above problems. The present invention provides a defect detection method, a defect detection device, an electronic device, a storage medium and a computer program product.

[0005] According to one aspect of the present invention, a defect detection method is provided, the detection method comprising:

[0006] Performing a feature extraction operation on the image to be tested of the object to be tested to obtain a first image feature of the image to be tested, wherein the object to be tested is a wafer or a wafer die;

[0007] Inputting the first image feature into a trained prompt learning module to obtain a first enhanced feature of the object to be tested, wherein the trained prompt learning module is trained by using a second image feature of a training image of the training object and a training text feature of the training object, and the training text feature is obtained by performing a feature extraction operation on a training text related to a defect type of the training object;

[0008] The first enhanced feature and the first query information are input into the language model to obtain a detection result, wherein the first query information is used to guide the generation of the detection result, and the detection result is used to describe the defect type of the object to be detected.

[0009] Exemplarily, the trained prompt learning module is obtained by the following steps:

[0010] Performing a feature extraction operation on a training image of the training object to obtain a second image feature, and performing a feature extraction operation on a training text of the training object to obtain a training text feature;

[0011] Aligning the second image feature with the training text feature to obtain a focus feature;

[0012] Inputting the attention feature and the second image feature into an untrained prompt learning module to obtain a prompt learning feature;

[0013] Inputting the prompt learning features and the training query information into the language model to obtain a prediction result, wherein the training query information is used to guide the generation of the prediction result;

[0014] Based on the difference between the prediction results and the training text, the module parameters of the untrained prompt learning module are adjusted.

[0015] Exemplarily, performing a feature extraction operation on a training image of a training object to obtain a second image feature includes:

[0016] Inputting the training image into the feature extraction modules connected in sequence, so that the last feature extraction module outputs the second image feature;

[0017] Align the second image feature with the training text feature to obtain the focus feature, including:

[0018] For the intermediate image feature or the second image feature output by each feature extraction module, align the intermediate image feature or the second image feature with the training text feature to obtain a corresponding alignment result;

[0019] Based on each alignment result, features of interest are determined.

[0020] Exemplarily, for the intermediate image feature or the second image feature output by each feature extraction module, the intermediate image feature or the second image feature is aligned with the training text feature to obtain a corresponding alignment result, including:

[0021] For the intermediate image features or the second image features output by each feature extraction module, determine the similarity between the features of each feature point in the intermediate image features or the second image features and the training text features, so as to obtain a similarity matrix between the intermediate image features or the second image features and the training text features as the corresponding alignment result;

[0022] Based on each alignment result, features of interest are identified, including:

[0023] All similarity matrices are fused to obtain a fusion matrix and used as the focus feature.

[0024] Exemplarily, the attention feature and the second image feature are input into an untrained prompt learning module to obtain a prompt learning feature, including:

[0025] Perform feature extraction operations on the features of interest;

[0026] The feature extracted by the feature extraction is concatenated with the second image feature to obtain the prompt learning feature.

[0027] Exemplarily, performing a feature extraction operation on the feature of interest includes:

[0028] Perform a convolution operation on the feature of interest to obtain a first convolution feature;

[0029] Performing an activation operation on the first convolution feature to obtain a first activation feature;

[0030] Performing a pooling operation on the first activation feature to obtain a first pooled feature;

[0031] Based on the first pooled features, a convolution operation is performed to obtain the focus feature after feature extraction.

[0032] Exemplarily, the training text includes a text description related to whether the training object has defects, a text description related to the defect type of the training object, a text description related to the processing stage of the training object, and a text description related to the location of the defect of the training object in the training image.

[0033] According to yet another aspect of the present invention, a defect detection device is provided. The detection device includes: a first image feature extraction module, a first enhanced feature generation module and a detection result generation module.

[0034] A first image feature extraction module is used to perform a feature extraction operation on the image to be tested of the object to be tested to obtain a first image feature of the image to be tested, wherein the object to be tested is a wafer or a wafer die;

[0035] a first enhanced feature generation module, used for inputting the first image feature into a trained prompt learning module to obtain a first enhanced feature of the object to be tested, wherein the trained prompt learning module is obtained by training using a second image feature of a training image of the training object and a training text feature of the training object, and the training text feature is obtained by performing a feature extraction operation on a training text related to a defect type of the training object;

[0036] The detection result generation module is used to input the first enhanced feature and the first query information into the language model to obtain the detection result, wherein the first query information is used to guide the generation of the detection result, and the detection result is used to describe the defect type of the object to be detected.

[0037] According to another aspect of the present invention, an electronic device is provided, which includes a processor and a memory, wherein the memory stores computer program instructions, and the computer program instructions are used to execute the above-mentioned defect detection method when the processor is running.

[0038] According to another aspect of the present invention, a storage medium is provided, on which program instructions are stored, and the program instructions are used to execute the above-mentioned defect detection method when running.

[0039] According to another aspect of the present invention, a computer program product is also provided, wherein the computer program product comprises computer program instructions, and the computer program instructions are used to execute the above-mentioned defect detection method when running.

[0040] According to the above scheme of the embodiment of the present invention, a feature extraction operation can be performed on the image to be tested of the object to be tested to obtain the first image feature of the image to be tested. Then, the first image feature is input into the trained prompt learning module to obtain the first enhanced feature of the object to be tested. Finally, the first enhanced feature and the first query information are input into the language model to obtain the detection result. On the one hand, the above scheme obtains the first enhanced feature related to the defects of the wafer or wafer grain through the trained prompt learning module, so that the language model can focus on describing the defects of the wafer or wafer grain in the image to be tested, which is conducive to improving the accuracy of the detection result; on the other hand, the detection result in the above scheme is obtained by combining the language model with the first query information, which can be used to describe the defect type of the wafer or wafer grain. Compared with the method of using the prediction label output by the deep learning model to represent the defect type, the text content of the detection result in the above scheme can be more flexible, which is conducive to adapting to the scene with complex and numerous defects in the wafer or wafer grain. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The above and other purposes, features and advantages of the present invention will become more apparent by describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0042] Figure 1 A schematic flow chart of a defect detection method according to an embodiment of the present invention is shown;

[0043] Figure 2 A schematic diagram showing a defect detection method in a training phase according to an embodiment of the present invention is shown;

[0044] Figure 3A schematic diagram showing a wafer defect according to an embodiment of the present invention is shown;

[0045] Figure 4 A schematic block diagram showing a defect detection device according to an embodiment of the present invention; and

[0046] Figure 5 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical scheme and advantages of the present invention more obvious, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described herein. Based on the embodiments of the present invention described in the present invention, all other embodiments obtained by those skilled in the art without creative work should fall within the protection scope of the present invention.

[0048] In the field of component manufacturing, if defective industrial components (such as wafers) are packaged and tested, it will waste manpower and material resources, so it is necessary to inspect the industrial components so that unqualified industrial components can be detected and eliminated. However, there may be a variety of defects on industrial components. For example, taking wafers as an example, there may be defects such as foreign matter and cracks on the wafer. For another example, taking the wafer grains on the wafer as an example, there may be defects such as pin prints out of bounds, too many pin prints, and foreign matter on the wafer grains. However, the defect types that can be output by the defect detection model in the prior art are limited, which is not conducive to adapting to the actual scenario where there are complex and numerous defects in wafers or wafer grains.

[0049] In order to at least partially solve the above problem, an embodiment of the present invention provides a defect detection method. Figure 1 FIG. 1 is a schematic flow chart of a defect detection method according to an embodiment of the present invention. Figure 1 As shown, the method may include the following steps S110 to S130.

[0050] In step S110, a feature extraction operation is performed on the image to be tested of the object to be tested to obtain a first image feature of the image to be tested.

[0051] The object to be tested may be a wafer or a wafer die. The image to be tested of the object to be tested may be a static image of the wafer or the wafer die, or any video frame in a dynamic video of the wafer or the wafer die. The image to be tested may be an original image of the wafer or the wafer die acquired by an image acquisition device (for example, an original image acquired by an image sensor in a camera), or an image obtained after preprocessing the original image (such as digitization, normalization, smoothing, etc.).

[0052] The above-mentioned feature extraction operation can be obtained by processing the image to be tested through a feature extraction algorithm or a feature extraction module. For example, the image to be tested can be processed through a feature extraction algorithm such as principal component analysis and linear discriminant analysis to obtain the first image feature. For another example, the image to be tested can be processed through a feature extraction module such as a feature extraction layer in a convolutional neural network and a feature extraction layer in a recurrent neural network to obtain the first image feature.

[0053] In step S120, the first image feature is input into the trained prompt learning module to obtain a first enhanced feature of the object to be tested.

[0054] The trained prompt learning module is obtained by training using the second image feature of the training image of the training object and the training text feature of the training object. The training text feature is obtained by performing a feature extraction operation on the training text related to the defect type of the training object. In one example, the feature extraction method described above can be used to perform a feature extraction operation on the training image to obtain the second image feature; the feature extraction method described above can also be used to perform a feature extraction operation on the training text to obtain the training text feature. It should be understood that the training text can also be input into the text encoder in the language model to obtain the text embedding of the training text and use the text embedding as the training text feature. The training text can be related to the defects in the training object, so that the trained prompt learning module can focus on the defects of the image to be tested. It should be understood that the above-mentioned training object can include an object with defects or an object without defects. The training text related to the defect type of the object without defects can include a text description for describing that the object does not have defects.

[0055] In some embodiments, the prompt learning module can be obtained by training the second image feature of the training image of the training object and the training text feature of the training object. In some other embodiments, the prompt learning module can be obtained by training the second image feature of the training image of the training object, the training text feature of the training object and the prompt learning vector. The prompt learning vector can be obtained by performing a feature extraction operation on the prompt text in the field of wafer detection. Based on the prompt learning vector, the prompt learning module is trained. On the one hand, the prompt learning vector can be used to provide additional context information for the prompt learning module to help the prompt learning module understand the task requirements; on the other hand, the training efficiency of the model can be increased so that it can focus on learning the relevant feature distribution in the field of wafer detection. In one example, the module parameters of the prompt learning module can be iteratively adjusted based on the second image feature and the training text feature based on direct fine-tuning, soft prompt learning, discrete prompt learning, multi-task prompt learning, etc., to obtain the trained prompt learning module. The specific training process of the prompt learning module is not limited by the embodiment of the present invention.

[0056] In step S130, the first enhanced feature and the first query information are input into a language model to obtain a detection result.

[0057] The first query information can be used to guide the generation of the test result, and the test result is used to describe the defect type of the object to be tested. The first query information can be input by the user through an input device, for example, the input device can include a keyboard, a microphone, etc. The first query information can be directly input through the keyboard, or a voice can be input through the microphone, and then the voice is converted into the first query information. The first query information can be used to query the defect-related information of the image to be tested, and the test result can be used to describe the semantics of the first query information and the defect-related content of the relevant content in the image to be tested.

[0058] The language model in the embodiment of the present invention may be any language model with language question-answering capabilities. For example, the language model may be a model such as BERT (Bidirectional Encoder Representations from Transformers), GPT (Generative Pre-trained Transformer), or LLMMA (Large Language Model Meta AI).

[0059] The above-mentioned language model may include at least an encoder (which may be the text encoder mentioned above) and a decoder. The above-mentioned encoder may be used to convert the first query information into a first query code, and input it into the decoder together with the first enhanced feature to generate a detection result that conforms to natural language. In combination with the actual scenario, the first query information may be "Does the wafer in this picture have an abnormal area, and what is the type of abnormality", and the detection result may be "There is an abnormal area on the wafer in this picture, and the type of the abnormal area is scratches". It should be understood that the above-mentioned encoder can also be used to convert training text into training text features.

[0060] According to the above scheme of the embodiment of the present invention, a feature extraction operation can be performed on the image to be tested of the object to be tested to obtain the first image feature of the image to be tested. Then, the first image feature is input into the trained prompt learning module to obtain the first enhanced feature of the object to be tested. Finally, the first enhanced feature and the first query information are input into the language model to obtain the detection result. On the one hand, the above scheme obtains the first enhanced feature related to the defects of the wafer or wafer grain through the trained prompt learning module, so that the language model can focus on describing the defects of the wafer or wafer grain in the image to be tested, which is conducive to improving the accuracy of the detection result; on the other hand, the detection result in the above scheme is obtained by combining the language model with the first query information, which can be used to describe the defect type of the wafer or wafer grain. Compared with the method of using the prediction label output by the deep learning model to represent the defect type, the text content of the detection result in the above scheme can be more flexible, which is conducive to adapting to the scene with complex and numerous defects in the wafer or wafer grain.

[0061] Exemplarily, the trained prompt learning module can be obtained through the following steps S210 to S250.

[0062] In step S210, a feature extraction operation is performed on the training image of the training object to obtain a second image feature, and a feature extraction operation is performed on the training text of the training object to obtain a training text feature.

[0063] The data set used by the trained prompt learning module may include: a training image, a training text corresponding to the training image, and training query information corresponding to the training image. The above training text can be used to describe relevant information about the defects of the training object, such as whether the training object has defects, the defect type of the defects existing in the training object, etc. The above training query information can be used to query the training image related to defects. The specific content of the training text and the training query information can be set by the developer, and the embodiment of the present invention does not limit this.

[0064] In step S220, the second image feature is aligned with the training text feature to obtain a focus feature.

[0065] The second image feature can be directly aligned with the training text feature. It should be understood that other feature-related operations can also be performed on the second image feature to meet actual needs. For example, feature enhancement operations, feature screening operations, etc. can be performed on the second image feature. In some embodiments, for each feature point in the second image feature, the feature point can be similarly calculated with the training text feature to obtain the similarity between the feature point and the training text feature. Based on this, the similarity corresponding to each feature point in the second image feature can be obtained to form a similarity matrix. It should be understood that the similarity matrix can adapt to the dimension of the second image feature. For example, if the second image feature is converted into a one-dimensional vector, the similarity matrix can be converted into a one-dimensional arrangement of similarities. If the second image feature is a two-dimensional feature map, the similarity matrix can also be a two-dimensional arrangement of similarities. The above similarity can be obtained by calculating the Euclidean distance, calculating the cosine similarity, etc., and the embodiment of the present invention is not limited here. It should be understood that the second image feature and the training text feature can also be aligned by methods based on attention mechanism, based on contrastive learning, etc., and the embodiment of the present invention is not limited here.

[0066] In one example, the similarity matrix obtained by the second image feature can be directly used as the focus feature. In another example, for each feature point, the similarity corresponding to the feature point can be used as a weight to perform an operation with the feature of the feature point to obtain a new feature corresponding to each feature point, and the new features corresponding to all feature points are used as the focus features.

[0067] In step S230, the attention feature and the second image feature are input into an untrained prompt learning module to obtain a prompt learning feature.

[0068] It should be understood that the prompt learning vectors mentioned above can also be input into the prompt learning module that has not been trained during the training process to improve the learning efficiency of the prompt learning module. In one example, any of the above items can also be processed with features (such as feature enhancement, feature screening, etc. mentioned above) and then input into the prompt learning module that has not been trained to obtain prompt learning features.

[0069] In step S240, the prompt learning features and the training query information are input into the language model to obtain a prediction result, wherein the training query information is used to guide the generation of the prediction result.

[0070] The above-mentioned language model may include at least an encoder and a decoder. The above-mentioned encoder may be used to convert the training query information into the training query information encoding, and input it into the decoder together with the prompt learning feature to generate a prediction result that conforms to natural language. The above-mentioned training query information can be used to query the training images related to defects. Combined with the actual scene, the training query information may be "what defects does the wafer in this picture have", and the prediction result may be "there are foreign objects in the wafer in this picture".

[0071] In step S250, based on the difference between the prediction result and the training text, the module parameters of the prompt learning module that has not been trained are adjusted.

[0072] The difference between the above prediction result and the training text can be used as part of the loss value of the prompt learning module that has not been trained. The training goal of the prompt learning module may include minimizing the loss value. Therefore, the prompt learning module obtained by the above scheme training can continuously reduce the difference between the prediction result and the training text, and then accurately represent the text related to the defects in the image to be tested. In one example, the difference between the prediction result and the training text can be represented by a mean square error, a cross entropy, etc. It should be understood that the difference between the prediction result and the training text can be used as part of the loss value, and the loss value can also include the loss value obtained by other loss functions in the relevant technology, and the embodiment of the present invention is not limited here. The module parameters of the prompt learning module that has not been trained can be adjusted by gradient descent, back propagation, etc. to obtain the trained prompt learning module. It should be understood that the training image can also correspond to a defect area marking matrix, and the defect area in the training image can be marked as 1 and the non-defect area can be marked as 0. Then the difference between the defect area marking matrix and the similarity matrix is ​​also used as part of the loss value.

[0073] According to the above scheme of the embodiment of the present invention, a feature extraction operation can be performed on the training image to obtain the second image feature, and a feature extraction operation can be performed on the training text to obtain the training text feature. Then, the second image feature is aligned with the training text feature to obtain the focus feature. The focus feature and the second image feature are then input into the untrained prompt learning module to obtain the prompt learning feature. Then, the prompt learning feature and the training query information are input into the language model to obtain the prediction result. Finally, based on the difference between the prediction result and the training text, the module parameters of the untrained prompt learning module are adjusted. The above scheme can align the training text feature with the second image feature so that the prompt learning module can learn the image features corresponding to the descriptions related to different defects, and then can obtain the description related to the defects of the object to be tested based on the image to be tested, which is conducive to improving the accuracy of the detection results of the object to be tested.

[0074] Exemplarily, the training text includes a text description related to whether the training object has defects, a text description related to the defect type of the training object, a text description related to the processing stage of the training object, and a text description related to the location of the defect of the training object in the training image.

[0075] For example, the above text descriptions related to whether the training object has defects may include: "The wafer has defects", "The wafer grain has no defects", etc. The above text descriptions related to the defect type of the training object may include: "The defect is caused by scratches", "The defect type is the presence of foreign matter", etc. The text description related to the processing stage of the training object may include: "This is an image taken during the development process stage of the wafer manufacturing process", "This is an image taken during the development and etching stage of the wafer manufacturing process". The above text descriptions related to the position of the defect of the training object in the training image may include: "The scratch runs through the upper left corner to the lower middle part", "There are foreign matter in the pad area", etc.

[0076] refer to Figure 3 , Figure 3 A schematic diagram of a wafer defect according to an embodiment of the present invention is shown. Among them, training image a is a training image with a scratch defect. The training text of the training image a may include: "This is an image taken during the development process stage of the wafer manufacturing process. There is a defective area in this image. The defect is caused by scratches, and the scratches run from the upper left corner to the lower middle part." In the training text, "This is an image taken during the development process stage of the wafer manufacturing process" is a text description related to the processing stage that the training object is in. "There is a defective area in this image" is a text description related to whether the training object has a defect. "The defect is caused by scratches" is a text description related to the defect type of the training object. "The scratches run from the upper left corner to the lower middle part" is a text description related to the position of the defect of the training object in the training image.

[0077] It should be understood that developers can also add or delete relevant content in the training text according to actual needs. For example, the training text can also include the visual characteristics of the training image. For example, Figure 3 The training image b is a training image without defects. The training text of the training image b may include "This is an image taken during the development and etching stage of the wafer manufacturing process. This image consists of red and white lines. There is no defective area in this image". In the training text, "This is an image taken during the development and etching stage of the wafer manufacturing process" is a text description related to the processing stage of the training object. "There is no defective area in this image". is a text description related to whether the training object has defects. "This image consists of red and white lines" is a visual feature of the training image.

[0078] The prompt learning module obtained based on the above-mentioned training text training and the detection results obtained by combining the language model processing may include a text description related to whether there are defects in the object to be tested, a text description related to the defect type of the object to be tested, a text description related to the processing stage of the object to be tested, a text description related to the position of the defect of the object to be tested in the image to be tested, and the visual characteristics of the image to be tested.

[0079] According to the above scheme of the present invention, the training text can be limited so that the detection result can include a variety of text descriptions related to the defects in the image to be tested, and then the defects of the object to be tested can be described from different angles, which is conducive to improving the information breadth of the detection result.

[0080] Exemplarily, step S210 performs a feature extraction operation on the training image of the training object to obtain the second image feature, which may include: inputting the training image into sequentially connected feature extraction modules, so that the last feature extraction module outputs the second image feature.

[0081] The feature extraction module may be a feature extraction module in any machine learning model. For example, the feature extraction module may be a convolutional feature extraction module in a convolutional neural network, a cyclic feature extraction module in a cyclic neural network, a graph convolutional feature extraction module in a graph neural network, etc. Here, the feature extraction module in a convolutional feature extraction network is taken as an example. The feature extraction module may include a convolutional layer, an activation layer, and a pooling layer connected in sequence. The convolutional layer may convolve the input data of the feature extraction module and then input it into the activation layer. The activation layer may process the convolved input data through a preset activation function to obtain activation data, and input it into the pooling layer. The pooling layer may process the activation data through maximum pooling, average pooling, etc. as the output of the feature extraction module.

[0082] Step S220 aligns the second image feature with the training text feature to obtain the focus feature, which may include step S221 and step S222.

[0083] In step S221, for the intermediate image feature or the second image feature output by each feature extraction module, the intermediate image feature or the second image feature is aligned with the training text feature to obtain a corresponding alignment result.

[0084] In one example, the intermediate image features and the second image features can be directly aligned with the training text features. If the feature size of each intermediate image feature is the same, and the feature size of the intermediate image feature is the same as that of the second image feature, the intermediate image feature and the second image feature can be directly aligned with the training text features. The alignment results thus obtained are of the same size, which is convenient for subsequent operations.

[0085] In another example, the intermediate image features and the second image features may also be subjected to other feature-related operations to meet actual needs. If there is an intermediate image feature whose feature size is different from that of other intermediate image features or second image features, the intermediate image feature or the second image feature may be converted into an image feature of a preset size and then aligned with the training text feature. If the feature size of the intermediate image feature or the second image feature changes, the feature points in the intermediate image feature or the second image feature may be added or deleted. Specifically, if feature points need to be added, the intermediate image feature or the second image feature may be processed using an interpolation algorithm in the relevant technology.

[0086] In another example, the intermediate image feature and the second image feature may be aligned with the training text feature respectively, and then the alignment result may be converted to a preset size, which is not limited in the embodiment of the present invention. If the size of the alignment result changes, the data in the alignment result may be added or deleted. Specifically, if the data in the alignment result needs to be added, the alignment result may be processed by the above-mentioned interpolation algorithm.

[0087] In one example, the similarity matrix obtained by the intermediate image feature or the second image feature can be directly used as the alignment result. In another example, for each intermediate image feature or the second image feature, the similarity corresponding to the feature point therein can be used as a weight to perform an operation with the feature of the feature point to obtain a new feature of the feature point, which is used as a part of the alignment result corresponding to the intermediate image feature or the alignment result corresponding to the second image feature.

[0088] See also Figure 2 , Figure 2 FIG. 1 is a schematic diagram showing a defect detection method in a training phase according to an embodiment of the present invention. Figure 2 , the image encoder can be used to perform a feature extraction operation on the training image of the training object to obtain a second image feature. The image encoder can be a feature extraction module connected in sequence, and each feature extraction module can output an intermediate image feature. After the intermediate image feature is input into the linear layer, it is aligned with the training text feature. Among them, the training text can be input into the text encoder to obtain the training text feature. It should be understood that the alignment module used in the alignment operation is a trainable image-text alignment module to improve the accuracy of the alignment operation.

[0089] In step S222 , based on each alignment result, a focus feature is determined.

[0090] The data in the feature of interest may have a positional correspondence with the data in the alignment result.

[0091] In one example, if both the alignment result and the feature of interest are similarity matrices, the similarity in the alignment result may correspond to the similarity in the feature of interest. For example, a first similarity with coordinates (2, 3) in the alignment result may correspond to a second similarity with coordinates (2, 3) in the feature of interest. It should be understood that if the total number of similarities in the alignment result is different from the total number of similarities in the feature of interest, the two may be converted into a preset size, and then the second similarity in the feature of interest corresponding to the first similarity may be determined based on the position of the first similarity in the alignment result.

[0092] In this example, the alignment results can be directly superimposed and calculated to obtain the feature of interest. In another example, the average value of the alignment results can also be calculated to obtain the feature of interest. In yet another example, the weight of each alignment result can also be determined. Then, based on the weight of each alignment result, the average value of the alignment result is calculated. For example, the above weights may be related to the connection order of the feature extraction modules corresponding to the alignment results. For example, the closer the feature extraction module corresponding to the alignment result is to the feature extraction module that outputs the second image feature, the higher the weight of the alignment result.

[0093] In another example, if the alignment result is a similarity matrix and the feature of interest is an image feature, the similarity in the alignment result may correspond to the feature point in the feature of interest. For example, the first similarity with coordinates (4, 5) in the alignment result may correspond to the feature point with coordinates (4, 5) in the feature of interest. It should be understood that if the total number of similarities in the alignment result is different from the total number of feature points in the feature of interest, the two can be converted into a preset size, and then the feature point in the feature of interest corresponding to the first similarity can be determined based on the position of the first similarity in the alignment result.

[0094] In this example, the alignment results can be fused and then operated with the second image feature to obtain the focus feature. The fused alignment result can be used to represent the similarity between the feature point and the training text, so the fused alignment result is operated with the second image feature to highlight the features in the second image feature that are semantically consistent with the training text. For example, if the alignment result is a similarity matrix, and there are 5 alignment results, the 5 similarity matrices can be fused and then operated with the second image feature to obtain the focus feature. It should be understood that if the total number of similarities in the alignment result is different from the total number of feature points in the second image feature, the two can be converted into a preset size and then the focus feature can be generated. According to the position of each similarity in the fused alignment result, the corresponding feature point in the second image feature can be determined, and then the focus feature can be obtained by operation, for example. The similarity with coordinates (6, 15) in the alignment result can be operated with the feature of the feature point with coordinates (6, 15) in the second image feature.

[0095] In another example, the alignment result may be an image feature obtained by calculating the similarity matrix of the intermediate image feature (refer to the relevant steps of the alignment in step S221 above) and the intermediate image feature. The alignment result may also be an image feature obtained by calculating the similarity matrix of the second image feature and the second image feature. If the alignment result and the feature of interest are both image features, the feature points in the alignment result may correspond to the feature points in the feature of interest. For example, the first feature point with coordinates (7, 8) in the alignment result may correspond to the second feature point with coordinates (7, 8) in the feature of interest. It should be understood that if the total number of feature points in the alignment result is different from the total number of feature points in the feature of interest, the two can be converted into a preset size, and then the second feature point in the feature of interest corresponding to the first feature point can be determined based on the position of the first feature point in the alignment result.

[0096] In this example, the alignment results can be fused to serve as the focus feature. The alignment results can be fused by a feature fusion method in the related art to obtain the focus feature. For example, the feature fusion operation can be performed by a concat operator or an add operator in the related art.

[0097] According to the above scheme of the embodiment of the present invention, the training image can be input into the feature extraction modules connected in sequence, so that the second image feature can be output by the last feature extraction module. Then, the intermediate image feature or the second image feature output by each feature extraction module can be aligned with the training text feature to obtain the corresponding alignment result. Finally, the focus feature can be determined based on each alignment result. On the one hand, the above scheme uses multiple feature extraction modules to extract features from the training image, which can make the feature level of the obtained second image feature richer, thereby improving the representativeness of the second image feature, which is beneficial to improving the accuracy of the detection result. On the other hand, in the above scheme, the intermediate image features or the second image features of different feature extraction stages are aligned with the training text features respectively, which can characterize the part of the image feature that conforms to the semantics of the training text in multiple feature extraction dimensions, thereby improving the representativeness of the focus feature, which is beneficial to improving the accuracy of the detection result.

[0098] Exemplarily, step S221 aligns the intermediate image feature or the second image feature output by each feature extraction module with the training text feature to obtain a corresponding alignment result, and may include: determining the similarity between the features of each feature point in the intermediate image feature or the second image feature output by each feature extraction module and the training text feature to obtain a similarity matrix between the intermediate image feature or the second image feature and the training text feature as the corresponding alignment result.

[0099] The similarity can be expressed by Euclidean distance, cosine similarity, etc. The above scheme can determine whether each feature point matches the training text feature. If the similarity is high, it can be proved that the feature point is more consistent with the semantics of the training text. Combined with the actual scene, the feature points with high similarity can be regarded as feature points that may have defects.

[0100] Step S222 determines the focus feature based on each alignment result, which may include: fusing all similarity matrices to obtain a fused matrix as the focus feature.

[0101] All similarity matrices can be fused using linear averaging, rule-based fusion, and other methods in related technologies to obtain a fused similarity matrix. The above-mentioned focus feature can be used to indicate an area where defects may exist (the focus feature may correspond to the second image feature, which can comprehensively indicate whether the feature point in the second image feature is a feature point that conforms to the semantics of the training text). For example, if one of the focus features has a high similarity, the feature point corresponding to the similarity may be one of the feature points of the defect of the object to be tested.

[0102] According to the above scheme of the embodiment of the present invention, the similarity between the features of each feature point in the intermediate image feature or the second image feature output by each feature extraction module and the training text feature can be determined to obtain a similarity matrix between the intermediate image feature or the second image feature and the training text feature and serve as the corresponding alignment result. Then, all similarity matrices are fused to obtain a fusion matrix and serve as the focus feature. The similarity in the above focus feature can show whether the semantics of the corresponding feature point and the training text are similar, and can be used to represent feature points that may have defects. The focus feature and the second image feature are input into an untrained prompt learning module, which can improve the detection capability of the prompt learning module for defects in the image to be tested, which is beneficial to improving the accuracy of the detection results of the image to be tested.

[0103] Exemplarily, step S230 inputs the attention feature and the second image feature into an untrained prompt learning module to obtain a prompt learning feature, which may include: step S231 and step S232.

[0104] In step S231, a feature extraction operation is performed on the focus feature.

[0105] The feature extraction operation can be performed on the feature of interest by using any of the feature extraction methods described above, and the embodiments of the present invention will not be described in detail here.

[0106] In step S232, a feature concatenation operation is performed on the extracted focus feature and the second image feature to obtain a prompt learning feature.

[0107] The concat operator, add operator, etc. in the related technology can be used to perform feature concatenation operation on the feature of interest after feature extraction and the second image feature. The above steps can be referred to Figure 2 It should be understood that the feature splicing operation can also be performed on the focus feature, the second image feature, and the prompt learning vector after feature extraction to obtain the prompt learning feature, thereby improving the focus ability of the prompt learning module and the language model in the field of wafer inspection.

[0108] According to the above scheme provided by the embodiment of the present invention, a feature extraction operation can be performed on the attention feature. Then, the feature extraction attention feature and the second image feature are subjected to a feature splicing operation to obtain a prompt learning feature. The above scheme can further explore the distribution characteristics of the attention feature, thereby improving the representativeness of the prompt learning feature, which is conducive to improving the accuracy of the detection results of the training object.

[0109] Exemplarily, step S231 performs a feature extraction operation on the focus feature, which may include steps S2311 to S2314.

[0110] In step S2311, a convolution operation is performed on the focus feature to obtain a first convolution feature.

[0111] The feature of interest can be convolved by standard convolution, depthwise separable convolution, group convolution, etc. in related technologies to obtain the first convolution feature. The above steps can be referred to Figure 2 Convolution in the feature module.

[0112] In step S2312, an activation operation is performed on the first convolution feature to obtain a first activation feature.

[0113] The first convolution feature can be activated by an activation function in the related art to obtain a first activated feature. For example, the RelU (Rectified Linear Unit) function can be used for activation. Figure 2 The activations in the feature modules in .

[0114] In step S2313, a pooling operation is performed on the first activation feature to obtain a first pooled feature.

[0115] The first activation feature can be pooled by using the maximum pooling, average pooling, random pooling and other methods in the relevant technology to obtain the first pooling feature. Figure 2 Pooling in the feature module.

[0116] In some embodiments, the feature of interest may be convolved by a convolution layer, the first convolution feature may be activated by an activation layer, and the first activated feature may be pooled by a pooling layer. The convolution layer, activation layer, and pooling layer may be regarded as a feature module, and the feature of interest may be processed by multiple connected feature modules. For each feature module, the input of the feature module may be the feature of interest or the first pooled feature output by the feature module connected thereto.

[0117] In step S2314, a convolution operation is performed based on the first pooled feature to obtain the focus feature after feature extraction.

[0118] The first pooled feature can be convolved by the standard convolution, depthwise separable convolution, group convolution, etc., to obtain the feature of interest after feature extraction. It should be understood that the convolution parameters used in the convolution operations in step S2311 and step S2314 can be the same or different, depending on the needs of the developer. The above steps can be referred to Figure 2 Convolution after the feature module.

[0119] The feature of interest after feature extraction can then be combined with Figure 2 The learnable hint learning vector (refer to the definition of hint learning vector in step S120) and the second image feature are concatenated to obtain hint learning features. The language model generates an output result (which may be a prediction result in the training process) in combination with the query information (which may be the training query information in the training process). It should be understood that Figure 2 The image-text alignment module in the image-text alignment module can map the fusion matrix to the training image to mark the defect area in the training image. In one example, after training, the image-text alignment module can also input a preset defect text feature to align with the first image feature of the image to be tested, thereby obtaining a defect area in the image to be tested that is consistent with the defect text description of the defect text feature.

[0120] According to the above scheme of the embodiment of the present invention, a convolution operation can be performed on the feature of interest to obtain a first convolution feature. Then, an activation operation is performed on the first convolution feature to obtain a first activation feature. A pooling operation is then performed on the first activation feature to obtain a first pooled feature. Finally, based on the first pooled feature, a convolution operation is performed to obtain the feature of interest after feature extraction. The above scheme can improve the representativeness of the feature of interest after feature extraction by means of convolution operation, activation operation and pooling operation, which is conducive to improving the accuracy of the detection results of the training object.

[0121] The embodiment of the present invention also provides a defect detection device. Figure 4 FIG. 3 is a schematic block diagram of a defect detection device 300 according to an embodiment of the present invention. Figure 4As shown, the defect detection device 300 may include: a first image feature extraction module 310 , a first enhanced feature generation module 320 and a detection result generation module 330 .

[0122] The first image feature extraction module 310 is used to perform a feature extraction operation on the image to be tested of the object to be tested to obtain the first image feature of the image to be tested, wherein the object to be tested is a wafer or a wafer grain. The first enhanced feature generation module 320 is used to input the first image feature into the trained prompt learning module to obtain the first enhanced feature of the object to be tested, wherein the trained prompt learning module is obtained by training using the second image feature of the training image of the training object and the training text feature of the training object, and the training text feature is obtained by performing a feature extraction operation on the training text related to the defect type of the training object. The detection result generation module 330 is used to input the first enhanced feature and the first query information into the language model to obtain the detection result, wherein the first query information is used to guide the generation of the detection result, and the detection result is used to describe the defect type of the object to be tested.

[0123] Exemplarily, the detection device 300 may further include: a second image feature generation module, a focus feature generation module, a prompt learning feature generation module, a prediction result generation module and a parameter adjustment module.

[0124] The second image feature generation module is used to perform feature extraction operations on the training image of the training object to obtain the second image feature, and to perform feature extraction operations on the training text of the training object to obtain the training text feature. The focus feature generation module is used to align the second image feature with the training text feature to obtain the focus feature. The prompt learning feature generation module is used to input the focus feature and the second image feature into the prompt learning module that has not been trained to obtain the prompt learning feature. The prediction result generation module is used to input the prompt learning feature and the training query information into the language model to obtain the prediction result, wherein the training query information is used to guide the generation of the prediction result. The parameter adjustment module is used to adjust the module parameters of the prompt learning module that has not been trained based on the difference between the prediction result and the training text.

[0125] Exemplarily, the second image feature generation module may include feature extraction modules connected in sequence.

[0126] The feature extraction modules connected in sequence are used to process the training image so that the last feature extraction module outputs a second image feature;

[0127] The focus feature generation module may include an alignment result generation module and an alignment result integration module.

[0128] The alignment result generation module is used to align the intermediate image feature or the second image feature output by each feature extraction module with the training text feature to obtain a corresponding alignment result. The alignment result synthesis module is used to determine the focus feature based on each alignment result.

[0129] Exemplarily, the alignment result generating module may include a similarity matrix generating module.

[0130] The similarity matrix generation module is used to determine the similarity between the features of each feature point in the intermediate image feature or the second image feature output by each feature extraction module and the training text feature, so as to obtain the similarity matrix between the intermediate image feature or the second image feature and the training text feature as the corresponding alignment result;

[0131] The alignment result synthesis module may include a fusion matrix generation module.

[0132] The fusion matrix generation module is used to fuse all similarity matrices to obtain a fusion matrix as the focus feature.

[0133] Exemplarily, the prompt learning feature generation module may include: a first feature extraction module and a feature splicing module.

[0134] The first feature extraction module is used to perform feature extraction operation on the focus feature. The feature splicing module is used to perform feature splicing operation on the focus feature after feature extraction and the second image feature to obtain the prompt learning feature.

[0135] Exemplarily, the first feature extraction module may include: a first convolution feature generation module, a first activation feature generation module, a first pooling generation module and a reconvolution module.

[0136] The first convolution feature generation module is used to perform a convolution operation on the focus feature to obtain a first convolution feature. The first activation feature generation module is used to perform an activation operation on the first convolution feature to obtain a first activation feature. The first pooling generation module is used to perform a pooling operation on the first activation feature to obtain a first pooling feature. The reconvolution module is used to perform a convolution operation based on the first pooling feature to obtain a focus feature after feature extraction.

[0137] Exemplarily, the training text includes a text description related to whether the training object has defects, a text description related to the defect type of the training object, a text description related to the processing stage of the training object, and a text description related to the location of the defect of the training object in the training image.

[0138] According to another aspect of the present invention, an electronic device is also provided. Figure 5FIG. 4 shows a schematic block diagram of an electronic device 400 according to an embodiment of the present invention. Figure 5 As shown, the electronic device 400 includes a processor 410 and a memory 420. The memory 420 stores a computer program. When the computer program instructions are executed by the processor 410, they are used to execute the above-mentioned defect detection method.

[0139] In addition, according to another aspect of the present invention, a storage medium is also provided, on which program instructions are stored, and when the program instructions are executed by a computer or a processor, the computer or the processor executes the corresponding steps of the above-mentioned defect detection method of the embodiment of the present invention, and is used to implement the corresponding modules in the above-mentioned defect detection device or the corresponding modules in the above-mentioned electronic device according to the embodiment of the present invention. The storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, or any combination of the above-mentioned storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media. According to another aspect of the present invention, a computer program product is also provided, including computer program instructions, and when the above-mentioned computer program instructions are executed by a computer or a processor, the computer or the processor executes the corresponding steps of the above-mentioned defect detection method.

[0140] A person skilled in the art may understand the specific implementation scheme of the above-mentioned electronic device and storage medium by reading the above-mentioned description of the defect detection method, which will not be described here for the sake of brevity.

[0141] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present invention thereto. Various changes and modifications may be made therein by one of ordinary skill in the art without departing from the scope and spirit of the present invention. All such changes and modifications are intended to be included within the scope of the present invention as required by the appended claims.

[0142] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0143] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.

[0144] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0145] Similarly, it should be understood that in order to streamline the present invention and help understand one or more of the various inventive aspects, in the description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the present invention should not be interpreted as reflecting the following intention: the claimed invention requires more features than the features explicitly stated in each claim. More specifically, as reflected in the corresponding claims, the inventive point is that the corresponding technical problem can be solved with less than all the features of a single disclosed embodiment. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present invention.

[0146] It will be understood by those skilled in the art that, except for mutually exclusive features, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this specification may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.

[0147] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.

[0148] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some modules in the defect detection device according to an embodiment of the present invention. The present invention may also be implemented as a device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0149] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

[0150] The above is only a specific embodiment of the present invention or an explanation of a specific embodiment. The protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. The protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A defect detection method, characterized in that: The method comprises: Performing a feature extraction operation on an image to be tested of an object to be tested to obtain a first image feature of the image to be tested, wherein the object to be tested is a wafer or a wafer die; Inputting the first image feature into a trained prompt learning module to obtain a first enhanced feature of the object to be tested, wherein the trained prompt learning module is trained by using a second image feature of a training image of the training object and a training text feature of the training object, and the training text feature is obtained by performing a feature extraction operation on a training text related to a defect type of the training object; The first enhanced feature and the first query information are input into a language model to obtain a detection result, wherein the first query information is used to guide the generation of the detection result, and the detection result is used to describe the defect type of the object to be detected.

2. The method according to claim 1, characterized in that The trained prompt learning module is obtained by the following steps: Performing a feature extraction operation on a training image of a training object to obtain a second image feature, and performing a feature extraction operation on a training text of the training object to obtain a training text feature; Aligning the second image feature with the training text feature to obtain a focus feature; Inputting the attention feature and the second image feature into an untrained prompt learning module to obtain a prompt learning feature; Inputting the prompt learning features and the training query information into a language model to obtain a prediction result, wherein the training query information is used to guide the generation of the prediction result; Based on the difference between the prediction result and the training text, the module parameters of the untrained prompt learning module are adjusted.

3. The method according to claim 2, characterized in that The performing a feature extraction operation on the training image of the training object to obtain a second image feature includes: Inputting the training image into the feature extraction modules connected in sequence, so that the last feature extraction module outputs the second image feature; The aligning operation of the second image feature with the training text feature to obtain the focus feature includes: For the intermediate image feature or the second image feature output by each feature extraction module, align the intermediate image feature or the second image feature with the training text feature to obtain a corresponding alignment result; Based on each alignment result, the feature of interest is determined.

4. The method according to claim 3, characterized in that The step of aligning the intermediate image feature or the second image feature outputted by each feature extraction module with the training text feature to obtain a corresponding alignment result includes: For the intermediate image features or the second image features respectively output by each feature extraction module, determine the similarity between the features of each feature point in the intermediate image features or the second image features and the training text features respectively, so as to obtain a similarity matrix between the intermediate image features or the second image features and the training text features as the corresponding alignment result; The determining the focus feature based on each alignment result includes: All similarity matrices are fused to obtain a fusion matrix as the focus feature.

5. The method according to claim 2, characterized in that The step of inputting the attention feature and the second image feature into an untrained prompt learning module to obtain a prompt learning feature includes: Performing a feature extraction operation on the focus feature; The feature extracted from the focus feature is concatenated with the second image feature to obtain the prompt learning feature.

6. The method according to claim 5, characterized in that The performing a feature extraction operation on the focus feature includes: Performing a convolution operation on the feature of interest to obtain a first convolution feature; Performing an activation operation on the first convolution feature to obtain a first activation feature; Performing a pooling operation on the first activation feature to obtain a first pooled feature; Based on the first pooled features, a convolution operation is performed to obtain the focus feature after feature extraction.

7. The method according to claim 2, characterized in that The training text includes a text description related to whether the training object has defects, a text description related to the defect type of the training object, a text description related to the processing stage of the training object, and a text description related to the location of the defect of the training object in the training image.

8. A defect detection device, characterized in that: The device comprises: A first image feature extraction module is used to perform a feature extraction operation on an image to be tested of an object to be tested to obtain a first image feature of the image to be tested, wherein the object to be tested is a wafer or a wafer die; a first enhanced feature generation module, used for inputting the first image feature into a trained prompt learning module to obtain a first enhanced feature of the object to be tested, wherein the trained prompt learning module is obtained by training using a second image feature of a training image of the training object and a training text feature of the training object, and the training text feature is obtained by performing a feature extraction operation on a training text related to a defect type of the training object; The detection result generation module is used to input the first enhanced feature and the first query information into the language model to obtain the detection result, wherein the first query information is used to guide the generation of the detection result, and the detection result is used to describe the defect type of the object to be detected.

9. An electronic device, characterized in that: It comprises a memory and a processor, wherein: the memory is used to store a computer program; the processor is used to execute the computer program to implement the defect detection method according to any one of claims 1 to 7.

10. A storage medium storing a computer program / instruction, characterized in that: The computer program / instructions are used to execute the defect detection method according to any one of claims 1 to 7 when running.

11. A computer program product comprising computer program instructions, characterized in that The computer program instructions are used to execute the defect detection method according to any one of claims 1 to 7 when running.