Feature information reconstruction industrial defect detection method based on multi-dimensional feature fusion

Through the multi-dimensional feature fusion feature reconstruction method, the traditional industrial defect detection method is solved, and the problem of sensitivity to environmental changes and poor generalization ability is realized, real-time and efficient defect detection is achieved, and reconstruction performance and system generalization performance are improved.

CN119130992AActive Publication Date: 2024-12-13GUANGZHOU UNIVERSITY

Patent Information

Application Number
CN202411276764.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-13
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

Traditional industrial defect detection methods are sensitive to environmental changes, have poor generalization capabilities, cannot meet real-time requirements, have poor reconstruction performance and low system generalization performance.

Method used

The feature information reconstruction method based on multi-dimensional feature fusion includes building a cropped autoencoder AE, introducing teacher network to guide feature information reconstruction, building embedded modules and MFF modules, using lightweight segmentation network to complete defect segmentation positioning, and through multiple scales Feature fusion and information correction mechanisms improve detection performance.

Benefits of technology

The network parameters and calculation volume are reduced, reconstruction performance and generalization performance are improved, robustness to environmental changes is enhanced, real-time detection and efficient defect positioning are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119130992A_ABST
    Figure CN119130992A_ABST
Patent Text Reader

Abstract

The invention discloses a feature information reconstruction industrial defect detection method based on multi-dimensional feature fusion, and relates to the technical field of defect detection. Compared with a previous defect detection method, the defect detection method solves the problems that a traditional defect detection method is sensitive to environmental changes and poor in generalization ability; the real-time requirement cannot be met; the reconstruction performance effect is poor; and the generalization performance of the system is not high. A cutting type auto-encoder AE is introduced to complete reconstruction of normal feature information of a defect sample, and the parameter quantity and the calculation quantity of the network are reduced. And the embedding module is used for replacing an editing part, system performance is maintained, feature information of a normal image is increased, and the reconstruction function of the reconstruction module is completed. An MFF module is introduced to reutilize the encoder module feature information in the AE reconstruction module; and an information correction mechanism is additionally introduced into the MFF module, so that the problem of reconstruction performance reduction caused by leakage of abnormal information is prevented, and normal feature information of the teacher network is utilized to guide correct use of multi-dimensional feature information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of defect detection, and in particular to an industrial defect detection method based on feature information reconstruction based on multi-dimensional feature fusion. Background Art

[0002] Defect detection is a very important part of industrial inspection. By performing defect detection on products, problems can be discovered and repaired in a timely manner to ensure product quality and safety. Traditional manual inspection is time-consuming and labor-intensive, and may also lead to missed inspections and false inspections. Therefore, with the development of technology, machine vision has been widely introduced into the field of defect detection in industrial inspection, and has achieved excellent results.

[0003] Traditional industrial defect detection technology is based on texture features, shape features and deep learning methods.

[0004] Defect detection methods based on texture features can be further divided into two categories: statistical methods and signal processing methods. Statistical methods mainly regard the grayscale value distribution on the surface of an object as a random distribution, analyze the distribution of random variables from a statistical perspective, and describe the spatial distribution of grayscale values ​​through features such as histogram features, grayscale co-occurrence matrix, local binary pattern, autocorrelation function, and mathematical morphology. Signal processing methods mainly regard images as two-dimensional signals and analyze images from the perspective of signal filter design, so they are also called spectrum methods.

[0005] Methods based on shape features can effectively use the objects of interest in the image for retrieval. Among them, the contour-based method is the main type of method. The contour-based method obtains the shape parameters of the image by describing the outer boundary features of the object; the representative methods are Hough transform and Fourier shape descriptor. Hough transform uses the global features of the image to connect the edge pixels to form a closed boundary of the region, and its theoretical basis is the duality of points to lines. It is mainly used to detect surface defects of bottles; in the ROI extraction stage, fast Hough transform is used to detect the boundary line of the light source.

[0006] However, traditional detection methods based on texture features and shape features are often based on simple feature description and classification methods and are difficult to handle complex texture and shape changes. In addition, traditional image processing algorithms are more sensitive to changes in environmental brightness. Too bright or too dark will affect the statistical information of the histogram, etc.

[0007] Deep learning-based methods can also be divided into two categories: reconstruction-based and embedding-based industrial defect detection methods. Reconstruction-based industrial defect detection technology models image feature information in the embedding space based on the autoencoder AE and reconstructs it from the embedding space. However, since these abnormal information are not evolved during the training process, they cannot be reconstructed. Therefore, the difference between the detected image and its reconstructed image represents the abnormality detection result. The core idea of ​​the embedding-based method is to use a pre-trained model to save the target feature information, which can be used directly or indirectly. The former uses the feature information compressed by the strategy to compare with the sample feature information to locate the anomaly, and the latter uses the feature information to establish a memory library through different means to assist in abnormality location.

[0008] In order to improve the reconstruction performance, the reconstruction-based detection method uses a neural network model with too many parameters and calculations in the reconstruction module, resulting in too many parameters and calculations for the entire system, which cannot meet the real-time requirements. Because the use of feature information is ignored, the performance of the reconstruction cannot reach the best. The embedding-based detection method has low generalization performance due to the introduction of additional calculation modules and embedded modules.

[0009] In order to solve the above problems, the present invention proposes an industrial defect detection method based on feature information reconstruction of multi-dimensional feature fusion. Summary of the invention

[0010] The purpose of the present invention is to propose an industrial defect detection method based on feature information reconstruction of multi-dimensional feature fusion to solve the problems raised in the background technology:

[0011] Traditional defect detection methods are sensitive to environmental changes and have poor generalization capabilities; they cannot meet real-time requirements; the reconstruction performance is poor; and the system's generalization performance is not high.

[0012] In order to achieve the above object, the present invention adopts the following technical solutions:

[0013] The industrial defect detection method based on feature information reconstruction of multi-dimensional feature fusion includes the following steps:

[0014] S1: Build a cropping autoencoder AE;

[0015] S2: Introduce a teacher network to guide the cropped autoencoder AE to complete the reconstruction of normal feature information;

[0016] S3: Build an embedding module and define a set of memories. Use the input features to perform similarity addressing on the memory group and obtain the reconstruction features.

[0017] S4: Build the MFF module to guide the encoder's multi-scale features to reconstruct the decoder's features;

[0018] S5: Build a lightweight segmentation network to complete defect segmentation and positioning.

[0019] Preferably, in the pruned autoencoder AE of S1, both the encoder and the decoder are composed of the first three blocks of ResNet18 that have not been pre-trained, and the encoder is represented by E k ,k∈{1,Λ,N}, the decoder is represented by D k ,k∈{1,Λ,N}; the middle is linked by an embedded memory module M; the image feature information corresponds to Represents the projection of the original data I to the embedding space; Among them, C k , H k , W k They represent the number of channels, height, and width of the activation tensor of the kth layer, respectively.

[0020] Preferably, the teacher network of S2 uses the ResNet18 model pre-trained on the ImageNet dataset, uses the feature information tensors of the first three block layers for information guidance; uses cosine similarity as the KD loss; obtains the feature information tensor of the decoder through the autoencoder AE The normal image I n The pre-trained teacher network obtains the normal feature information tensor k∈{1,Λ,N}, with channel C k Calculate for axis and The vector-wise cosine similarity loss is used as the difference between normal feature information and abnormal feature information. By reducing the similarity loss, the autoencoder AE has the ability to reconstruct the normal feature information of the abnormal image. The similarity loss L rec (I n ,I ca ) is calculated as follows:

[0021]

[0022] Among them, d k (h,w) is the vector cosine similarity loss; I ca Abnormal image.

[0023] Preferably, the input of the embedded module in S3 is Define a set of memory inside the embedded module To reconstruct features Use input features to perform similarity addressing on memory groups:

[0024]

[0025] Among them, m i is a subset of the memory group; i is the number of memories; w is the similarity set between the input features and the memory group features; ω i Represents the similarity between input features and memory group features;

[0026] Similarityω i Calculated using cosine distance:

[0027]

[0028]

[0029] in, is the input feature A subset of ; T0 is the transpose of the vector;

[0030] By using the similarity, the memory groups are reorganized into features of different sizes, and finally a processing process is obtained with query features as input and reorganized features as output. The output is defined as

[0031] The memory group M is obtained through the first round of model distillation training; during the first round of model distillation training, the model of the autoencoder AE inputs the normal sample image I n , the data passes through the Encoder to obtain normal feature information After the model parameters are updated inside the memory group, the normal feature information dimension reduction data is saved as memory data; the memory group is addressed by similarity to obtain the reconstructed features Fitting and Finally, the memory group M of the embedded module is obtained.

[0032] Preferably, the input of the MFF module in S4 is the feature output of different blocks of the autoencoder AE E1, E2, and E3 are pooled, and the feature dimensions are aligned after processing. The concatenated and pooled E1, E2, and E3 are used as a feature information block. The feature information block contains semantic information of multiple scales. The block feature is fused in the channel direction through 1×1. The feature information block is adjusted in the channel direction, and is adjusted to Corresponding channels and feature sizes, we get M3,M2,M1={pool(D k ,k∈3,2,1)};

[0033] The MFF module also introduces a difference information suppression function; based on the cosine formula, the multi-scale feature information M3, M2, M1 and the feature information tensor of the teacher network are measured. The difference between:

[0034]

[0035] The threshold is generated by using the excitation function Relu(·), and the threshold is used to suppress the transmission of abnormal information:

[0036]

[0037] The multi-scale fusion information obtained to suppress abnormal information will directly act on the corresponding feature layer of the decoder of the autoencoder AE.

[0038] Preferably, the segmentation network in S5 takes the abnormal image as the feature information {T1, T2, T3} of the teacher network as input, and the feature information {S D1 ,S D2 ,S D3}, taking the difference of the feature mapping between the feature information as the input of the segmentation network; the segmentation network also performs dimensionality reduction processing on the data information to be segmented before segmentation;

[0039] In the segmentation network, the deeper information of the high-level semantic features is gradually and progressively passed to the shallow features through the IFC module. The IFC module transmits the output from the segmentation network Encoder As input to the IFC module, The output of each layer is convolved and then passed through a pooling layer. A CA attention processing block is introduced for feature blocks of different scales. The dimensions and channels of the feature blocks before and after the CA attention module remain unchanged. After the CA Block, the number of channels is adjusted by convolution again. At this time, we get The output of the IFC module is obtained through the following formula:

[0040]

[0041] According to the basic structure of U-Lite, the processed multi-scale feature information is fused with the corresponding Decoder feature information block to obtain the fused feature information.

[0042]

[0043] Through the above process, IFC passes the deepest feature information up layer by layer. Each shallow feature contains the feature information of the deeper layer from the sublayer. Finally, the corresponding IFC output multi-scale feature information is passed to the Decoder module of U-Lite to complete the segmentation function. The segmentation module outputs a segmentation value Mask of a specified size. pre .

[0044] Preferably, the segmentation network optimizes segmentation training using focal loss and L1 loss;

[0045] Mask pre and anomalyMask GT Linear sampling is performed to the same size, where i and j represent the xy coordinates of the image:

[0046]

[0047] Among them, γ is a hyperparameter; p ij is the linear sampling result; L focal is the focal loss; L l1 is L1 loss;

[0048] The training of the segmentation network is completed through the two loss functions of focal loss and L1 loss. The segmentation network model finally outputs a mask that shows the classification of the detected sample pixels.

[0049] Compared with the prior art, the present invention provides an industrial defect detection method based on feature information reconstruction of multi-dimensional feature fusion, which has the following beneficial effects:

[0050] The present invention introduces a cropped autoencoder AE to complete the reconstruction of the normal feature information of the defective sample, and crops the deepest convolution layer to greatly reduce the number of network parameters and the amount of calculation. The embedded module is used to replace the clipped network convolution layer to prevent the degradation of system performance, increase the feature information of the normal industrial sample image, and complete the reconstruction function of the reconstruction module. The MFF module is introduced to reuse the encoder module feature information in the AE reconstruction module; an additional information correction mechanism is introduced in the MFF module to prevent the leakage of abnormal information in the reconstruction of multi-dimensional feature information, resulting in a decrease in reconstruction performance, and the normal feature information of the teacher network is used to guide the correct use of multi-dimensional feature information. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 This is a flow chart of the detection method mentioned in Example 1 of the present invention;

[0052] Figure 2 This is a schematic diagram of the detection network mentioned in Example 1 of the present invention;

[0053] Figure 3 This is a schematic diagram of the IFC module mentioned in Example 1 of the present invention;

[0054] Figure 4 This is a schematic diagram of the feature fusion student-teacher network mentioned in Example 1 of the present invention. DETAILED DESCRIPTION

[0055] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0056] The present invention introduces a cropped autoencoder AE to complete the reconstruction of the normal feature information of defective samples, and crops the deepest convolution layer to greatly reduce the number of network parameters and the amount of calculation. An embedding module is used to replace the clipped network convolution layer to prevent the degradation of system performance, increase the feature information of normal industrial sample images, and complete the reconstruction function of the reconstruction module. The MFF module is introduced to reuse the feature information of the encoder module in the AE reconstruction module; an information correction mechanism is additionally introduced in the MFF module to prevent the leakage of abnormal information in the reconstruction of multi-dimensional feature information, resulting in a decrease in reconstruction performance, and the normal feature information of the teacher network is used to guide the correct use of multi-dimensional feature information. Specifically include the following contents.

[0057] Embodiment 1:

[0058] See also Figure 1-4 , the present invention reconstructs the industrial defect detection method based on the feature information of multi-dimensional feature fusion, and performs defect detection on the MVTec AD data set:

[0059] Preparation stage: For the MVTec AD dataset, adjust its mean and variance, and use bilinear interpolation to resize the image to [256*256].

[0060] Simulate abnormal images: Generate random two-dimensional Perlin noise and binarize it according to the preset threshold to obtain the abnormal mask M. n Replace the mask area with a linear combination of any image A in the external data source to generate an abnormal image I ca .

[0061] Building a defect detection model includes the following steps:

[0062] S1: Build a cropped autoencoder AE, i.e., a student network; the details are as follows:

[0063] Referring to the link layer of the U-Net network, its connection structure can complete the transmission of feature information, thereby improving the performance of the model. Therefore, our proposed multi-scale feature fusion student-teacher network can be referred to Figure 4 After completing the multi-scale feature fusion, the same connection structure is used to help the model transfer feature information.

[0064] In the autoencoder AE, both the encoder and decoder consist of the first three blocks of ResNet18 that have not been pre-trained. The encoder can be represented as E k ,k∈{1,Λ,N}, the decoder can be represented as D k ,k∈{1,Λ,N}; the middle is linked by an embedded memory module M; the image feature information corresponds to Represents the projection of the original data I to the embedding space; Among them, C k , H k , W k They represent the number of channels, height, and width of the activation tensor of the kth layer, respectively.

[0065] S2: Introduce a teacher network to guide the cropped autoencoder AE to complete the reconstruction of normal feature information; the details are as follows:

[0066] The purpose of introducing the teacher network is to guide the cropped autoencoder AE to achieve the goal of reconstructing normal feature information.

[0067] The teacher network uses the ResNet18 model pre-trained on the ImageNet dataset. For data alignment, the feature information tensors of the first three block layers are also used for information guidance. For knowledge transfer in the TS model, in order to accurately capture the relationship between high-dimensional and low-dimensional information, cosine similarity is used as the KD loss. The decoder feature information tensor is obtained through the autoencoder AE. Refer to the student network model denoising mechanism of the DeSTSeg model, normal image I n The pre-trained teacher network ResNet18 obtains the normal feature information tensor Channel C k Calculate for axis and The vector-wise cosine similarity loss is used as the difference between normal feature information and abnormal feature information. By reducing the similarity loss, the autoencoder AE has the ability to reconstruct the normal feature information of abnormal images. The loss formula is as follows:

[0068]

[0069] Among them, d k (h,w) is the vector cosine similarity loss; I ca is an abnormal image; L rec (I n ,I ca ) is the similarity loss.

[0070] However, reconstructing abnormal feature information into normal feature information is a challenging task. Referring to TrustMAE, introducing additional memory information can help the student network decoder to better complete the feature reconstruction task. The introduced embedding module replaces the deepest block of the original ResNet18, i.e., 2*conv3x3, C=512 convolution.

[0071] S3: Build an embedding module and define a set of memories. Use the input features to perform similarity addressing on the memory groups and obtain the reconstruction features. The details are as follows:

[0072] The input of the embedding module is A set of memory is defined inside the embedded module To reconstruct features Using input features Similarity addressing of memory groups:

[0073]

[0074] Among them, m i is a subset of the memory group; i is the number of memories; w is the similarity set between the input features and the memory group features; ω i Represents the similarity between input features and memory group features;

[0075] Similarityω i Calculated using cosine distance:

[0076]

[0077] in, is the input feature A subset of ; T0 is the transpose of the vector;

[0078] By using the similarity, the memory groups are reorganized into features of different sizes, and finally a processing process is obtained with query features as input and reorganized features as output. The output is defined as

[0079] The memory group M is obtained through the first round of model distillation training; in the first round of model distillation training, the model of the student network inputs the normal sample image I n , the data passes through the student network Encoder to obtain normal feature information After the model parameters are updated inside the memory group, the normal feature information dimension reduction data is saved as memory data; the memory group is addressed by similarity to obtain the reconstructed features Fitting and Finally, the memory group M of the embedded module is obtained.

[0080] S4: Build the MFF module to guide the encoder's multi-scale features to reconstruct the decoder's features; the details are as follows:

[0081] The input of the MFF (Multi-scale feature fusion) module is the feature output of different blocks of the autoencoder AE In order to reduce the computational burden of the MFF module, the patch information of the extracted features is notified, and E1, E2, and E3 are pooled. After processing, the feature dimensions are aligned. In order to fuse the multi-scale feature information, the spliced ​​and pooled E1, E2, and E3 are used as a feature information block; in this way, the feature information block contains semantic information of multiple scales, and the block feature is fused in the channel direction through 1×1; in order to match the semantics of the same level to the features of the same level, the semantic guidance errors can be avoided, and the feature information blocks are adjusted in channels, and are adjusted to Corresponding channels and feature sizes, we can get M3,M2,M1={pool(D k ,k∈3,2,1)}; Due to the feature information of the autoencoder AE Contains abnormal information. If information guidance is performed directly, abnormal feature information leakage may occur during feature information reconstruction. Therefore, the MFF module introduces the difference information suppression function; the difference information suppression function requires two input data, namely the multi-scale feature information M3, M2, M1 and the feature information tensor of the teacher network The former has abnormal feature information, while the latter only has normal image feature information. The difference between the feature information represents the abnormal information point. The difference between the two is measured based on the cosine formula:

[0082]

[0083] The threshold is generated by using the excitation function Relu(·), and the threshold is used to suppress the transmission of abnormal information:

[0084]

[0085] The multi-scale fusion information obtained to suppress abnormal information will directly act on the corresponding feature layer of the student decoder of AE.

[0086] S5: Build a lightweight segmentation network to complete defect segmentation and location. The details are as follows:

[0087] The feature information {T1, T2, T3} of the teacher network with the abnormal image as input and the feature information {S D1 ,S D2 ,SD3}, the difference in feature mapping between feature information is used as the input of the segmentation network; before segmentation, considering the consumption of computing performance, the data information to be segmented is subjected to dimensionality reduction processing, and the channel dimension is reduced to 3 dimensions through a ResNet18 residual block.

[0088] Reference Figure 3 In the segmentation network, the IFC module is used to gradually pass the deeper information of the high-level semantic features to the shallow features, thereby completing the multi-path refinement function and compensating for the information difference problem introduced by the reconstructed multi-scale feature information. As input to the IFC module, The output of each layer is convolved to compress the channel, and then a pooling layer is used to reduce the size of the feature. A CA attention processing block is introduced for feature blocks of different scales. The dimensions and channels of the feature blocks before and after the CA attention module remain unchanged. In order to maintain the fusion of subsequent multi-scale feature information, the number of channels is adjusted again after CABlock. At this time, The output of the IFC module is obtained through the following formula:

[0089]

[0090] According to the basic structure of U-Lite, the processed multi-scale feature information is fused with the corresponding Decoder feature information block to obtain the fused feature information.

[0091]

[0092] Through the above process, IFC passes the deepest feature information up layer by layer. Each shallow feature contains the feature information of the deeper layer from the sublayer. Finally, the corresponding IFC output multi-scale feature information is passed to the Decoder module of U-Lite to complete the segmentation function. The segmentation module outputs a segmentation value Mask of a specified size. pre .

[0093] The function of the segmentation network in the system is to segment the positions of the reconstructed features and defect features in the image. The so-called segmentation is the classification of image pixels into normal pixels and abnormal pixels, and finally completes the defect location of the defective sample.

[0094] The segmentation network uses focal loss and L1 loss to optimize segmentation training; focal loss can help the model focus on minority categories and difficult samples. L1 loss can improve the sparsity of the output and make the boundaries of the segmentation mask clearer. pre and anomalyMaskGT Perform linear sampling to the same size, where i, j represent the xy coordinates of the image:

[0095]

[0096] Among them, γ is a hyperparameter; p ij is the linear sampling result; L focal is the focal loss; L l1 is L1 loss;

[0097] The training of the segmentation network is completed through the two loss functions of focal loss and L1 loss. The segmentation network model finally outputs a mask that shows the classification of the detected sample pixels.

[0098] Training phase:

[0099] Adapt to data distribution and obtain storage modules:

[0100] Traversing the normal images of industrial samples: obtaining the feature outputs of the student network and the teacher network Use the teacher network to guide the learning network to reconstruct feature information:

[0101]

[0102] Initialize the embedding module and use the loss function L m Make the output of the student network and the teacher network similar and complete the construction of the embedding module:

[0103]

[0104] Using Adam optimizer Adam(L rec +L m ) to train the model.

[0105] Reconstruct abnormal feature information:

[0106] Using Perlin noise, simulate abnormal images through normal images; traverse normal image I n With abnormal image I ca ;

[0107] Will I n and I ca As the input of the teacher network and the student network respectively, the image feature information is obtained

[0108] The output of the student network encoder is used as the input of the MFF module to obtain multi-dimensional feature fusion information;

[0109] Inject multi-dimensional feature fusion information into the student network decoder module;

[0110] Calculate the loss function:

[0111]

[0112] Using the SGD optimizer SGD(L rec ) to train the model.

[0113] Train the segmentation network:

[0114] Use the student network to reconstruct the output feature information and the teacher's output feature information and integrate the information of the two:

[0115]

[0116] Use ResNet18 residual module to adjust the channel:

[0117]

[0118] Input the adjusted feature information into the segmentation network to obtain the output of the segmentation network:

[0119]

[0120] Calculate the loss function and train the model, where Mask pre Represents the correct classification mask for the image:

[0121] L focal =(Mask pre ,Mask GT )

[0122] Adam(L focal )

[0123] Reasoning stage:

[0124] The defect detection process of the system: Input the image to be detected; Based on the student network: AE{E k ,D k Teacher Network: Segmentation network: Traverse the image to be detected; output the segmented image of the image to be detected, as follows:

[0125] Preprocessing is completed by adjusting the size and mean variance of the image to be detected;

[0126] The image to be detected is sent as input to the teacher and student networks, and the student network completes the feature information reconstruction:

[0127] Use ResNet18 residual module to adjust feature information Number of channels:

[0128]

[0129] Use the segmentation network Seg to obtain the defect segmentation image output of the image to be detected:

[0130]

[0131] Finally, the system outputs the defect segmentation image of the image to be detected.

[0132] The defect detection method of this embodiment for the MVTec AD data set is compared with the traditional Patch core, EfficientAD, RD, RD++, Dream, and Fastflow methods. For details, please refer to Table 1:

[0133] Table 1 Computational efficiency performance

[0134]

[0135] As can be seen from the table, the method of this embodiment has an average AUROC [Area Under the Receiver Operating Characteristic Curve] image level of 99.40%, an average AUROC pixel level of 98.25%, and a PRO [Per-Region Overlap] metric of 95.44% in the MVTecAD public industrial defect data. In addition, the image-level defect detection performance in the MPDD public industrial defect data has reached the SOTA level.

[0136] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for industrial defect detection based on feature information reconstruction based on multi-dimensional feature fusion, characterized in that: The steps include: S1: Build a cropping autoencoder AE; S2: Introduce a teacher network to guide the cropped autoencoder AE to complete the reconstruction of normal feature information; S3: Build an embedding module and define a set of memories. Use the input features to perform similarity addressing on the memory group and obtain the reconstruction features. S4: Build the MFF module to guide the encoder's multi-scale features to reconstruct the decoder's features; S5: Build a lightweight segmentation network to complete the segmentation and positioning of industrial sample defects.

2. The method for industrial defect detection based on feature information reconstruction of multi-dimensional feature fusion according to claim 1 is characterized in that: In the pruned autoencoder AE of S1, both the encoder and decoder consist of the first three blocks of ResNet18 that have not been pre-trained. The encoder is represented by E k ,k∈{1,Λ,N}, the decoder is represented by D k ,k∈{1,Λ,N}; they are linked by an embedded memory module M; The image feature information corresponds to Represents the projection of the original data I to the embedding space; Among them, C k , H k , W k They represent the number of channels, height, and width of the activation tensor of the kth layer, respectively.

3. The method for industrial defect detection based on feature information reconstruction of multi-dimensional feature fusion according to claim 1 is characterized in that: The teacher network of S2 uses the ResNet18 model pre-trained on the ImageNet dataset, uses the feature information tensors of the first three block layers for information guidance, uses cosine similarity as the KD loss, and obtains the feature information tensor of the decoder through the autoencoder AE. The normal image I n The pre-trained teacher network obtains the normal feature information tensor Channel C k Calculate for axis and The vector-wise cosine similarity loss is used as the difference between normal feature information and abnormal feature information. By reducing the similarity loss, the autoencoder AE has the ability to reconstruct the normal feature information of the abnormal image. The similarity loss L rec (I n ,I ca ) is calculated as follows: Among them, d k (h,w) is the vector cosine similarity loss; I ca Abnormal image.

4. The method for industrial defect detection based on feature information reconstruction of multi-dimensional feature fusion according to claim 1 is characterized in that: The input of the embedding module in S3 is Define a set of memory inside the embedded module To reconstruct features Use input features to perform similarity addressing on memory groups: Among them, m i is a subset of the memory group; i is the number of memories; w is the similarity set between the input features and the memory group features; ω i Represents the similarity between input features and memory group features; Similarityω i Calculated using cosine distance: in, is the input feature A subset of ; T0 is the transpose of the vector; By using the similarity, the memory groups are reorganized into features of different sizes, and finally a processing process is obtained with query features as input and reorganized features as output. The output is defined as The memory group M is obtained through the first round of model distillation training; during the first round of model distillation training, the model of the autoencoder AE inputs the normal sample image I n , the data passes through the Encoder to obtain normal feature information After the model parameters are updated inside the memory group, the normal feature information dimension reduction data is saved as memory data; the memory group is addressed by similarity to obtain the reconstructed features Fitting and Finally, the memory group M of the embedded module is obtained.

5. The method for industrial defect detection based on feature information reconstruction of multi-dimensional feature fusion according to claim 1 is characterized in that: The input of the MFF module in S4 is the feature output of different blocks of the autoencoder AE E1, E2, and E3 are pooled, and after the processing, the feature dimensions are aligned, and the pooled E1, E2, and E3 are concatenated as a feature information block; The feature information block contains semantic information of multiple scales. The block feature is fused in the channel direction through 1×1. The feature information block is adjusted in the channel direction, and is adjusted to Corresponding channels and feature sizes, we get M3,M2,M1={pool(D k ,k∈3,2,1)}; The MFF module also introduces a difference information suppression function; based on the cosine formula, the multi-scale feature information M3, M2, M1 and the feature information tensor of the teacher network are measured. The difference between: The threshold is generated by using the excitation function Relu(·), and the threshold is used to suppress the transmission of abnormal information: The multi-scale fusion information obtained to suppress abnormal information will directly act on the corresponding feature layer of the decoder of the autoencoder AE.

6. The method for industrial defect detection based on feature information reconstruction of multi-dimensional feature fusion according to claim 1 is characterized in that: The segmentation network in S5 takes the abnormal image as the feature information {T1, T2, T3} of the teacher network as input, and the feature information {S D1 ,S D2 ,S D3 }, taking the difference of the feature mapping between the feature information as the input of the segmentation network; the segmentation network also performs dimensionality reduction processing on the data information to be segmented before segmentation; In the segmentation network, the deeper information of the high-level semantic features is gradually and progressively passed to the shallow features through the IFC module. The IFC module transmits the output from the segmentation network Encoder As input to the IFC module, The output of each layer is convolved and then passed through a pooling layer. A CA attention processing block is introduced for feature blocks of different scales. The front and back dimensions and channels of the feature blocks remain unchanged after passing through the CA attention module. After the CA Block, the number of channels is adjusted by convolution again. The output of the IFC module is obtained through the following formula: According to the basic structure of U-Lite, the processed multi-scale feature information is fused with the corresponding Decoder feature information block to obtain the fused feature information. Through the above process, IFC passes the deepest feature information up layer by layer. Each shallow feature contains the feature information of the deeper layer from the sublayer. Finally, the corresponding IFC output multi-scale feature information is passed to the Decoder module of U-Lite to complete the segmentation function. The segmentation module outputs a segmentation value Mask of a specified size. pre .

7. The method for industrial defect detection based on feature information reconstruction of multi-dimensional feature fusion according to claim 6 is characterized in that: The segmentation network optimizes segmentation training using focal loss and L1 loss; Mask pre and anomalyMask GT Linear sampling is performed to the same size, where i and j represent the xy coordinates of the image: p ij =Mask GT (i,j)×Mask pre (i,j)+[1-Mask GT (i,j)]×[1-Mask pre (i,j)] Among them, γ is a hyperparameter; p ij is the linear sampling result; L focal is the focal loss; L l1 is L1 loss; The training of the segmentation network is completed through the two loss functions of focal loss and L1 loss. The segmentation network model finally outputs a mask that shows the classification of the detected sample pixels.

Citation Information

Patent Citations

  • Knowledge-driven software defect detection and analysis method and system

    CN113434418A

  • Storage-enhanced unsupervised spectrum anomaly detection method, system, device and medium

    CN113572539A

  • Transform-based industrial defect detection and identification method

    CN114332007A

  • Industrial scene unknown type defect segmentation method based on self-supervised heterogeneous network

    CN114742799A

  • Unknown type defect detection method and device based on efficient student network

    CN115641474A

Cited By

  • Temperature control method and system for Chinese food cooking based on multi-modal characterization recognition

    CN119902580A

  • Industrial anomaly detection method based on normal feature guidance

    CN120088192A

  • An industrial anomaly detection method based on normal feature guidance

    CN120088192B