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

By constructing a teacher-student network architecture and an adaptive weight module, and optimizing the initialization parameters of the student network, the problem of long training time in unsupervised anomaly detection methods is solved, achieving fast convergence and efficient anomaly detection results.

CN115641474BActive Publication Date: 2026-01-06HUAZHONG UNIV OF SCI & TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211295955.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-21
Publication Date
2026-01-06
Estimated Expiration
2042-10-21

AI Technical Summary

Technical Problem

Existing unsupervised anomaly detection methods take too long to train models, making it difficult to meet the needs of rapid deployment. Furthermore, existing efficient learning methods are not specifically designed for anomaly detection tasks.

Method used

A teacher-student network architecture is constructed. By pre-training a ResNet18 network and K-means clustering, combined with an adaptive weight module and a feature fusion module, and utilizing multi-task learning and attention mechanisms, the initialization parameters of the student network are optimized to achieve fast convergence.

Benefits of technology

In anomaly detection tasks, pre-trained models can converge quickly with only a small number of samples, improving the model's generalization ability and detection performance on new types of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115641474B_ABST
    Figure CN115641474B_ABST
Patent Text Reader

Abstract

This invention discloses a method for detecting unknown types of defects based on an efficient student network. The method includes the following steps: A pre-training method is proposed, which updates the student network parameters on a third-party dataset by minimizing the average loss of each category of data, resulting in an initial student network model with strong generalization ability. Subsequently, based on the above training strategy, an adaptive weight module and a classification network are added to the network to assist in training, using multi-task learning and attention mechanisms, thereby improving the performance of the pre-trained model on anomaly detection tasks. Using the initial model obtained by the method proposed in this invention, when training on different new types of data in subsequent anomaly detection tasks, only a small number of samples are needed to achieve rapid convergence, and good anomaly detection results are achieved in the testing phase. This invention also provides a corresponding device for detecting unknown types of defects based on an efficient student network.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of computer vision, and more particularly relates to an unknown type defect detection method and device based on an efficient student network. BACKGROUND

[0002] With the rapid development of China's economy and the improvement of the level of science and technology, the anomaly detection technology plays an increasingly important role in the practical application fields such as industrial quality inspection and video monitoring. In the field of industrial quality inspection, the anomaly detection technology not only can reduce economic losses, but also can ensure the safety of users. Because there are problems such as lack of abnormal samples in the anomaly detection scene, the unsupervised anomaly detection algorithm using only normal samples for training is the mainstream method in this field.

[0003] In the unsupervised anomaly detection method, there are methods based on image similarity and methods based on feature similarity. The method based on image similarity includes the method based on image reconstruction and the method based on image restoration, and the method based on feature similarity includes the deep one-class classification method, the method based on template matching and the method based on teacher-student network. The teacher-student network is an excellent unsupervised anomaly detection algorithm at present. However, in the actual anomaly detection task, the training sample of the method needs to be more than 200 when training the model, and the training time is more than 2 hours, which is difficult to meet the demand of quickly deploying the model to new application scenarios. In order to improve the learning efficiency of the model, there are many methods for efficient learning of the model. In this method, the design is mainly considered from the aspects of model fine-tuning, transfer learning and meta-learning. However, most of the existing methods are for relatively simple tasks such as image classification, and there is no special design for anomaly detection tasks. SUMMARY

[0004] In view of the above defects or improvement needs of the prior art, the present application provides an unknown type defect detection method based on an efficient student network.

[0005] To achieve the above purpose, according to one aspect of the present application, an unknown type defect detection method based on an efficient student network is provided, comprising the following steps:

[0006] Step S1, constructing a teacher network (1), preparing a pre-trained ResNet18 network on the ImageNet dataset, and randomly cropping the images in the ImageNet to image blocks with a preset side length, inputting the image blocks into the teacher network (1) and the pre-trained ResNet18 network at the same time, constraining the output features of the teacher network (1) to be the same as the output features of the pre-trained ResNet18 network, and fixing the parameters of the teacher network (1) in the subsequent steps;

[0007] Step S2, the MSRA 10K dataset is divided into N coarse groups by using the K-means clustering algorithm, the structural similarity distance of the samples to the center features is calculated in each coarse group, the M samples closest to the distance center are reserved, and a dataset (2) containing N categories is constructed accordingly, wherein M and N are preset values;

[0008] Step S3, a pre-training network (3) is constructed, the pre-training network (3) comprises a student network (4), an adaptive weight module, a feature fusion module and a classification module, wherein the adaptive weight module provides different weights for different layer features of the student network (4), the feature fusion module multiplies the different layer features of the student network with the corresponding weights and then performs feature fusion, and then the fused features are input into the classification module, and the classification module outputs a classification label;

[0009] Step S4, the pre-training network (3) is trained, first, each category of data in the dataset (2) is divided into training samples (5) and validation samples (6), the training samples (5) are input into the pre-training network (3), first, the features extracted by the student network (4) on the training samples (5) are constrained to be the same as the features extracted by the teacher network (1), then the intermediate layer output features and the final output features of the student network (4) are respectively subjected to the adaptive weight module, and the features of different layers are multiplied with the corresponding weights and input into the feature fusion module, the fused features are input into the classification module, the category of the features is predicted, then, the pre-training network (3) after being trained on the validation samples (6) is used to calculate a loss function, and the loss function is fed back to update the parameters of the pre-training network (3) before being input into the training samples (5) for updating;

[0010] Step S5, in the training stage of the anomaly detection task, training samples (7) are prepared and input into the student network (4), wherein the initial parameters of the student network (4) are the parameters of the student network (4) after being trained in step S4, then the features extracted by the student network (4) on the training samples (7) are constrained to be the same as the features extracted by the teacher network (1).

[0011] Step S6, in the test stage, test samples (8) containing abnormal regions are input into the teacher network (1) and the student network (4) at the same time, the distance between the feature maps extracted by the two is calculated in the feature space by using an anomaly score function (9), an anomaly score map is obtained, then the anomaly score map is binarized by setting a threshold, and the output of this stage is obtained.

[0012] In an embodiment of the present application, the network structure of the student network (4) in the pre-training network (3) is a full convolution structure, the output size of the last layer of the network is H1xW1xC1, and the output size of the intermediate layer is H2xW2xC1, wherein H1, W1, C1, H2, W2 and C2 are preset values.

[0013] In one embodiment of the present application, the adaptive weight module of the pre-trained network (3) gives an adaptive weight to the intermediate layer feature and the last layer output feature of the student network (4) respectively, which specifically includes:

[0014] Step S3-1, using 3x3 convolution to down-sample the size of the intermediate layer output feature of the student network H and W are preset values;

[0015] Step S3-2, the feature map obtained in step 3-1 is subjected to a global average pooling layer, a fully connected layer and a Sigmoid operation to obtain the weight ω0 corresponding to the feature;

[0016] Step S3-3, using 3x3 convolution to down-sample the size of the last layer output feature of the student network

[0017] Step S3-4, the feature map obtained in step 3-3 is subjected to a global average pooling layer, a fully connected layer and a Sigmoid operation to obtain the weight ω1 corresponding to the feature.

[0018] In one embodiment of the present application, the feature fusion module of the pre-trained network (3) is used to fuse the weighted intermediate layer feature and the last layer output feature of the student network (4), which specifically includes:

[0019] Step S3-5, multiplying the intermediate layer feature of the student network (4) with the weight ω0 corresponding to step S3-2;

[0020] Step S3-6, multiplying the last layer output feature of the student network (4) with the weight ω0 corresponding to step S3-4;

[0021] Step S3-7, stacking the features obtained in steps S3-5 and S3-6 in the channel dimension

[0022] In one embodiment of the present application, the classification module of the pre-trained network (3) is used to predict the fused feature as a class label, which specifically includes:

[0023] Step S3-8, inputting the feature in step S3-7 into 3 3x3 convolution layers to increase the dimension of the feature C2 is a preset value, and ReLu is used for activation;

[0024] Step S3-9, inputting the feature in step S3-8 into an average pooling layer, a fully connected layer, and using a Sigmoid function to activate to obtain the classification label.

[0025] In one embodiment of the present invention, when training the pre-trained network (3), in order to ensure that the features extracted by the student network (4) and the features extracted by the teacher network (1) are consistent on the samples, the optimized objective function (10) is:

[0026]

[0027] Among them, S θ (x) represents the feature map output by the training sample (7) through the student network (4), T θ (x) represents the feature map output by the teacher network (1) of the training sample (7), μ and σ represent the mean and standard deviation of the features obtained by the teacher network on the entire training set, respectively, and diag(σ) -1 This represents the inverse matrix of a diagonal matrix filled with the value of σ. This indicates the calculation of the L2 distance.

[0028] In one embodiment of the present invention, during the training phase of the pre-trained network (3), the cross-entropy loss (11) is used as follows:

[0029]

[0030] Where CE(·) represents the cross-entropy loss, N represents the number of sample classes, and p i Represents the truth label, q i This represents the predicted label after the fused features have passed through a classification network.

[0031] In one embodiment of the present invention, the overall optimization objective function (12) is a weighted sum of objective function (10) and objective function (11), as follows:

[0032] L(S θ (x))=Loss st +λLoss cls

[0033] Loss st For the regression loss function of the student network, Loss cls Let λ be the loss function used to classify features extracted from the student network, and let λ be the weight that balances the two loss functions. Let λ be a preset value.

[0034] In one embodiment of the present invention, during the training phase of the pre-trained network (3), the dataset (2) is divided into N categories, and the image groups of each category are respectively Each model update task is performed on the image group. 2K different samples are randomly selected, of which K are used as training samples (5) and K are used as validation samples (6), where K is a preset value. The parameters of the model are updated on the training samples (5), and the overall optimization objective function (12) is calculated on the training samples (6) using the model with updated parameters. Before the pre-trained network (3) is updated, the parameters of the student network before the update are obtained. The parameters of the network before the update are updated on the training samples (5) of each model update task, resulting in N student network models. The network then updates its parameters after a set of samples (13). The overall optimization objective function (12) is calculated on the validation samples (6) of the corresponding tasks using these N models. Finally, the parameters of the network before the update are updated by minimizing the sum of these N loss functions, which are the updated parameters of the student network pre-trained model (14).

[0035] According to another aspect of the present invention, an unknown type defect detection device based on an efficient student network is also provided, including at least one processor and a memory, wherein the at least one processor and the memory are connected via a data bus, and the memory stores instructions that can be executed by the at least one processor. After being executed by the processor, the instructions are used to complete the unknown type defect detection method based on an efficient student network.

[0036] In summary, the technical solutions conceived by this invention have the following beneficial effects compared with the prior art:

[0037] (1) In order to enable the model to converge quickly during training on anomaly detection tasks, this invention proposes a pre-training method. This method trains the network by minimizing the average loss on the validation set of each category of data, and updates the student network parameters on a third-party dataset, resulting in an initialized student network model with strong generalization ability. Using the initialized model obtained by this invention, when training on new types of data in anomaly detection tasks, only a small number of samples are needed to achieve rapid convergence, and then the anomaly detection task can be completed.

[0038] (2) Based on the above training strategy, this invention adds an adaptive weight module and a classification network to assist student network training through the idea of ​​multi-task learning and attention mechanism, thereby improving the performance of the pre-trained model on the anomaly detection task. Attached Figure Description

[0039] Figure 1 This is a flowchart of the pre-training process for the unknown type defect detection method based on an efficient student network provided by the present invention.

[0040] Figure 2 This is a flowchart of the training and testing process of the unknown type defect detection method based on an efficient student network provided by the present invention. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0042] This invention provides a method for detecting unknown types of defects based on an efficient student network, such as... Figure 1 and Figure 2 As shown, it includes the following steps:

[0043] Step S1: Construct the teacher network (1). Prepare a ResNet18 network pre-trained on the ImageNet dataset. Randomly crop images from ImageNet into image patches with a preset side length (e.g., 17). Input the image patches into both the teacher network (1) and the pre-trained ResNet18 network. Constrain the output features of the teacher network (1) to be the same as the output features of the pre-trained ResNet18 network. In subsequent steps, the parameters of the teacher network (1) are fixed.

[0044] Step S2: Using the K-means clustering algorithm on the MSRA10K dataset, the dataset is divided into N coarse groups. In each coarse group, the structural similarity distance from the sample to the central feature is calculated, and the M samples closest to the center are retained. Based on this, a dataset containing N categories is constructed (2).

[0045] Step S3: Construct the pre-trained network (3). The pre-trained network (3) consists of a student network (4), an adaptive weight module, a feature fusion module, and a classification module. The adaptive weight module provides different weights for the features of different layers of the student network (4). The feature fusion module multiplies the features of different layers of the student network with their corresponding weights and then performs feature fusion. The fused features are then input into the classification module, which outputs the classification labels.

[0046] Step S4: Train the pre-trained network (3). First, divide each class of data in the dataset (2) into training samples (5) and validation samples (6). Input the training samples (5) into the pre-trained network (3). First, constrain the features extracted by the student network (4) on the training samples (5) to be the same as the features extracted by the teacher network (1). Then, pass the intermediate layer output features and the final output features of the student network (4) through the adaptive weight module, and multiply the features of different layers with the corresponding weights and input them into the feature fusion module. Input the fused features into the classification module to predict the category of the features. Then, calculate the loss function of the pre-trained network (3) after training on the validation samples (6) and backfeed the loss function to update the parameters of the pre-trained network (3) before it is updated by inputting the training samples (5).

[0047] Step S5: During the training phase of the anomaly detection task, training samples (7) are prepared and input into the student network (4). At this time, the initialization parameters of the student network (4) are the same as those of the student network (4) after training in step S4. Subsequently, the features extracted by the student network (4) on the training samples (7) are constrained to be the same as those extracted by the teacher network (1).

[0048] Step S6, Testing Phase. The test samples (8) containing abnormal regions are simultaneously input into the teacher network (1) and the student network (4). The distance between the feature maps extracted by the two networks in the feature space is calculated using the abnormality scoring function (9) to obtain the abnormality scoring map. Then, the abnormality scoring map is binarized by setting a threshold to obtain the output of this phase.

[0049] Preferably, the network structure of the student network (4) in the pre-trained network (3) is a fully convolutional structure, with the output size of the last layer of the network being H1×W1×C1 and the output size of the intermediate layers being H2×W2×C1.

[0050] Preferably, the adaptive weight module of the pre-trained network (3) assigns an adaptive weight to the intermediate layer features and the last layer output features of the student network (4), specifically including:

[0051] Step S3-1: Use a 3×3 convolution to downsample the size of the output features of the intermediate layer of the student network. H and W are preset values.

[0052] Step S3-2: The feature map obtained in step 3-1 is processed through a global average pooling layer, a fully connected layer, and a Sigmoid operation to obtain the weight ω0 corresponding to the feature.

[0053] Step S3-3: Use a 3×3 convolution to downsample the size of the output features of the last layer of the student network. H and W are preset values.

[0054] Step S3-4: The feature map obtained in step 3-3 is processed through a global average pooling layer, a fully connected layer, and a Sigmoid operation to obtain the weight ω1 corresponding to the feature.

[0055] Preferably, the feature fusion module of the pre-trained network (3) is used to fuse the intermediate layer features and the output features of the last layer of the weighted student network (4), specifically including:

[0056] Step S3-5: Multiply the intermediate layer features of the student network (4) with the corresponding weights ω0 in step S3-2.

[0057] Step S3-6: Multiply the last layer output feature of the student network (4) with the corresponding weight ω0 in step S3-4.

[0058] Step S3-7: Stack the features obtained in steps S3-5 and S3-6 along the channel dimension.

[0059] Preferably, the classification module of the pre-trained network (3) is used to predict the fused features as a category label, specifically including:

[0060] Step S3-8: Input the features from step S3-7 into three 3×3 convolutional layers to increase the dimensionality of the features. C2 is the default value, and ReLU is used for activation.

[0061] Step S3-9: Input the features from step S3-8 into an average pooling layer and a fully connected layer, and activate them using the Sigmoid function to obtain the classification label.

[0062] Preferably, when training the pre-training network (3), in order to ensure that the features extracted by the student network (4) and the features extracted by the teacher network (1) are consistent on the samples, the optimized objective function (10) is:

[0063]

[0064] Among them, S θ (x) represents the feature map output by the training sample (7) through the student network (4), T θ (x) represents the feature map output by the teacher network (1) of the training sample (7), μ and σ represent the mean and standard deviation of the features obtained by the teacher network on the entire training set, respectively, and diag(σ) -1 This represents the inverse matrix of a diagonal matrix filled with the value of σ. This indicates the calculation of the L2 distance.

[0065] Preferably, during the training phase of the pre-trained network (3), in order to enable the classification network to output the correct classification label, the present invention uses the cross-entropy loss (11) as follows:

[0066]

[0067] Where CE(·) represents the cross-entropy loss, N represents the number of sample classes, and p i Represents the truth label, q i This represents the predicted label after the fused features have passed through a classification network.

[0068] Preferably, the overall optimization objective function (12) at this stage is the weighted sum of objective function (10) and objective function (11), as follows:

[0069] L(S θ (x))=Loss st +λLoss cls

[0070] Loss st For the regression loss function of the student network, Loss cls Let λ be the loss function used to classify features extracted from the student network, and let λ be the weight that balances the two loss functions, which is a preset value.

[0071] In this stage, the student network parameters are updated using the overall optimization objective function (12).

[0072] Preferably, during the training phase of the pre-trained network (3), the dataset (2) is divided into N categories, with each category containing a set of images. Each model update task is performed on the image group. 2K different samples are randomly selected, of which K are used as training samples (5) and the other K are used as validation samples (6). The parameters of the model are updated on the training samples (5), and the overall optimization objective function (12) is calculated on the training samples (6) using the model with updated parameters. Before updating the pre-trained network (3), the parameters of the student network before the update are obtained. In this invention, the parameters of the network before the update are updated on the training samples (5) of each model update task to obtain N student network models. The network then updates its parameters (13) after a set of samples. The overall optimization objective function (12) is calculated on the validation samples (6) of the corresponding tasks using these N models. Finally, the parameters of the network before the update are updated by minimizing the sum of these N loss functions, which are the updated parameters of the student network pre-trained model (14).

[0073] Preferably, during the training phase of the anomaly detection task, training samples (7) are prepared and input into the student network (4). At this time, the initialization parameters of the student network (4) are the same as those of the student network (4) after training in step S4. Subsequently, the features extracted by the student network (4) on the training samples (7) are constrained to be the same as those extracted by the teacher network (1), and the objective function for optimization is objective function (10).

[0074] Preferably, during the testing phase, the present invention simultaneously inputs test samples (8) containing abnormal regions into both the teacher network (1) and the student network (4). The distance between the extracted feature maps of the two networks in the feature space is calculated using an anomaly scoring function (9). The anomaly scoring function (9) is:

[0075]

[0076] in The feature vector representing the characteristics of the student network is located at (r, c). The feature vector representing the teacher network at (r, c) is given by μ and σ, where μ and σ represent the teacher network features F, respectively. T The mean and standard deviation of the features are obtained on the training set, where diag(σ) -1 This represents the inverse of a diagonal matrix filled with the value of σ.

[0077] An anomaly score map is obtained, and then binarized by setting a threshold to obtain the binary segmentation result for this stage. Furthermore, to obtain the binary segmentation result, it is also necessary to set an appropriate threshold for binarization of the anomaly score map.

[0078] This invention proposes a method for detecting unknown types of defects based on an efficient student network. The method first proposes a pre-training approach. This approach updates the student network parameters on a third-party dataset by minimizing the average loss across different data categories, resulting in an initial student network model with strong generalization capabilities. Subsequently, based on the above training strategy, this invention incorporates an adaptive weight module and a classification network to assist in the training of the student network, using multi-task learning and attention mechanisms. This improves the performance of the pre-trained model on anomaly detection tasks. Using the initial model obtained through the proposed method, in subsequent anomaly detection tasks, when training with different new types of data, rapid convergence can be achieved using only a small number of samples, and good anomaly detection results are achieved in the testing phase.

[0079] Furthermore, the present invention also provides an unknown type defect detection device based on an efficient student network, including at least one processor and a memory, wherein the at least one processor and the memory are connected via a data bus, and the memory stores instructions that can be executed by the at least one processor. After being executed by the processor, the instructions are used to complete the unknown type defect detection method based on an efficient student network.

[0080] Those skilled in the art will readily understand that the above description is merely 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 within the scope of protection of the present invention.

Claims

1. A method for unknown type defect detection based on efficient student network, characterized in that, Comprise the following steps: Step S1, constructing a teacher network (1), preparing a pre-trained ResNet18 network on the ImageNet dataset, and randomly cropping the images in ImageNet into image blocks with a preset side length, inputting the image blocks into the teacher network (1) and the pre-trained ResNet18 network, and constraining the output features of the teacher network (1) to be the same as the output features of the pre-trained ResNet18 network, and the parameters of the teacher network (1) are fixed in the subsequent steps; Step S2, using the K-means clustering algorithm on the MSRA10K dataset, dividing the dataset into N coarse groups, calculating the structural similarity distance of the samples to the center features in each coarse group, retaining the M samples closest to the center, and constructing a dataset (2) containing N categories according to the above, wherein M and N are preset values; Step S3, constructing a pre-training network (3), the pre-training network (3) is composed of a student network (4), an adaptive weight module, a feature fusion module and a classification module, wherein the adaptive weight module provides different weights for different layer features of the student network (4), the feature fusion module multiplies the different layer features of the student network with the corresponding weights and then performs feature fusion, and then inputs the fused features into the classification module, and the classification module outputs the classification label; Step S4, training the pre-training network (3), first dividing each class of data in the dataset (2) into training samples (5) and validation samples (6), inputting the training samples (5) into the pre-training network (3), first constraining the features extracted by the student network (4) on the training samples (5) to be the same as the features extracted by the teacher network (1), then the intermediate layer output features and the final output features of the student network (4) are respectively subjected to the adaptive weight module, and the different layer features and the corresponding weights are multiplied and input into the feature fusion module, the fused features are input into the classification module, the class of the features is predicted, then the pre-training network (3) after completing the training is used to calculate the loss function on the validation samples (6), and the loss function is back-propagated to update the parameters of the pre-training network (3) before inputting the training samples (5) for updating; Step S5, in the training stage of the anomaly detection task, preparing training samples (7) and inputting them into the student network (4), wherein the initialization parameters of the student network (4) are the parameters of the student network (4) after completing the training in step S4, and then the features extracted by the student network (4) on the training samples (7) are constrained to be the same as the features extracted by the teacher network (1); Step S6, the test stage, inputting the test sample (8) containing the abnormal region into the teacher network (1) and the student network (4) at the same time, calculating the distance between the feature maps extracted by the two in the feature space through the anomaly score function (9), obtaining the anomaly score map, and then binarizing the anomaly score map by setting a threshold to obtain the output of this stage.

2. The high-efficiency student network-based unknown-type defect detection method of claim 1, wherein, The network structure of the student network (4) in the pre-training network (3) is a full convolution structure, and the output size of the last layer of the network is H1xW1xC1, and the output size of the intermediate layer is H2xW2xC1, wherein H1, W1, C1, H2, W2, and C2 are preset values. 3.The high-efficiency student network-based unknown-type defect detection method of claim 1 or 2, wherein, The adaptive weight module of the pre-training network (3) gives an adaptive weight to the intermediate layer feature and the output feature of the last layer of the student network (4), specifically including: Step S3-1, using 3x3 convolution to down-sample the size of the student network intermediate layer output features H and W are preset values; Step S3-2, the feature map obtained in step 3-1 is subjected to a global average pooling layer, a fully connected layer, and a Sigmoid operation to obtain the weight ω0 corresponding to the feature; Step S3-3, down-sampling the size of the output features of the last layer of the student network using a 3x3 convolution Step S3-4, the feature map obtained in step 3-3 is subjected to a global average pooling layer, a fully connected layer, and a Sigmoid operation to obtain the weight ω1 corresponding to the feature.

4. The high-efficiency student network-based unknown-type defect detection method of claim 1 or 2, wherein, The feature fusion module of the pre-training network (3) is used to fuse the weighted intermediate layer feature and the output feature of the last layer of the student network (4), specifically including: Step S3-5, the intermediate layer feature of the student network (4) is multiplied by the weight ω0 corresponding to step S3-2; Step S3-6, the output feature of the last layer of the student network (4) is multiplied by the weight ω0 corresponding to step S3-4; Step S3-7, stacking the features obtained from Step S3-5 and Step S3-6 in the channel dimension 5. The high-efficiency student network-based unknown-type defect detection method according to claim 1 or 2, characterized by, The classification module of the pre-training network (3) is used to predict the fused feature as a class label, specifically including: Step S3-8, input the features in step S3-7 into 3 3x3 convolution layers, and upgrade the dimensions of the features C2 is a preset value, and is activated using ReLu Step S3-9, the feature in step S3-8 is input into an average pooling layer, a fully connected layer, and activated using a Sigmoid function to obtain a classification label.

6. The high-efficiency student network-based unknown-type defect detection method of claim 1 or 2, wherein, When training the pre-training network (3), in order to constrain the features extracted by the student network (4) and the features extracted by the teacher network (1) to be consistent on the sample, the objective function (10) is: where S θ (x) denotes the feature map output by the student network (4) for the training sample (7), T θ (x) denotes the feature map output by the teacher network (1) for the training sample (7), μ and σ denote the mean and standard deviation of the features obtained by the teacher network over the entire training set, diag(σ) -1 denotes the inverse of the diagonal matrix filled with the values of σ, denotes the computation of the L2 distance.

7. The high-efficiency student network-based unknown-type defect detection method of claim 1 or 2, wherein, In the training stage of the pre-training network (3), the cross-entropy loss (11) is: where CE(·) denotes the cross-entropy loss, N denotes the number of sample classes, p i denotes the true value label, q i denotes the predicted label after the fusion feature passes through the classification network.

8. The high-efficiency student network-based unknown-type defect detection method of claim 1 or 2, wherein, The total optimization objective function (12) is the weighted sum of the objective function (10) and the objective function (11), which is: L(S θ (x)) = Loss st + λLoss cls where Loss st is the regression loss function of the student network, Loss cls is the loss function of classifying the features extracted by the student network, and λ is the weight balancing the two loss functions, and λ is a preset value. 9.The high-efficiency student network-based unknown-type defect detection method of claim 1 or 2, wherein, In the training stage of the pre-trained network (3), the data set (2) is divided into N categories, and each category of image groups is respectively Each model update task randomly selects 2K different samples from the image group , where K is the preset value, updates the parameters of the model on the training samples (5), and calculates the total optimization objective function (12) on the training samples (6) using the model after the parameter update. Before updating the pre-trained network (3), the parameters of the student network before updating are first obtained, and the parameters of the student network before updating are updated on the training samples (5) of each model update task to obtain N student network models. At this time, the network update parameters (13) are obtained, and the N models are used to calculate the total optimization objective function (12) on the corresponding task validation samples (6), and finally the parameters before updating are updated by minimizing the sum of the N loss functions to update the student network pre-trained model parameters (14).

10. An unknown type defect detection device based on an efficient student network, characterized in that: comprising at least one processor and a memory, the at least one processor and the memory are connected through a data bus, the memory stores instructions executable by the at least one processor, and the instructions are used to complete the unknown type defect detection method based on the efficient student network in any one of claims 1-9 after being executed by the processor.