Defect detection method and device, electronic equipment and storage medium

In the defect detection of wafer or mask plate, global defect detection with high threshold and local defect detection with low threshold and feature fusion are used, the problem of difficulty in selecting thresholds in the prior art is solved, and the detection accuracy and efficiency are improved.

CN120107193APending Publication Date: 2025-06-06无锡影速半导体科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510169509.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

In the detection of defects of wafers or mask plates, threshold selection is difficult, and problems such as missed detection, missed detection and long post-processing time are prone to occur.

Method used

The first detection threshold is used to perform global defect differential detection and the second detection threshold (less than the first detection threshold) to perform local defect differential detection, and the final defect detection result is obtained through feature fusion.

Benefits of technology

It reduces the missed detection of defect detection, improves detection accuracy, and achieves accurate, stable and robust wafer defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107193A_ABST
    Figure CN120107193A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a defect detection method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a defect-free image and a to-be-detected image, and preprocessing the defect-free image and the to-be-detected image; performing global defect differential detection on the preprocessed defect-free image and the to-be-detected image by adopting a first detection threshold to obtain global defect detection features; performing local defect differential detection on the preprocessed defect-free image and the to-be-detected image by adopting a second detection threshold to obtain local defect detection features; and carrying out feature fusion on the global defect detection features and the local defect detection features to obtain a defect detection result of the to-be-detected image. By adopting the scheme of the embodiment of the invention, global defect detection is carried out by adopting a high threshold value, and local defect detection is carried out by adopting a low threshold value, so that the conditions of false detection and missing detection of wafer defects are reduced, the defect detection precision is improved, and accurate, rapid, stable and robust wafer defect detection is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of defect detection technology, and in particular, to a defect detection method, device, electronic device and storage medium. Background Art

[0002] During the production process of wafers or masks, defective products with flaws will inevitably be produced due to limitations in process levels or the influence of environmental factors. Defect detection is an effective means to ensure product yield.

[0003] In the prior art, image features are usually used for surface defect detection of wafers or masks. Image features often use a feature value threshold to achieve feature value acquisition. The higher the threshold setting, the less likely the features in the image will be detected. When detecting surface defects, threshold selection is very important for the detection results. When selecting the feature value threshold, if a high threshold is used, missed detection will occur; and if a low threshold is used, unclear boundaries and false detection will occur. At the same time, the post-detection processing time of low-threshold defect detection is longer.

[0004] Therefore, how to detect defects quickly and accurately is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0005] The embodiments of the present invention provide a defect detection method, device, electronic device and storage medium to reduce false detections and missed detections of defects in semiconductor materials such as wafers and masks, improve defect detection accuracy, and achieve accurate, stable and robust wafer defect detection.

[0006] In a first aspect, an embodiment of the present invention provides a defect detection method, comprising:

[0007] Acquire a defect-free image and an image to be detected, and preprocess the defect-free image and the image to be detected;

[0008] Using a first detection threshold to perform global defect differential detection on the preprocessed defect-free image and the image to be detected, to obtain a global defect detection feature;

[0009] Using a second detection threshold to perform local defect differential detection on the preprocessed defect-free image and the image to be detected to obtain a local defect detection feature; wherein the second detection threshold is smaller than the first detection threshold;

[0010] The global defect detection features and local defect detection features are fused to obtain the defect detection results of the image to be detected.

[0011] In a second aspect, an embodiment of the present invention further provides a defect detection device, including:

[0012] An image processing module, used for acquiring a defect-free image and an image to be detected, and preprocessing the defect-free image and the image to be detected;

[0013] A global defect detection module, used to perform global defect differential detection on the preprocessed defect-free image and the image to be detected using a first detection threshold to obtain a global defect detection feature;

[0014] A local defect detection module, used to perform local defect differential detection on the preprocessed defect-free image and the image to be detected using a second detection threshold to obtain a local defect detection feature; wherein the second detection threshold is smaller than the first detection threshold;

[0015] The defect detection feature fusion module is used to fuse the global defect detection features and the local defect detection features to obtain the defect detection results of the image to be detected.

[0016] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0017] one or more processors;

[0018] A storage device for storing one or more programs;

[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the defect detection method described in any embodiment of the present invention.

[0020] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the defect detection method described in any embodiment of the present invention.

[0021] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the defect detection method as described in any embodiment of the present invention.

[0022] The embodiment of the present invention provides a defect detection method, device, electronic device and storage medium, which obtains a defect-free image and an image to be detected, and preprocesses the defect-free image and the image to be detected; uses a first detection threshold to perform global defect differential detection on the preprocessed defect-free image and the image to be detected to obtain a global defect detection feature; uses a second detection threshold to perform local defect differential detection on the preprocessed defect-free image and the image to be detected to obtain a local defect detection feature; wherein the second detection threshold is less than the first detection threshold; and performs feature fusion on the global defect detection feature and the local defect detection feature to obtain a defect detection result of the image to be detected. The technical solution of the embodiment of the present invention is adopted, and a high threshold is used for global defect detection while a low threshold is used for local defect detection. The defect detection result is obtained by fusion of defect detection features, which reduces the false detection and missed detection of defects in semiconductor materials such as wafers and masks, improves the defect detection accuracy, and realizes accurate, stable and robust wafer defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only for the purpose of illustrating preferred embodiments and are not to be considered as limiting the present invention. Also, the same reference symbols are used throughout the drawings to represent the same parts. In the drawings:

[0024] Figure 1 is a flow chart of a defect detection method provided in an embodiment of the present invention;

[0025] Figure 2 is a schematic diagram of high and low threshold defect detection provided in an embodiment of the present invention;

[0026] Figure 3 is a flow chart of another defect detection method provided in an embodiment of the present invention;

[0027] Figure 4 is a flow chart of another defect detection method provided in an embodiment of the present invention;

[0028] Figure 5 is a schematic diagram of defect detection results after feature fusion provided in an embodiment of the present invention;

[0029] Figure 6 is a structural schematic diagram of a defect detection device provided in an embodiment of the present invention;

[0030] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0032] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0033] Among them, the acquisition, storage, use and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of this application, some existing solutions in the industry such as certain software, components or models may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.

[0035] Embodiment 1

[0036] Figure 1 This is a flow chart of a defect detection method provided in an embodiment of the present invention. This embodiment is applicable to the case of performing defect detection on the surface of a wafer. The method of this embodiment can be executed by a defect detection device, which can be implemented in hardware and / or software. The device can be configured in a defect detection server. The method specifically includes the following steps:

[0037] S110, acquiring a defect-free image and an image to be detected, and preprocessing the defect-free image and the image to be detected.

[0038] The defect detection method of the embodiment of the present invention is applicable to pan-semiconductor materials, including but not limited to printed circuit boards (PCB) in the field of integrated circuits, flat panel displays (FPD) in the field of new displays, wafers (wafers) and masks (masks) in the field of photoelectric sensors, and photovoltaic cell silicon wafers in light storage and charging new energy. The embodiment of the present invention is described by taking wafer defect detection as an example.

[0039] The defect-free image and the image to be detected are obtained and preprocessed. The preprocessing may refer to registering and correcting the defect-free image and the image to be detected, for example, correcting the image position and adjusting the image size of the defect-free image and the image to be detected.

[0040] S120 , using a first detection threshold to perform global defect differential detection on the preprocessed defect-free image and the image to be detected to obtain a global defect detection feature.

[0041] When performing defect detection on the wafer surface, see Figure 2 , (a) and (b) are images of differential detection after high threshold acquisition, and (c) and (d) are images of differential detection after low threshold acquisition. If a high threshold is used, missed detection will occur; and when a low threshold is used, unclear boundaries and false detection will occur. At the same time, the post-processing time of low threshold defect detection is relatively long. Therefore, an embodiment of the present invention provides a defect detection method, which obtains the final defect detection result by fusing the global defect detection feature of the high threshold with the local defect detection feature of the low threshold.

[0042] First, a first detection threshold is used to perform global defect differential detection on the preprocessed defect-free image and the image to be detected to obtain a global defect detection feature. The first detection threshold may refer to a feature value threshold set when performing global defect detection. When the first detection threshold is used for global defect detection, relatively obvious defects can be detected.

[0043] S130, using a second detection threshold to perform local defect differential detection on the preprocessed defect-free image and the image to be detected to obtain a local defect detection feature.

[0044] In which, while performing global defect differential detection on the defect-free image and the image to be detected, local defect differential detection is also required for the defect-free image and the image to be detected. When performing local defect differential detection on the defect-free image and the image to be detected, a second detection threshold is used for detection to obtain local defect detection features.

[0045] The second detection threshold is less than the first detection threshold. The second detection threshold is used for local defect detection, and fine-grained defect detection can be performed locally. Optionally, before performing local defect detection, it is necessary to first determine the area where the defect exists, and then use the second detection threshold to perform local defect detection. The second detection threshold is used for local defect differential detection, which can reduce the detection time and perform fine-grained defect detection.

[0046] S140, performing feature fusion on the global defect detection features and the local defect detection features to obtain a defect detection result of the image to be detected.

[0047] After determining the global defect detection features and the local defect detection features, feature fusion is performed to obtain the defect detection result of the image to be detected. Optionally, the feature fusion method can be morphological processing method.

[0048] The embodiment of the present invention provides a defect detection method, which obtains a defect-free image and an image to be detected, and preprocesses the defect-free image and the image to be detected; uses a first detection threshold to perform global defect differential detection on the preprocessed defect-free image and the image to be detected to obtain a global defect detection feature; uses a second detection threshold to perform local defect differential detection on the preprocessed defect-free image and the image to be detected to obtain a local defect detection feature; wherein the second detection threshold is less than the first detection threshold; and performs feature fusion on the global defect detection feature and the local defect detection feature to obtain a defect detection result of the image to be detected. The technical solution of the embodiment of the invention is adopted, and a high threshold is used for global defect detection while a low threshold is used for local defect detection, which reduces the situation of wafer defect misdetection and missed detection, improves defect detection accuracy, and realizes accurate, fast, stable, and robust wafer defect detection.

[0049] Embodiment 2

[0050] Figure 3 Flow chart of a defect detection method provided in an embodiment of the present invention. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Figure 3 As shown, the defect detection method provided in the embodiment of the present invention may include the following steps:

[0051] S310, acquiring a defect-free image and an image to be detected, and preprocessing the defect-free image and the image to be detected.

[0052] S320 , using a first detection threshold to perform global defect differential detection on the preprocessed defect-free image and the image to be detected to obtain a global defect detection feature.

[0053] S330 , training an unsupervised feature defect contrast detection model on the preprocessed defect-free image to obtain a target unsupervised feature defect contrast detection model.

[0054] Among them, the existing unsupervised feature defect contrast detection model is relatively divergent in predicting the boundary of the defect area, and the positioning accuracy of the defect position is not high. Therefore, in the embodiment of the present invention, the unsupervised feature defect contrast detection model is trained on the preprocessed defect-free image to obtain the target unsupervised feature defect contrast detection model.

[0055] Compared with the supervised feature defect comparison detection model, the target unsupervised feature defect comparison detection model trained by the embodiment of the present invention has the effects of simple data acquisition, low manual labeling cost and high yield.

[0056] As an optional but non-limiting implementation, the training of the unsupervised feature defect contrast detection model on the preprocessed defect-free image to obtain the target unsupervised feature defect contrast detection model includes but is not limited to steps A1-A2:

[0057] Step A1: adding noise to the preprocessed defect-free image to obtain a defective image, and marking the position where the noise is added to obtain a defect distribution label; wherein the noise refers to an image with defective features.

[0058] Step A2: input the defect image into the teacher sub-model and the student sub-model to train the unsupervised feature defect contrast detection model to obtain the target unsupervised feature defect contrast detection model.

[0059] Among them, by adding images with defect features to the image to be detected, the defect sample is synthesized to obtain the defect image; and the position of adding noise is recorded to obtain the defect distribution label. The defect image is input into the teacher sub-model and the student sub-model respectively to train the unsupervised feature defect comparison detection model. By training the two models, the feature distance of the normal area is minimized and the feature distance of the defect area is maximized through positive and negative feature comparison and clustering, so as to realize the normalization of the model area features. During the model training process, the defect feature selection rule of the teacher sub-model remains unchanged, that is, the selection weight parameter of the defect feature remains unchanged; the defect feature selection rule of the student sub-model changes continuously with the model training, that is, the selection weight parameter of the defect feature changes continuously with the model training. During the training process, the weight parameters of the student sub-model can be learned and optimized to obtain the target unsupervised feature defect comparison detection model that can be used as the local defect differential detection.

[0060] As an optional but non-limiting implementation, the defect image and the non-defect image are input into the teacher sub-model and the student sub-model to train the unsupervised feature defect contrast detection model to obtain the target unsupervised feature defect contrast detection model, including but not limited to steps B1-B3:

[0061] Step B1: input the defect image into the teacher sub-model to extract the first multi-scale feature.

[0062] Step B2: input the defect image into the student sub-model to extract the second multi-scale features.

[0063] Step B3: performing channel dimension normalization processing on the first multi-scale features and the second multi-scale features to train an unsupervised feature defect contrast detection model to obtain a target unsupervised feature defect contrast detection model.

[0064] Among them, multi-scale features refer to defect features at different resolutions. The defect image synthesized by the defect sample is input into the teacher sub-model and the student sub-model to obtain the first multi-scale features under the frozen teacher sub-model, such as FT 1 , FT 2 , FT 3 ; and the second multi-scale features under the student sub-model, such as FS 1 , FS 2 , FS 3 The first multi-scale feature FT of the teacher sub-model i Second multi-scale feature FS with student submodel i Normalize the channel dimension.

[0065] Optionally, the normalization method includes: determining the cosine distance between the first multi-scale feature and the second multi-scale feature, and calculating the corresponding similarity. Determine the maximum cosine distance of the defect position feature and the minimum cosine distance of the normal position feature, and optimize the weight of the student sub-model through the loss function. It can be expressed as:

[0066] D i =F cos (Norm(FT i ),Norm(FS i ))

[0067]

[0068] Among them, Norm(FT i ) is the first multi-scale feature cosine distance, Norm(FS i ) is the second multi-scale feature cosine distance, D i is the corresponding similarity; D i,gTo maximize the defect location characteristic cosine distance, D i,a To minimize the cosine distance of normal position features, L is the loss function.

[0069] In the prior art, a large amount of defect data is often used to implement model training. However, the sample data volume of wafer defect samples is difficult to obtain and the amount of annotation is large. Therefore, the embodiment of the present invention uses unsupervised feature defect comparison. When the wafer defect sample data volume is difficult to obtain, only easily accessible normal samples are used to implement unsupervised feature comparison. This has the effects of simple data acquisition, low manual annotation cost and high yield.

[0070] S340, using the target unsupervised feature defect contrast detection model to infer the defect distribution probability map in the image to be detected, and determining the target defect area according to the defect distribution probability map.

[0071] Among them, see Figure 4 After determining the target unsupervised feature defect contrast detection model, the unsupervised feature defect contrast detection model is used to infer the defect distribution probability map in the image to be detected, and the target defect area is determined, so as to perform local defect differential detection after determining the target defect area.

[0072] As an optional but non-limiting implementation, the target unsupervised feature defect contrast detection model is used to infer the defect distribution probability map in the image to be detected, and the target defect area is determined according to the defect distribution probability map, including but not limited to steps C1-C3:

[0073] Step C1: Input the image to be detected into the target unsupervised feature defect comparison detection model, and perform model inference to obtain multi-scale prediction results at different resolutions.

[0074] Step C2: upsample and overlay the multi-scale prediction results at different resolutions to obtain a position distribution probability map of the image defects to be detected.

[0075] Step C3: determining a target defect area in the image to be detected according to the position distribution probability map.

[0076] After the student sub-model is trained, the defect distribution probability map in the image to be inspected is inferred. During inference, the image to be inspected is input and inferred to obtain D 1 , D 2 , D 3 The multi-scale prediction results are upsampled and superimposed at different resolutions to obtain the position distribution probability map of the image defects to be detected. 3 , D 2 Interpolate and upsample to D 1The same resolution is used and added to obtain the position distribution probability map M of wafer defects and determine the feature boundary; it can be expressed as:

[0077] M=Up(D 3 )+Up(D 2 )+D 1

[0078] Here, Up can be represented as upsampling.

[0079] According to the obtained position distribution probability map, the target defect area in the image to be detected is determined. For example, the target defect area in the image to be detected can be determined by confidence.

[0080] S350, using a second detection threshold to perform local defect differential detection on the target defect area to obtain a local defect detection feature.

[0081] Among them, after determining the target defect area in the image to be inspected, a second detection threshold is used to perform local defect differential detection to obtain local defect detection features; wherein, the second detection threshold is set to an empirical value lower than the first detection threshold, and the parameters can be adjusted according to the actual process detection strictness.

[0082] S360, performing feature fusion on the global defect detection features and the local defect detection features to obtain a defect detection result of the image to be detected.

[0083] The global defect detection feature obtained by using the first detection threshold for global defect detection and the local defect detection feature obtained by using the second detection threshold for local defect detection are fused to obtain the defect detection result of the image to be detected. Figure 5 The defect detection results obtained by fusing global defect detection features and local defect detection features reduce the false detection, missed detection and long detection time of wafer defects, improve the detection of low-contrast difficult defects, and achieve accurate, stable, robust and fast graphic wafer defect detection.

[0084] The embodiment of the present invention provides a defect detection method, which uses a first detection threshold to perform global defect detection to obtain a global defect detection feature; determines a local target defect area where a defect exists, and uses a second detection threshold to perform local defect detection to obtain a local defect detection feature; and fuses the global defect detection feature and the local defect detection feature to obtain a defect detection result of the image to be detected. The technical solution of the embodiment of the present invention reduces the situations of wafer defect misdetection, missed detection, and long detection time, improves defect detection accuracy, and realizes accurate, stable, robust, and fast wafer defect detection.

[0085] Embodiment 3

[0086] Figure 6 : is a schematic diagram of the structure of a defect detection device provided in an embodiment of the present invention. The technical solution of this embodiment can be applied to the situation of defect detection on the surface of a wafer. The device can be implemented by software and / or hardware and is generally integrated on any electronic device with network communication function, including but not limited to: servers, computers, personal digital assistants and other devices. Figure 6 As shown, the defect detection device provided in this embodiment may include: an image processing module 610, a global defect detection module 620, a local defect detection module 630 and a defect detection feature fusion module 640; wherein,

[0087] An image processing module 610 is used to obtain a defect-free image and an image to be detected, and pre-process the defect-free image and the image to be detected;

[0088] A global defect detection module 620 is used to perform global defect differential detection on the preprocessed defect-free image and the image to be detected using a first detection threshold to obtain a global defect detection feature;

[0089] The local defect detection module 630 is used to perform local defect differential detection on the preprocessed defect-free image and the image to be detected using a second detection threshold to obtain a local defect detection feature; wherein the second detection threshold is smaller than the first detection threshold;

[0090] The defect detection feature fusion module 640 is used to fuse the global defect detection features and the local defect detection features to obtain the defect detection result of the image to be detected.

[0091] Based on the above embodiment, optionally, the preprocessing includes performing image position correction and image size adjustment on the defect-free image and the image to be inspected.

[0092] Based on the above embodiment, optionally, the local defect detection module is specifically used to:

[0093] The unsupervised feature defect contrast detection model is trained on the preprocessed defect-free image to obtain a target unsupervised feature defect contrast detection model;

[0094] The target unsupervised feature defect contrast detection model is used to infer the defect distribution probability map in the image to be detected, and the target defect area is determined according to the defect distribution probability map;

[0095] A second detection threshold is used to perform local defect differential detection on the target defect area to obtain a local defect detection feature.

[0096] Based on the above embodiment, optionally, the local defect detection module is further specifically used for:

[0097] Adding noise to the preprocessed image to be inspected to obtain a defect image, and marking the position where the noise is added to obtain a defect distribution label; wherein the noise refers to an image with defect features;

[0098] The defect image is input into the teacher sub-model and the student sub-model to train the unsupervised feature defect contrast detection model to obtain the target unsupervised feature defect contrast detection model.

[0099] Based on the above embodiment, optionally, the local defect detection module is further specifically used for:

[0100] Inputting the defect image into the teacher sub-model to extract the first multi-scale feature;

[0101] Inputting the defect image into the student sub-model to extract the second multi-scale features;

[0102] The first multi-scale features and the second multi-scale features are normalized in channel dimension to train an unsupervised feature defect contrast detection model to obtain a target unsupervised feature defect contrast detection model.

[0103] Based on the above embodiment, optionally, the local defect detection module is further specifically used for:

[0104] The image to be inspected is input into the target unsupervised feature defect comparison detection model, and the model is inferred to obtain multi-scale prediction results at different resolutions;

[0105] The multi-scale prediction results at different resolutions are upsampled and superimposed to obtain a position distribution probability map of the image defects to be detected;

[0106] A target defect area in the image to be detected is determined according to the position distribution probability map.

[0107] The defect detection device provided in the embodiment of the present invention can execute the defect detection method provided in any embodiment of the present invention mentioned above, and has the corresponding functions and beneficial effects of executing the defect detection method. For detailed process, please refer to the relevant operations of the defect detection method in the above embodiment.

[0108] Embodiment 4

[0109] Figure 71 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0110] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0111] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0112] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a defect detection method.

[0113] In some embodiments, the defect detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the defect detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the defect detection method in any other appropriate manner (e.g., by means of firmware).

[0114] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0115] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0116] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0117] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0118] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0119] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0120] Embodiment 5

[0121] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the defect detection method provided in any embodiment of the present application.

[0122] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0123] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0124] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A defect detection method, characterized in that: The method comprises: Acquire a defect-free image and an image to be detected, and preprocess the defect-free image and the image to be detected; Using a first detection threshold to perform global defect differential detection on the preprocessed defect-free image and the image to be detected, to obtain a global defect detection feature; Using a second detection threshold to perform local defect differential detection on the preprocessed defect-free image and the image to be detected to obtain a local defect detection feature; wherein the second detection threshold is smaller than the first detection threshold; The global defect detection features and local defect detection features are fused to obtain the defect detection results of the image to be detected.

2. The method according to claim 1, characterized in that The preprocessing includes performing image position correction and image size adjustment on the defect-free image and the image to be detected.

3. The method according to claim 1, characterized in that The method of using the second detection threshold to perform local defect differential detection on the preprocessed defect-free image and the image to be detected to obtain local defect detection features includes: The unsupervised feature defect contrast detection model is trained on the preprocessed defect-free image to obtain a target unsupervised feature defect contrast detection model; The target unsupervised feature defect contrast detection model is used to infer the defect distribution probability map in the image to be detected, and the target defect area is determined according to the defect distribution probability map; A second detection threshold is used to perform local defect differential detection on the target defect area to obtain a local defect detection feature.

4. The method according to claim 3, characterized in that The training of the unsupervised feature defect contrast detection model on the preprocessed defect-free image to obtain the target unsupervised feature defect contrast detection model includes: Adding noise to the preprocessed defect-free image to obtain a defect image, and marking the position where the noise is added to obtain a defect distribution label; wherein the noise refers to an image with defect features; The defect image is input into the teacher sub-model and the student sub-model to train the unsupervised feature defect contrast detection model to obtain the target unsupervised feature defect contrast detection model.

5. The method according to claim 4, characterized in that The defect image is input into the teacher sub-model and the student sub-model to train the unsupervised feature defect contrast detection model to obtain the target unsupervised feature defect contrast detection model, including: Inputting the defect image into the teacher sub-model to extract the first multi-scale feature; Inputting the defect image into the student sub-model to extract the second multi-scale features; The first multi-scale features and the second multi-scale features are normalized in channel dimension to train an unsupervised feature defect contrast detection model to obtain a target unsupervised feature defect contrast detection model.

6. The method according to claim 3, characterized in that The method of using the target unsupervised feature defect contrast detection model to infer the defect distribution probability map in the image to be detected, and determining the target defect area according to the defect distribution probability map, includes: The image to be inspected is input into the target unsupervised feature defect comparison detection model, and the model is inferred to obtain multi-scale prediction results at different resolutions; The multi-scale prediction results at different resolutions are upsampled and superimposed to obtain a position distribution probability map of the image defects to be detected; A target defect area in the image to be detected is determined according to the position distribution probability map.

7. A defect detection device, characterized in that: The device comprises: An image processing module, used for acquiring a defect-free image and an image to be detected, and preprocessing the defect-free image and the image to be detected; A global defect detection module, used to perform global defect differential detection on the preprocessed defect-free image and the image to be detected using a first detection threshold to obtain a global defect detection feature; A local defect detection module, used to perform local defect differential detection on the preprocessed defect-free image and the image to be detected using a second detection threshold to obtain a local defect detection feature; wherein the second detection threshold is smaller than the first detection threshold; The defect detection feature fusion module is used to fuse the global defect detection features and the local defect detection features to obtain the defect detection results of the image to be detected.

8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the defect detection method described in any one of claims 1-6.

9. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to perform the defect detection method according to any one of claims 1 to 6 when executed by a computer processor.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the defect detection method according to any one of claims 1 to 6.