Mark-free contrast learning industrial defect detection method and equipment based on multi-stage attention fusion mechanism

The label-free contrastive learning method through the multi-stage attention fusion mechanism solves the problems of data scarcity and small differences in internal defect detection of industrial products, achieves efficient and accurate industrial defect detection, and reduces hardware requirements.

CN118587178APending Publication Date: 2024-09-03HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410715403.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

There is a lack of a large amount of reliable labeled data in the internal defect detection of industrial products. The difference between normal samples and defective samples is small, and there are a large number of unknown defect types, making it difficult to train traditional classifiers.

Method used

A label-free contrastive learning method based on a multi-stage attention fusion mechanism is used to perform multi-stage feature extraction and fusion on defect-free high-resolution industrial images through pre-trained sub-models, and dense aggregation and high-dimensional vector product quantization technology are used for data compression and Feature similarity calculation enables industrial defect detection without defect marking.

Benefits of technology

It achieves high-precision and efficient industrial defect detection using a small number of normal samples, reduces hardware requirements, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587178A
    Figure CN118587178A
Patent Text Reader

Abstract

The invention belongs to the related technical field of industrial defect detection, and discloses an unmarked contrast learning industrial defect detection method and device based on a multi-stage attention fusion mechanism. Training a pre-training sub-model of an MstgCLR model based on the training set to obtain model parameters, and transmitting the model parameters to a detection sub-model of the MstgCLR model; and the detection sub-model performs industrial defect detection based on the obtained model parameters and the industrial image of the to-be-detected target. The method solves the contradiction between the high demand of the existing defect detection on the number of defect types in a training set and the rare image defects in actual industrial products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field related to industrial defect detection, and more specifically, relates to an unlabeled contrastive learning industrial defect detection method and equipment based on a multi-stage attention fusion mechanism. Background Art

[0002] In the industrial manufacturing process, product quality control is an important research direction. For industrial products, internal defect control is particularly important, but the characteristics of industrial products determine that the characteristics of their internal defects are few and multiple, which makes it difficult for the most commonly used internal detection method - industrial CT technology to obtain a large number of effective internal defect data sets. For example, there are few defects and a large number of samples, which makes manual labeling difficult. These problems will lead to difficulties in subsequent automatic defect detection, which also means that internal defect detection in the production process of industrial products faces many unique difficulties and challenges:

[0003] 1. It is difficult to obtain a large amount of reliable and accurate labeled defect data;

[0004] 2. The difference between normal samples and defective samples is very small;

[0005] 3. There are a large number of unknown defect types.

[0006] These challenges make it difficult to train traditional classifiers and require special methods to address these problems. Traditional classifiers require a large amount of manually labeled defect data. Summary of the invention

[0007] In response to the above defects or improvement needs of the prior art, the present invention provides a label-free contrastive learning industrial defect detection method and device based on a multi-stage attention fusion mechanism, which aims to resolve the contradiction between the high demand for the number of defect types in the training set for existing defect detection and the rarity of internal image defects of actual industrial products.

[0008] To achieve the above objectives, according to one aspect of the present invention, a method for industrial defect detection based on unlabeled contrastive learning of a multi-stage attention fusion mechanism is provided. The detection method comprises defect-free high-resolution industrial images into a training set, a pre-trained sub-model of the MstgCLR model is trained based on the training set to obtain model parameters, and the model parameters are transmitted to the detection sub-model of the MstgCLR model; the detection sub-model performs industrial defect detection based on the obtained model parameters and the industrial image of the target to be detected.

[0009] Furthermore, the MstgCLR model includes a pre-training sub-model and a detection sub-model, the pre-training sub-model includes a pre-training feature extraction module, a pre-training multi-stage feature fusion module, a pre-training feature aggregation module, a pre-training feature vector compression module, a pre-training feature similarity calculation module, a pre-training loss function calculation and optimization parameter module and a pre-training output module; the detection sub-model includes a detection feature extraction module, a detection multi-stage feature fusion module, a detection feature aggregation module, a detection feature vector compression module, a detection feature similarity calculation module, a detection abnormal area marking module and a detection output module.

[0010] Furthermore, the pre-trained feature extraction module performs multi-stage feature extraction on the images of the training set, and the extracted features are named FEATURE1, FEATURE2, and FEATURE3 from low stage to high stage respectively; the pre-trained multi-stage feature fusion module fuses the obtained multi-stage features through the multi-channel feature attention fusion module MC-AFF to obtain the full-depth local fusion feature F-DLFF, and fuses the two intermediate stage features through MC-AFF to obtain the intermediate depth local fusion feature M-DLFF.

[0011] Furthermore, the pre-trained feature aggregation module uses dense aggregation technology to densely aggregate the full-depth local fusion features F-DLFF and the intermediate-depth local fusion features M-DLFF within the predetermined adjacent neighborhood; the pre-trained feature vector compression module uses high-dimensional vector product quantization technology to compress the obtained dense aggregation features, and the compressed feature vectors are stored in a vector library.

[0012] Furthermore, high-dimensional vector product quantization technology is used to compress all features obtained in S4. The compressed feature vectors will be stored in a vector library, which is named Nomal-Base.

[0013] Furthermore, the pre-trained feature similarity calculation module calculates the Euclidean distance between the two fused feature vectors, and uses the obtained Euclidean distance as the similarity of the feature map; the pre-trained loss function calculation and optimization parameter module uses the maximum edge contrast loss as the loss function of the model and calculates the loss function value, and then optimizes the model parameters; wherein the model parameters include the convolution layer parameters and the normalization layer parameters in the pre-trained feature extraction module, and the attention weights, fully connected layer parameters, upsampling layer parameters and downsampling layer parameters in the pre-trained multi-stage feature fusion module.

[0014] Furthermore, the number of training rounds for the pre-trained sub-model is determined by the set minimum distance ∈ in the maximum margin contrast loss function.

[0015] Furthermore, the detection feature similarity calculation module calculates the Euclidean distance between the current feature vector to be tested and the normal feature vector in the Nomal-Base, and uses this as the similarity of the feature vector to predict the abnormal area; the detection abnormal area marking module marks the obtained abnormal area to realize abnormal defect detection; the detection output module outputs the obtained abnormal defect detection results in the form of an abnormal defect probability heat map, and its output is the abnormal score calculated for each area.

[0016] The present invention also provides a label-free contrastive learning industrial defect detection system based on a multi-stage attention fusion mechanism, the system includes a memory and a processor, the memory stores a computer program, and the processor executes the label-free contrastive learning industrial defect detection method based on the multi-stage attention fusion mechanism as described above when executing the computer program.

[0017] The present invention also provides a computer-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the unlabeled contrastive learning industrial defect detection method based on the multi-stage attention fusion mechanism as described above.

[0018] In general, compared with the prior art, the above technical solution conceived by the present invention, the unlabeled contrastive learning industrial defect detection method and device based on the multi-stage attention fusion mechanism provided by the present invention mainly has the following beneficial effects:

[0019] 1. The detection method forms a training set of defect-free high-resolution industrial images. The pre-training sub-model of the MstgCLR model obtains model parameters based on the training set, and transmits the model parameters to the detection sub-model of the MstgCLR model; the detection sub-model performs industrial defect detection based on the obtained model parameters and the industrial image of the target to be tested. In this way, the model can achieve high-precision and efficient detection of abnormal defects by using only a small amount of normal samples for training.

[0020] 2. A method for extracting, perceiving and aggregating local features of image data is designed. The extraction and perception of local features fully obtains the local feature information of the image, ensuring the accuracy of subsequent detection. The aggregation of local features expands the model's receptive field of the image to a certain extent, ensuring the efficiency of training and detection. The application of local feature extraction, perception and aggregation modules takes into account both the model's detection accuracy of local areas of the image and the expansion of the receptive field to improve operating efficiency, allowing the model to operate with higher accuracy and efficiency.

[0021] 3. In the entire model, the similarity of the feature vectors is calculated by comparing the local feature blocks, the similarity between defect-free images is compared to realize the training of model parameters, and the abnormalities between the image to be detected and the defect-free image are compared to realize the detection of abnormal defect parts, so as to realize the detection without defect marking.

[0022] 4. Perform product quantization compression on local feature vectors to avoid images that are too large, causing the training set to have too much local feature vector information, which would make the model's requirements on the operating environment hardware too high, and increase the demand for operating hardware equipment in the model training and detection stages. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 This is a schematic diagram of the three-stage output features of the Wide-ResNet5 pre-trained residual network structure;

[0024] Figure 2 (a) and (b) are schematic diagrams of applicable forms of the MC-AFF multi-channel attention fusion module;

[0025] Figure 3 (a)-(c) are schematic diagrams of dense polymerization process;

[0026] Figure 4 It is a flow chart of an unlabeled contrastive learning industrial defect detection method based on a multi-stage attention fusion mechanism provided by an embodiment of the present invention;

[0027] Figure 5 It is a specific usage process diagram of the unlabeled contrastive learning industrial defect detection method based on the multi-stage attention fusion mechanism provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0029] See also Figure 4 and Figure 5The present invention provides an unlabeled contrastive learning industrial defect detection method based on a multi-stage attention fusion mechanism. The detection method forms a training set of defect-free high-resolution industrial images, and the pre-trained sub-model of the MstgCLR model obtains model parameters based on the training set, and transmits the model parameters to the detection sub-model of the MstgCLR model; the detection sub-model performs industrial defect detection based on the obtained model parameters and the industrial image of the target to be detected. Among them, the high-resolution industrial image refers to an industrial image with a resolution of 4000*4000 pixels.

[0030] Among them, the MstgCLR model includes a pre-training sub-model and a detection sub-model, the pre-training sub-model includes a pre-training feature extraction module, a pre-training multi-stage feature fusion module, a pre-training feature aggregation module, a pre-training feature vector compression module, a pre-training feature similarity calculation module, a pre-training loss function calculation and optimization parameter module and a pre-training output module; the detection sub-model includes a detection feature extraction module, a detection multi-stage feature fusion module, a detection feature aggregation module, a detection feature vector compression module, a detection feature similarity calculation module, a detection abnormal area marking module and a detection output module.

[0031] Before the pre-trained sub-model obtains the model parameters based on the training set, the pre-trained sub-model includes step S1: selecting defect-free images from the high-resolution industrial CT image data as the training set. This process does not require labeling and only requires defect-free images. In this embodiment, a large number of high-resolution internal tomographic data images are constructed based on high-resolution industrial CT, defect-free data are manually selected from them, and a "train\good" folder is constructed under the training data set and placed in it.

[0032] The steps of obtaining the model parameters of the pre-trained sub-model based on the training set are as follows:

[0033] S2, the pre-trained feature extraction module performs multi-stage feature extraction on the images of the training set. The extracted features are named FEATURE1, FEATURE2, and FEATURE3 from low stage to high stage respectively.

[0034] In this embodiment, the pre-trained feature extraction module is mainly composed of the Wide-ResNet50 residual network. The Wide-ResNet50 residual network has been trained in advance on the MVTec public data set, which can shorten the training process. The main function of this module is to extract image features. The feature extraction process is as follows: Use the Wide-ResNet50 three-stage network depth to extract features (see Figure 1 ), the extracted features are named FEATURE1, FEATURE2, and FEATURE3 from low stage to high stage respectively.

[0035] The structure of the Wide-ResNet50 pre-trained residual network is as follows Figure 1 As shown, different deep network layers correspond to output features at different stages.

[0036] S3, the pre-trained multi-stage feature fusion module fuses the obtained multi-stage features through the multi-channel feature attention fusion module MC-AFF to obtain the full depth local fusion feature F-DLFF, and the two intermediate stage features are fused through MC-AFF to obtain the intermediate depth local fusion feature M-DLFF.

[0037] Specifically, the role of the pre-trained multi-stage feature fusion module is to fuse the three stage features (FEATURE1, FEATURE2, FEATURE3) through the multi-channel feature attention fusion module MC-AFF to obtain the full depth local fusion feature F-DLFF, and to fuse the two intermediate stage features (FEATURE2, FEATURE3) through MC-AFF to obtain the intermediate depth local fusion feature M-DLFF.

[0038] MC-AFF multi-channel attention fusion module: MC-AFF can effectively fuse features of multiple different network structures and different scale channel numbers (such as Figure 2 As shown in Figure 2, up- and down-sampling algorithms and dilated convolutions are designed inside the feature fusion module to ensure that the output sizes of F-DLFF and M-DLFF are consistent.

[0039] S4, the pre-trained feature aggregation module uses dense aggregation technology to densely aggregate the full-depth local fusion features F-DLFF and the intermediate-depth local fusion features M-DLFF in the predetermined adjacent neighborhood.

[0040] Specifically, see Figure 3 The function of the pre-trained feature aggregation module is to use dense aggregation technology to densely aggregate the fusion features (F-DLFF and M-DLFF in S3) in the predetermined adjacent domain, expand the receptive field, and more efficiently represent local features. The specific process is as follows: traverse a certain area of ​​the fusion features F-DLFF and M-DLFF: in It refers to a local block of size r×r located at (x, y) in the image. r can be set according to the size of the detection target. In this example, r is set to 5. Each of the above r×r local blocks is aggregated into a single pixel block: in F is a dense aggregation function, and the dense aggregation function F uses average pooling for feature aggregation. Finally, two sets of dense aggregation features of size 3×3 are obtained at (x, y)|{x∈(2,…, DPI), y∈(2,…, DPI)}, which can represent a 7×7 area.

[0041] In this embodiment, the local fusion feature dense aggregation targets the two fusion features after fusion in S3: F-DLFF and M-DLFF, and its schematic diagram is as follows: Figure 3 shown.

[0042] S5, the pre-trained feature vector compression module uses high-dimensional vector product quantization technology to compress the dense aggregated features, and the compressed feature vectors are stored in a vector library.

[0043] Specifically, the main function of the pre-trained feature vector compression module is to compress the dense aggregate features obtained in S4. The high-dimensional vector product quantization technology is used to compress all the features obtained in S4. The compressed feature vectors will be stored in a vector library, which is named Nomal-Base.

[0044] S6, the pre-trained feature similarity calculation module calculates the Euclidean distance between the two fused feature vectors, and uses the obtained Euclidean distance as the similarity of the feature map.

[0045] The process of calculating the feature vector similarity is performed on the compressed feature vectors obtained in S5. The Euclidean distance between any two "compressed vectors" is calculated as the representative of the Euclidean distance of all local feature vectors of all normal images. The average value of the Euclidean distance between the feature vectors of normal images is taken, which is defined as the "normal sample similarity" and recorded as

[0046] S7, the pre-training loss function calculation and optimization parameter module uses the maximum edge contrast loss as the loss function of the model and calculates the loss function value, thereby optimizing the model parameters. The model parameters include the convolution layer parameters and normalization layer parameters in the pre-training feature extraction module, and the attention weights, fully connected layer parameters, up-sampling layer parameters, and down-sampling layer parameters in the pre-training multi-stage feature fusion module.

[0047] Substitute the Euclidean distance of all samples into the loss function and find the MstgCLR model parameters corresponding to the minimum value of the loss function.

[0048] Specifically, the pre-training loss function calculation and optimization parameter module uses the maximum edge contrast loss as the loss function of the model:

[0049] S1~S6 is a training round. The number of training rounds depends on the actual detection effect after each training is completed. The process is as follows: the specific number of training rounds depends on the artificially set minimum distance ∈ in the maximum edge contrast loss function in S7. The value of ∈ is set according to the characteristics of the data set. Usually, you can start with a number between 0.2 and 0.5. Every time the value of ∈ is changed, training must be performed, and then the output model parameters are passed to the downstream detection sub-model for detection, and the detection effect is output.

[0050] S8, the pre-training output module outputs the optimized model parameters to the detection sub-model.

[0051] Specifically, the output of the pre-training output module is a model parameter file, which stores the model parameters optimized during the pre-training process.

[0052] Before the step of the detection sub-model performing industrial defect detection based on the obtained model parameters and the industrial image of the object to be detected, the detection sub-model includes step S9: acquiring an image dataset of the object to be detected, and inputting the image dataset of the object to be detected into the detection sub-model.

[0053] The steps of performing industrial defect detection based on the obtained model parameters and the industrial image of the object to be detected by the detection sub-model are as follows:

[0054] S10, after the detection feature extraction module is trained based on the obtained model parameters, multi-stage feature extraction is performed on the image of the target to be detected. The extracted features are named FEATURE11, FEATURE12, and FEATURE13 from the low stage to the high stage respectively.

[0055] The detection feature extraction module is mainly composed of the Wide-ResNet50-X residual network. The Wide-ResNet50-X residual network is an improved residual network obtained by passing the optimization parameters output in S8 into the Wide-ResNet50 residual network.

[0056] S11, the detection multi-stage feature fusion module fuses the currently obtained multi-stage features through the multi-channel feature attention fusion module MC-AFF to obtain the full depth local fusion feature 1F-DLFF, and the two intermediate stage features are obtained through MC-AFF to obtain the intermediate depth local fusion feature 1M-DLFF.

[0057] The function of the multi-stage feature fusion module for detection is to fuse the three stage features (FEATURE11, FEATURE12, FEATURE13) through the multi-channel feature attention fusion module MC-AFF to obtain the full depth local fusion feature 1F-DLFF, and the two intermediate stage features (FEATURE12, FEATURE13) through MC-AFF to obtain the intermediate depth local fusion feature 1M-DLFF. The parameters of this module are still obtained during the pre-training process in the pre-training sub-model.

[0058] S12, the detection feature aggregation module uses dense aggregation technology to densely aggregate the full-depth local fusion features 1F-DLFF and the intermediate-depth local fusion features 1M-DLFF in the predetermined adjacent neighborhood.

[0059] The function of the detection feature aggregation module is to use dense aggregation technology to densely aggregate local fusion features, that is, to densely aggregate the fusion features within a certain adjacent domain (1F-DLFF and 1M-DLFF in S11), expand the receptive field, and more efficiently represent local features. The specific process is consistent with the specific process in S4.

[0060] S13, the detection feature vector compression module uses high-dimensional vector product quantization technology to compress the obtained dense aggregation features.

[0061] The main function of the detection feature vector compression module is to compress the dense aggregate features obtained in S12. The high-dimensional vector product quantization technology is used to compress the data of all features obtained in S12.

[0062] S14, the detection feature similarity calculation module calculates the Euclidean distance between the current feature vector to be tested and the normal feature vector in the Nomal-Base, and uses this as the similarity of the feature vectors to predict the abnormal area.

[0063] The detection feature similarity calculation module obtains the Euclidean distance between the detection feature vector to be detected and the Nomal-Base normal feature vector as a measure of the similarity of the feature vectors, and the similarity is used to predict the abnormal area.

[0064] In S14, the Euclidean distance between all the feature vectors to be detected and the normal feature vector of the Nomal-Base is searched to find the maximum Euclidean distance, which is defined as "absolute defect similarity" and recorded as

[0065] S15, the abnormal area marking module marks the obtained abnormal area to achieve abnormal defect detection.

[0066] The Euclidean distance between a certain region feature vector and the normal feature vector in Nomal-Base is defined as Then the abnormal percentage of the area can be calculated as: The output in S16 is the anomaly score calculated for each region.

[0067] S16, the detection output module outputs the obtained abnormal defect detection results in the form of an abnormal defect probability heat map.

[0068] The present invention also provides a label-free contrastive learning industrial defect detection system based on a multi-stage attention fusion mechanism, the system includes a memory and a processor, the memory stores a computer program, and the processor executes the label-free contrastive learning industrial defect detection method based on the multi-stage attention fusion mechanism as described above when executing the computer program.

[0069] The present invention also provides a computer-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the unlabeled contrastive learning industrial defect detection method based on the multi-stage attention fusion mechanism as described above.

[0070] In another embodiment, see Figure 1 and Figure 2 The contrastive learning defect detection method trains the model parameters by calculating and minimizing the sample space distance between the features of defect-free samples. All trainable parameters in this model are distributed in the feature extraction module, feature fusion module, and feature aggregation module. After the training is completed, the parameters are saved and passed to the downstream detection sub-model. Then, the spatial distance between the defect-free features and the defective feature samples is calculated in the downstream detection sub-model to predict (infer) the area where the defect may exist.

[0071] The specific steps are:

[0072] Operation S1, import the training set, select defect-free images from the high-resolution CT industrial image data as the training set, set the training set root directory to "...\dataset\traingood", and create a new "good" folder in this directory to prevent training data. Taking the D drive as an example, create a new training set folder directory: "D:\MstgCLR\dataset\traingood", create a new folder "good" in this directory, and the training set data is placed in "D:\MstgCLR\dataset\traingood\good", and then run the train.py file in the model root directory. This process does not require labeling and only requires defect-free images. After the code starts running, the training set will be sent to the pre-training sub-model PREtrainCLR of the MstgCLR model for training.

[0073] Operation S2 saves the training results. After the training is completed, you can find the saved model.ckpt file in the "result" folder in the directory "D:\MstgCLR\dataset\trai ngood\result". model.ckpt is the trained model parameter file.

[0074] Operation S3, import the test set, create a new directory "D:\MstgCLR\Inference\test", create a new folder "testDataset" in this directory, and put the test data into "D:\MstgCLR\Inference\test\testDataset".

[0075] Operation S4, model inference test, runs the Inference.py file in the model root directory. When the Inference.py file is run, it will automatically import the previously saved model.ckpt. This process is to import the trained model parameters and then use the test set to test the model detection effect. The output results are presented in the form of a probability heat map.

[0076] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An unlabeled contrastive learning industrial defect detection method based on multi-stage attention fusion mechanism, Features: The detection method forms a training set with defect-free high-resolution industrial images, and the pre-training sub-model of the MstgCLR model is trained based on the training set to obtain model parameters, and the model parameters are transmitted to the detection sub-model of the MstgCLR model; The detection sub-model performs industrial defect detection based on the obtained model parameters and the industrial image of the target to be detected.

2. The unlabeled contrastive learning industrial defect detection method based on the multi-stage attention fusion mechanism as claimed in claim 1, Features: The MstgCLR model includes a pre-training sub-model and a detection sub-model. The pre-training sub-model includes a pre-training feature extraction module, a pre-training multi-stage feature fusion module, a pre-training feature aggregation module, a pre-training feature vector compression module, a pre-training feature similarity calculation module, a pre-training loss function calculation and optimization parameter module and a pre-training output module; the detection sub-model includes a detection feature extraction module, a detection multi-stage feature fusion module, a detection feature aggregation module, a detection feature vector compression module, a detection feature similarity calculation module, a detection abnormal area marking module and a detection output module.

3. The unlabeled contrastive learning industrial defect detection method based on the multi-stage attention fusion mechanism as claimed in claim 2, Features: The pre-trained feature extraction module performs multi-stage feature extraction on the images of the training set. The extracted features are named FEATURE1, FEATURE2, and FEATURE3 from low to high stages respectively. The pre-trained multi-stage feature fusion module fuses the obtained multi-stage features through the multi-channel feature attention fusion module MC-AFF to obtain the full-depth local fusion feature F-DLFF, and fuses the two intermediate stage features through MC-AFF to obtain the intermediate depth local fusion feature M-DLFF.

4. The method for industrial defect detection based on unlabeled contrastive learning using a multi-stage attention fusion mechanism as claimed in claim 3, Features: The pre-trained feature aggregation module uses dense aggregation technology to densely aggregate the full-depth local fusion features F-DLFF and the intermediate-depth local fusion features M-DLFF within the predetermined adjacent neighborhood; the pre-trained feature vector compression module uses high-dimensional vector product quantization technology to compress the obtained dense aggregation features, and the compressed feature vectors are stored in a vector library.

5. The method for industrial defect detection based on unlabeled contrastive learning using a multi-stage attention fusion mechanism as claimed in claim 4, Features: High-dimensional vector product quantization technology is used to compress all features obtained in S4. The compressed feature vectors will be stored in a vector library, which is named Nomal-Base.

6. The method for industrial defect detection based on unlabeled contrastive learning using a multi-stage attention fusion mechanism as claimed in claim 4, Features: The pre-trained feature similarity calculation module calculates the Euclidean distance between the two fused feature vectors, and uses the obtained Euclidean distance as the similarity of the feature map; the pre-trained loss function calculation and optimization parameter module uses the maximum edge contrast loss as the loss function of the model and calculates the loss function value, and then optimizes the model parameters; among them, the model parameters include the convolution layer parameters and normalization layer parameters in the pre-trained feature extraction module, and the attention weights, fully connected layer parameters, upsampling layer parameters and downsampling layer parameters in the pre-trained multi-stage feature fusion module.

7. The method for industrial defect detection based on unlabeled contrastive learning using a multi-stage attention fusion mechanism as claimed in claim 6, Features: The number of training rounds for the pre-trained sub-model is determined by setting the minimum distance ∈ in the maximum margin contrast loss function.

8. The method for industrial defect detection based on unlabeled contrastive learning using a multi-stage attention fusion mechanism as claimed in claim 5, Features: The detection feature similarity calculation module calculates the Euclidean distance between the current feature vector to be tested and the normal feature vector in the Nomal-Base, and uses this as the similarity of the feature vector to predict the abnormal area; The abnormal area marking module marks the abnormal area obtained to realize abnormal defect detection; the detection output module outputs the abnormal defect detection results obtained in the form of an abnormal defect probability heat map, and its output is the abnormal score calculated for each area.

9. An unlabeled contrastive learning industrial defect detection system based on multi-stage attention fusion mechanism, Features: The system includes a memory and a processor, the memory stores a computer program, and the processor executes the unlabeled contrastive learning industrial defect detection method based on a multi-stage attention fusion mechanism as described in any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium, Features: The computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions prompt the processor to implement the unlabeled contrastive learning industrial defect detection method based on a multi-stage attention fusion mechanism as described in any one of claims 1-8.

Citation Information

Cited By

  • Hardware tool defect online detection system based on AI image recognition

    CN121415147A