Defect Detection Method and System Based on Differential Enhancement and Adaptive Meta-Learning

By employing differential enhancement and adaptive meta-learning methods to automatically adjust hyperparameters and combining them with the YOLO network for training, the problems of traditional methods struggling to identify complex defects and the high cost of deep learning are solved, achieving efficient and accurate defect detection.

CN118333988BActive Publication Date: 2026-06-30HEFEI GUOXUAN HIGH TECH POWER ENERGY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HEFEI GUOXUAN HIGH TECH POWER ENERGY
Filing Date
2024-04-23
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Traditional defect detection techniques rely on prior knowledge and manual feature engineering, making it difficult to identify complex and varied defects. Furthermore, deep learning methods require a large number of manually labeled samples and hyperparameter adjustments, resulting in high costs, poor robustness, and difficulty in adapting to new types of defects and scenarios.

Method used

By employing differential enhancement and adaptive meta-learning methods, the model is automatically adjusted by predicting hyperparameters through an adaptive meta-learning network and then trained in conjunction with a differential enhancement YOLO network, achieving efficient defect detection.

Benefits of technology

It improves the accuracy and generalization performance of defect detection, enables efficient training with few samples, adapts to different tasks, and achieves better defect detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118333988B_ABST
    Figure CN118333988B_ABST
Patent Text Reader

Abstract

This invention discloses a defect detection method and system based on differential enhancement and adaptive meta-learning. The method includes: using a set of hyperparameters obtained through an adaptive meta-learning network model as training parameters for a differential enhancement YOLO network of the intra-task model, training it on a meta-task training set, generating prediction results on a meta-task test set, calculating meta-loss, and optimizing the training of the adaptive meta-learning network model; inputting the hyperparameters of the target task into the trained adaptive meta-learning network model, and using the obtained hyperparameters to train the differential enhancement defect detection model; inputting the image to be detected into the trained differential enhancement defect detection model to obtain the defect detection result. This invention enables automated hyperparameter adjustment, ensuring the model adapts to the task, effectively distinguishing defects with similar features, improving defect detection accuracy, and achieving efficient training even with a small dataset, ultimately producing excellent defect detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of defect detection technology, specifically relating to a defect detection method and system based on differential enhancement and adaptive meta-learning. Background Technology

[0002] In industrial production and manufacturing processes, the presence of defects can lead to product non-conformity, increased production costs, and reduced customer satisfaction. Therefore, accurate and efficient detection of these defects can help trace the root causes of problems and enable targeted improvement measures. Defect detection is a complex task, requiring systems capable of accurately locating and classifying defects based on various factors such as their shape, size, location, and relationship to the surrounding environment.

[0003] Traditional defect detection techniques typically rely on prior knowledge and manual feature engineering, which limits the model's ability to identify complex and variable defects. Template matching methods identify and classify defects in images by comparing them to predefined templates; statistical model-based methods utilize statistical analysis to describe and classify defect characteristics such as size, shape, and texture; and frequency domain analysis techniques identify defects by analyzing the frequency characteristics of images. While these methods perform well in certain scenarios, their performance is highly dependent on specific algorithm and model selection, and often requires significant manual intervention and adjustments. If the data distribution or problem changes, the algorithm may need to be redesigned and optimized. Furthermore, traditional methods lack flexibility and scalability when facing new or unseen defect types or scenarios, making it difficult to accurately identify complex and ever-changing defects.

[0004] With the rapid advancement of deep learning technology, neural network-based defect detection methods have gradually demonstrated their powerful potential. These methods can automatically learn and extract key features from images, thereby achieving accurate detection of complex and varied defects. For example, convolutional neural networks (CNNs) can capture subtle details and texture differences in defects, while recurrent neural networks (RNNs) are suitable for processing temporal defect data. Furthermore, advanced architectures such as Transformers and attention mechanisms have been introduced into defect detection, further improving accuracy and robustness. However, deep learning-based methods typically require manual tuning of hyperparameters, making it difficult to find the ideal combination from numerous parameter options; deep learning methods rely on a large number of manually labeled samples for training, which is costly; and they suffer from lower detection accuracy and limited ability to distinguish similar classes. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a defect detection method and system based on differential enhancement and adaptive meta-learning. This method and system can achieve automated hyperparameter adjustment, ensure that the model adapts to the task, effectively distinguish defects with similar features, improve the accuracy of defect detection, and achieve efficient training even with a small dataset, ultimately producing excellent defect detection results.

[0006] This invention provides the following technical solution:

[0007] Firstly, a defect detection method based on differential enhancement and adaptive meta-learning is provided, including:

[0008] The hyperparameters to be predicted and related features are input into the adaptive meta-learning network model to predict a set of hyperparameters.

[0009] The predicted hyperparameters are used as training parameters for the differential enhancement YOLO network of the intra-task model, and trained on the meta-task training set to obtain the trained intra-task model.

[0010] The trained intra-task model generates prediction results on the meta-task test set and the intra-loss is calculated.

[0011] The meta-loss is calculated based on the internal loss, and the meta-loss is used to optimize the adaptive meta-learning network model, resulting in the trained adaptive meta-learning network model.

[0012] The hyperparameters and relevant features of the target task are input into the trained adaptive meta-learning network model to obtain a set of hyperparameters that are conducive to training. The differential enhancement defect detection model is trained using this set of hyperparameters to obtain the trained differential enhancement defect detection model.

[0013] The image to be detected is input into the trained differential enhancement defect detection model to obtain the defect detection results.

[0014] Furthermore, the method for predicting a set of hyperparameters through the adaptive meta-learning network model includes: inputting the hyperparameters to be predicted and related features into the adaptive meta-learning network model, extracting features through three convolutional layers, calculating the importance of different features through an attention mechanism, automatically adjusting the model's sensitivity to different hyperparameters and related features, and finally obtaining a set of hyperparameters through a fully connected layer.

[0015] Furthermore, the method of using the predicted hyperparameters as training parameters for the differential enhancement YOLO network of the intra-task model and training it on the meta-task training set includes:

[0016] A YOLO network is used as the backbone of a feature extractor to automatically learn features on the training set of the meta-task.

[0017] Differential feature enhancement is performed on the feature images obtained by automatic learning, and then layer-by-layer predictive analysis is performed to obtain defect detection results.

[0018] Furthermore, the method for enhancing the differential features includes:

[0019] The correlation between the features of a pixel and the features of its neighbors is explored on the feature image obtained by automatic learning, resulting in a dissimilarity matrix and a dissimilarity loss. The formula for calculating the dissimilarity loss between two pixels is as follows:

[0020] ;

[0021] In the formula, It is a pixel. i and j The difference loss of the corresponding features, i It is the pixel position index in the feature map. i ∈[1, n ], n It is the number of pixels in the feature image. j yes i Pixel position index within the neighborhood, j ∈[1, ], It involves selecting the number of neighboring points; the specific value is learned and predicted by the meta-learning task. and yes i , j The corresponding features, and It corresponds to the category of the label at this point. The hyperparameters describing the feature distance are specifically learned and predicted by the meta-task.

[0022] The total difference loss is obtained by overlaying the difference loss of each pixel in the feature image:

[0023] ;

[0024] In the formula, It is the total difference loss;

[0025] The original features are weighted and enhanced using a difference matrix to obtain a weight matrix, calculated as follows:

[0026] ;

[0027] In the formula, m i j It is a feature map m exist Features and Similarity of features These are learnable hyperparameters. W i j It is a weight matrix W The value at the corresponding coordinates W The importance of each feature is described.

[0028] Furthermore, the internal loss includes location loss, confidence loss, classification loss, and total variance loss;

[0029] The formula for calculating the position loss is as follows:

[0030] + ;

[0031] In the formula, It's a position loss. s² It is the number of grid cells. B It is the number of bounding boxes. d It is a cell index. f It is the bounding box index. Indicates the first d The first cell f The bounding box is assigned a value of 1 if it contains an object, and 0 otherwise. and These are the center coordinates of the actual bounding box. and These are the predicted center coordinates of the bounding box. and These are the actual bounding box width and height. and It predicts the width and height of the bounding box;

[0032] The formula for calculating the confidence loss is as follows:

[0033] ;

[0034] In the formula, It is confidence loss. It is the confidence score of the actual bounding box. It is the confidence score for predicting the bounding box;

[0035] The formula for calculating the classification loss is as follows:

[0036] ;

[0037] In the formula, It is classification loss. This indicates whether the center of any object falls within the grid. classes It is the total number of categories. It is the first d The cells are c The probability of a class It is the first d The predicted unit multiple is c The probability of a class;

[0038] The formula for calculating the internal loss is:

[0039] L = + + + ;

[0040] In the formula, L It is an internal loss. It is the total difference loss. , , and These are classification losses Confidence loss Location loss Total difference loss Harmonized weights.

[0041] Furthermore, the meta-task training set includes multiple different defect detection task data training sets.

[0042] Furthermore, the meta-task test set includes multiple test sets matched with different defect detection task data training sets.

[0043] Furthermore, the meta-loss is the sum of the intrinsic losses on all meta-task test sets, calculated using the following formula:

[0044] Loss = ;

[0045] In the formula, Loss It is a loss. L k It is the first k Intrinsic loss on each test set, splits This is the number of test sets.

[0046] Secondly, a defect detection system based on differential enhancement and adaptive meta-learning is provided, including:

[0047] The adaptive meta-learning network module is used to input the hyperparameters to be predicted and related features into the adaptive meta-learning network model to predict a set of hyperparameters.

[0048] The inner task module is used to use the predicted hyperparameters as training parameters for the differential enhancement YOLO network of the inner task model, and train it on the meta-task training set to obtain the trained inner task model; then the trained inner task model is used to generate prediction results on the meta-task test set and the inner loss is calculated.

[0049] The model optimization module is used to calculate the meta-loss based on the inner loss and to optimize the adaptive meta-learning network model using the meta-loss, thereby obtaining the trained adaptive meta-learning network model.

[0050] The differential enhancement defect detection model training module is used to input the hyperparameters and related features of the target task into the trained adaptive meta-learning network model to obtain a set of hyperparameters that are conducive to training. The differential enhancement defect detection model is trained using this set of hyperparameters to obtain the trained differential enhancement defect detection model.

[0051] The detection module is used to input the image to be detected into the trained differential enhancement defect detection model to obtain the defect detection results.

[0052] Furthermore, the internal task module includes a feature extraction module, a difference enhancement module, a prediction module, and an internal loss module;

[0053] The feature extraction module is used to automatically learn features on the meta-task training set by using a YOLO network as the backbone of a feature extractor.

[0054] The difference enhancement module is used to enhance the difference features of the feature images obtained by automatic learning;

[0055] The prediction module is used to perform layer-by-layer prediction analysis on the image after the difference features are enhanced to obtain the defect detection results;

[0056] The internal loss module is used to calculate the meta-loss, including the location loss module, confidence loss module, classification loss module, and total difference loss module.

[0057] Compared with the prior art, the beneficial effects of the present invention are:

[0058] This invention predicts a set of hyperparameters by inputting the hyperparameters to be predicted and related features into an adaptive meta-learning network model. These predicted hyperparameters are then used as training parameters for a differential enhancement YOLO network within the intra-task model and trained on a meta-task training set, resulting in a trained intra-task model. The trained intra-task model is then used to generate prediction results on a meta-task test set, and the intra-loss is calculated. The meta-loss is then calculated and used to optimize the adaptive meta-learning network model, updating its parameters. This process is repeated until the loss function converges, resulting in a trained adaptive meta-learning network model. By learning the common features and variation patterns of multiple tasks, the meta-learning algorithm can discover similarities and connections between different tasks, thereby achieving knowledge transfer and sharing across different domains. This leads to more general feature representations and model structures, ultimately achieving more efficient learning on new tasks and improving the model's generalization performance. This invention uses the hyperparameters and related features of a differential enhancement defect detection model as input. A set of hyperparameters is obtained through a trained adaptive meta-learning network model. These hyperparameters are then used to train the differential enhancement defect detection model, resulting in a trained model. The image to be detected is then input into this trained model to obtain the defect detection result. Therefore, the method provided by this invention can achieve automated hyperparameter adjustment, learn common features and variation patterns across multiple tasks, and infer more general feature representations and model structures. This leads to better generalization performance on the target task (i.e., the final defect detection task), ensuring the model adapts to the target task. Furthermore, it learns highly discriminative feature representations, effectively distinguishing defects with similar features and improving defect detection accuracy. Even with a small dataset, efficient training is achieved, ultimately producing excellent defect detection results. Attached Figure Description

[0059] Figure 1 This is a flowchart illustrating the defect detection method based on differential enhancement and adaptive meta-learning in an embodiment of the present invention.

[0060] Figure 2 This is a flowchart illustrating the differential feature enhancement method in an embodiment of the present invention;

[0061] Figure 3 This is a schematic diagram of the internal task module in an embodiment of the present invention. Detailed Implementation

[0062] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.

[0063] Example 1

[0064] like Figure 1As shown, this embodiment provides a defect detection method based on differential enhancement and adaptive meta-learning, with the following steps:

[0065] Step 1: Input the hyperparameters to be predicted and relevant features into the adaptive meta-learning network model to predict a set of hyperparameters. The specific method is as follows:

[0066] The hyperparameters to be predicted (e.g., batch size, learning rate, learning rate decay) and related features are input into the adaptive meta-learning network model. After feature extraction through three convolutional layers, the importance of different features is calculated through the attention mechanism, and the sensitivity of the model to different hyperparameters and related features is automatically adjusted. Finally, a set of hyperparameters is obtained through a fully connected layer.

[0067] Step 2: Use the predicted hyperparameters as training parameters for the differential enhancement YOLO network of the intra-task model, and train it on the meta-task training set to obtain the trained intra-task model. The meta-task training set includes training sets of multiple different defect detection task data. The specific method is as follows:

[0068] Step 2.1: Use the YOLO network as the backbone to form a feature extractor to automatically learn features on the meta-task training set.

[0069] Step 2.2: Perform differential feature enhancement on the feature images obtained by automatic learning, and then perform layer-by-layer predictive analysis to obtain defect detection results.

[0070] Among them, such as Figure 2 As shown, the method for enhancing differential features includes:

[0071] (1) Explore the correlation between the features of a pixel and the features of nearby pixels on the feature image obtained by automatic learning, and obtain the difference matrix and difference loss. The formula for calculating the difference loss between two pixels is as follows:

[0072] ;

[0073] In the formula, It is a pixel. i and j The difference loss of the corresponding features, i It is the pixel position index in the feature map. i ∈[1, n ], n It is the number of pixels in the feature image. j yes i The pixel coordinate index within the neighborhood, j∈[1, ], It involves selecting the number of neighboring points; the specific value is learned and predicted by the meta-learning task. and yes i , j The corresponding features, and It corresponds to the category of the label at this point. The hyperparameter describing the feature distance is specifically learned and predicted by the meta-task.

[0074] (2) The total difference loss is obtained by superimposing the difference loss of each pixel in the feature image:

[0075] ;

[0076] In the formula, It is the total difference loss.

[0077] (3) The original features are weighted and enhanced by the difference matrix, thereby reducing the correlation between features of the same class and increasing the difference between features of different classes. The difference loss function learns a better feature representation through the backpropagation supervision network. The weight matrix for weighting the original features is calculated as follows:

[0078] ;

[0079] In the formula, m i j It is a feature map m exist Features and Similarity of features These are learnable hyperparameters. W i j It is a weight matrix W The value at the corresponding coordinates W The importance of each feature is described.

[0080] Step 3: Generate prediction results on the trained intrinsic task model on the meta-task test set and calculate the intrinsic loss. The meta-task test set includes multiple test sets matched with training sets for different defect detection tasks.

[0081] Internal losses include location loss, confidence loss, classification loss, and total variance loss.

[0082] The formula for calculating the position loss is as follows:

[0083] + ;

[0084] In the formula, It's a position loss. s² It is the number of grid cells. B It is the number of bounding boxes.d It is a cell index. f It is the bounding box index. Indicates the first d The first cell f The bounding box is assigned a value of 1 if it contains an object, and 0 otherwise. and These are the center coordinates of the actual bounding box. and These are the predicted center coordinates of the bounding box. and These are the actual bounding box width and height. and It predicts the width and height of the bounding box.

[0085] The formula for calculating the confidence loss is as follows:

[0086] ;

[0087] In the formula, It is confidence loss. It is the confidence score of the actual bounding box. It is the confidence score for predicting the bounding box.

[0088] The formula for calculating the classification loss is as follows:

[0089] ;

[0090] In the formula, It is classification loss. This indicates whether the center of any object falls within the grid. classes It is the total number of categories. It is the first d The cells are c The probability of a class It is the first d The predicted unit multiple is c Class probability.

[0091] Ultimately, the inner loss is the sum of the four loss functions mentioned above, with a harmonic weight preceding each loss function. γ The settings can be configured according to the actual situation or learned from the meta-task. The formula for calculating the internal loss is:

[0092] L = + + + ;

[0093] In the formula, L It is an internal loss. , , and These are classification losses Confidence loss Location loss Total difference loss Harmonized weights.

[0094] Step 4: Calculate the meta-loss based on the intrinsic loss, and use the meta-loss to optimize the adaptive meta-learning network model until the loss function converges, thus obtaining the trained adaptive meta-learning network model.

[0095] The meta-loss is the sum of the intrinsic losses on all meta-task test sets, and the calculation formula is as follows:

[0096] Loss = ;

[0097] In the formula, Loss It is a loss. L k It is the first k Intrinsic loss on each test set, splits This is the number of test sets.

[0098] Step 5: Using the hyperparameters and relevant features of the target task as input, a set of hyperparameters that are beneficial for training is obtained through the trained adaptive meta-learning network model. The hyperparameters are then used to train the differential enhancement defect detection model to obtain the trained differential enhancement defect detection model.

[0099] Step 6: Input the image to be detected into the trained differential enhancement defect detection model, and output the defect detection result.

[0100] Example 2

[0101] This embodiment provides a defect detection system based on differential enhancement and adaptive meta-learning, used to implement the defect detection method based on differential enhancement and adaptive meta-learning described in Embodiment 1, specifically including:

[0102] The adaptive meta-learning network module is used to input the hyperparameters to be predicted and related features into the adaptive meta-learning network model to predict a set of hyperparameters.

[0103] The inner task module is used to use the predicted hyperparameters as training parameters for the differential enhancement YOLO network of the inner task model, and train it on the meta-task training set to obtain the trained inner task model; then the trained inner task model is used to generate prediction results on the meta-task test set and the inner loss is calculated.

[0104] The model optimization module is used to calculate the meta-loss based on the inner loss and to optimize the adaptive meta-learning network model using the meta-loss until the loss function converges, thus obtaining the trained adaptive meta-learning network model.

[0105] The differential enhancement defect detection model training module is used to input the hyperparameters and related features of the target task into the trained adaptive meta-learning network model to obtain a set of hyperparameters that are conducive to training. The differential enhancement defect detection model is trained using this set of hyperparameters to obtain the trained differential enhancement defect detection model.

[0106] The detection module is used to input the image to be detected into the trained differential enhancement defect detection model to obtain the defect detection results.

[0107] like Figure 3 As shown, the internal task module includes a feature extraction module, a difference enhancement module, a prediction module, and an internal loss module, used to implement steps 2 and 3 in Embodiment 1. The feature extraction module uses a YOLO network as the backbone to automatically learn features on the meta-task training set; the difference enhancement module enhances the automatically learned feature images with difference features; the prediction module performs layer-by-layer prediction analysis on the images with enhanced difference features to obtain defect detection results; the internal loss module calculates the meta-loss based on the defect detection results, the ground truth label, and the difference feature enhancement module, including a location loss module, a confidence loss module, a classification loss module, and a total difference loss module.

[0108] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0109] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0110] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0111] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0112] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A defect detection method based on differential enhancement and adaptive meta-learning, characterized in that, include: The hyperparameters to be predicted and related features are input into the adaptive meta-learning network model to predict a set of hyperparameters. The predicted hyperparameters are used as training parameters for the differential enhancement YOLO network of the intra-task model, and trained on the meta-task training set to obtain the trained intra-task model. The trained intra-task model generates prediction results on the meta-task test set and the intra-loss is calculated. The meta-loss is calculated based on the internal loss, and the meta-loss is used to optimize the adaptive meta-learning network model, resulting in the trained adaptive meta-learning network model. The hyperparameters and relevant features of the target task are input into the trained adaptive meta-learning network model to obtain a set of hyperparameters that are conducive to training. The differential enhancement defect detection model is trained using this set of hyperparameters to obtain the trained differential enhancement defect detection model. The image to be detected is input into the trained differential enhancement defect detection model to obtain the defect detection results.

2. The defect detection method based on differential enhancement and adaptive meta-learning according to claim 1, characterized in that, The method for predicting a set of hyperparameters through the adaptive meta-learning network model includes: inputting the hyperparameters to be predicted and related features into the adaptive meta-learning network model, extracting features through three convolutional layers, calculating the importance of different features through an attention mechanism, automatically adjusting the model's sensitivity to different hyperparameters and related features, and finally obtaining a set of hyperparameters through a fully connected layer.

3. The defect detection method based on differential enhancement and adaptive meta-learning according to claim 1, characterized in that, The method of using the predicted hyperparameters as training parameters for the differential enhancement YOLO network of the intra-task model and training it on the meta-task training set includes: A YOLO network is used as the backbone of a feature extractor to automatically learn features on the training set of the meta-task. Differential feature enhancement is performed on the feature images obtained by automatic learning, and then layer-by-layer predictive analysis is performed to obtain defect detection results.

4. The defect detection method based on differential enhancement and adaptive meta-learning according to claim 3, characterized in that, The methods for enhancing the differential features include: The correlation between the features of a pixel and the features of its neighbors is explored on the feature image obtained by automatic learning, resulting in a dissimilarity matrix and a dissimilarity loss. The formula for calculating the dissimilarity loss between two pixels is as follows: ; In the formula, It is a pixel. i and j The difference loss of the corresponding features, i It is the pixel position index in the feature map. i ∈[1, n ], n It is the number of pixels in the feature image. j yes i Pixel position index within the neighborhood, j ∈[1, ], It involves selecting the number of neighboring points; the specific value is learned and predicted by the meta-learning task. and yes i , j The corresponding features, and It corresponds to the category of the label at this point. The hyperparameters describing the feature distance are specifically learned and predicted by the meta-task. The total difference loss is obtained by overlaying the difference loss of each pixel in the feature image: ; In the formula, It is the total difference loss; The original features are weighted and enhanced using a difference matrix to obtain a weight matrix, calculated as follows: ; In the formula, m i j It is a feature map m exist Features and Similarity of features These are learnable hyperparameters. W i j It is a weight matrix W The value at the corresponding coordinates W The importance of each feature is described.

5. The defect detection method based on differential enhancement and adaptive meta-learning according to claim 1, characterized in that, The internal loss includes location loss, confidence loss, classification loss, and total difference loss; The formula for calculating the position loss is as follows: + ; In the formula, It's a position loss. s² It is the number of grid cells. B It is the number of bounding boxes. d It is a cell index. f It is the bounding box index. Indicates the first d The first cell f The bounding box is set to 1 if it contains an object, and 0 otherwise. and These are the center coordinates of the actual bounding box. and These are the predicted center coordinates of the bounding box. and These are the actual bounding box width and height. and It predicts the width and height of the bounding box; The formula for calculating the confidence loss is as follows: ; In the formula, It is confidence loss. It is the confidence score of the actual bounding box. It is the confidence score for predicting the bounding box; The formula for calculating the classification loss is as follows: ; In the formula, It is classification loss. This indicates whether the center of any object falls within the grid. classes It is the total number of categories. It is the first d The cells are c The probability of a class It is the first d The predicted unit multiple is c The probability of a class; The formula for calculating the internal loss is: L = + + + ; In the formula, L It is an internal loss. It is the total difference loss. , , and These are classification losses Confidence loss Location loss Total difference loss Harmonized weights.

6. The defect detection method based on differential enhancement and adaptive meta-learning according to claim 1, characterized in that, The meta-task training set includes multiple different defect detection task data training sets.

7. The defect detection method based on differential enhancement and adaptive meta-learning according to claim 6, characterized in that, The meta-task test set includes multiple test sets that are matched with training sets of different defect detection task data.

8. The defect detection method based on differential enhancement and adaptive meta-learning according to claim 7, characterized in that, The meta-loss is the sum of the intrinsic losses on all meta-task test sets, and the calculation formula is as follows: Loss = ; In the formula, Loss It is a loss. L k It is the first k Intrinsic loss on each test set, splits This is the number of test sets.

9. A defect detection system based on differential enhancement and adaptive meta-learning, characterized in that, include: The adaptive meta-learning network module is used to input the hyperparameters to be predicted and related features into the adaptive meta-learning network model to predict a set of hyperparameters. The inner task module is used to use the predicted hyperparameters as training parameters for the differential enhancement YOLO network of the inner task model, and train it on the meta-task training set to obtain the trained inner task model; then the trained inner task model is used to generate prediction results on the meta-task test set and the inner loss is calculated. The model optimization module is used to calculate the meta-loss based on the inner loss and to optimize the adaptive meta-learning network model using the meta-loss, thereby obtaining the trained adaptive meta-learning network model. The differential enhancement defect detection model training module is used to input the hyperparameters and related features of the target task into the trained adaptive meta-learning network model to obtain a set of hyperparameters that are conducive to training. The differential enhancement defect detection model is trained using this set of hyperparameters to obtain the trained differential enhancement defect detection model. The detection module is used to input the image to be detected into the trained differential enhancement defect detection model to obtain the defect detection results.

10. The defect detection system based on differential enhancement and adaptive meta-learning according to claim 9, characterized in that, The internal task module includes a feature extraction module, a differential enhancement module, a prediction module, and an internal loss module; The feature extraction module is used to automatically learn features on the meta-task training set by using a YOLO network as the backbone of a feature extractor. The difference enhancement module is used to enhance the difference features of the feature images obtained by automatic learning; The prediction module is used to perform layer-by-layer prediction analysis on the image after the difference features are enhanced to obtain the defect detection results; The internal loss module is used to calculate the meta-loss, including the location loss module, confidence loss module, classification loss module, and total difference loss module.