Multi-scale knowledge distillation workpiece identification method based on meta-learning

Through the multi-scale knowledge distillation method based on meta-learning, the problem of large models in deep learning methods being difficult to deploy on terminal devices is solved, achieving efficient workpiece recognition efficiency and reduced model deployment, and improving the recognition accuracy and adaptability of the model. .

CN118762277APending Publication Date: 2024-10-11HARBIN UNIV OF SCI & TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410727558.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Current deep learning methods in workpiece recognition are difficult to deploy large models on terminal devices and suffer from insufficient computing power.

Method used

A multi-scale knowledge distillation method based on meta-learning is adopted, using the pre-trained ResNet34 network as the teacher model and the EfficientNet V2 network as the student model. Through cross-entropy loss and feature selective fitting strategy, knowledge distillation is performed to improve the compressibility and compression of the model. Generalization capabilities enable reduced deployment of models.

Benefits of technology

Efficient workpiece recognition efficiency is achieved, and the function of deploying large models on terminal devices improves the recognition accuracy and adaptability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004879137500000021
    Figure BDA0004879137500000021
  • Figure BDA0004879137500000031
    Figure BDA0004879137500000031
  • Figure BDA0004879137500000032
    Figure BDA0004879137500000032
Patent Text Reader

Abstract

The invention relates to a multi-scale knowledge distillation workpiece identification method based on meta-learning, and the method comprises the key steps: selecting a pre-trained ResNet34 network as a teacher model, carrying out the deduction of each sample in a training set through employing the teacher model, and generating a soft label. Afterwards, an OfficientNet V2 network is used as a student model for training, and in order to enable students to better learn the characteristics of teachers, a meta-learning strategy is adopted, and the knowledge transfer ability of the teachers in the whole distillation process is improved by means of feedback of the progress of the students. Generally speaking, the method can call the function of the large model and deploy the large model to the terminal equipment, and can significantly improve the accuracy and speed of workpiece identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of deep learning, and specifically relates to a multi-scale knowledge distillation artifact recognition method based on meta-learning. Background Art

[0002] Artifact recognition plays a vital role in industrial production. It realizes the functions of automatic detection, classification and quality control in industrial automation production by recognizing the shape, color, texture and other features of the artifact. Traditional artifact recognition methods are usually based on image processing technology and machine learning algorithms, and identify artifacts through manually designed feature extractors or trained classifiers. However, these methods are often limited by the expressiveness and generalization capabilities of features, and are difficult to cope with the diversity and complexity of artifact shapes and sizes.

[0003] In recent years, with the rise of deep learning technology, artifact recognition methods based on deep neural networks have gradually attracted attention. These methods use models such as deep convolutional neural networks (CNNs) to directly learn the feature representation of artifacts from raw image data, and achieve end-to-end recognition of artifacts. Compared with traditional methods, deep learning methods have stronger feature learning and generalization capabilities, and can better adapt to the diversity and complexity of artifacts. However, current deep learning methods still face some challenges in processing artifact recognition. Now large models are getting larger, while the computing power of terminal application scenarios has not increased every year. Therefore, how to call the functions of large models and find ways to make the models smaller so that they can be deployed on terminal devices has become a research hotspot in the current field of artifact recognition. Summary of the invention

[0004] The purpose of the implementation of the present invention is to provide a multi-scale knowledge distillation artifact recognition method based on meta-learning that can be deployed on a terminal device and has high artifact recognition efficiency.

[0005] To achieve the above object, the technical solution adopted by the present invention is characterized by comprising the following steps:

[0006] Step S1: Collect workpiece photos and design multi-scale tasks;

[0007] Step S2: Select the pre-trained ResNet34 network as the teacher model, use the teacher model to infer each sample in the training set, and the output probability distribution is q ψ , i.e. soft label;

[0008] Step S3: Use the EfficientNet V2 network as the student model, and the output probability distribution is p θ ;

[0009] Step S4: Perform meta-learning-based knowledge distillation and use the feedback from students’ progress to improve the teacher’s knowledge transfer ability throughout the distillation process;

[0010] Step S5: Minimize q ψ With p θ The cross entropy loss of

[0011] Step S6: Use the test set to evaluate the performance of the trained model;

[0012] Step S7: using the finally obtained model to perform artifact recognition on multi-scale artifacts.

[0013] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, step S1 specifically includes the following steps:

[0014] Step S11: In the data preprocessing stage, firstly, the obtained images are screened to remove blurred images and images with poor quality; secondly, the workpiece images are enhanced by performing data enhancement, such as horizontal flipping, vertical flipping, adding Gaussian noise and Gaussian filtering, etc., to increase the amount of data. The more data sets there are, the better the generalization ability and recognition accuracy of the model can be;

[0015] Step S12: In the task division stage, the generated workpiece image data set is divided into multiple scale tasks of small size, medium size and large size according to the scale range and shape characteristics of the workpiece;

[0016] Step S13: 80% of the total data set is randomly selected as the training set, 10% is used as the validation set, and the remaining 10% is used as the test set.

[0017] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, step S2 specifically includes the following steps:

[0018] Set the distillation temperature T to let the teacher model generate soft labels for the student model.

[0019] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, step S3 specifically includes the following steps:

[0020] The student model is trained using the soft labels output by the teacher model.

[0021] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, step S4 specifically includes the following steps:

[0022] First, the student learns from the teacher: given an input x, the teacher q ψ Generate conditional class distribution q ψ (x) to train students. The input x does not need any manual label. (x,qψ (x)) This distribution is used as the supervisory signal corresponding to the sample. Its parameters are updated through the back propagation of cross entropy loss. The SGD optimizer is selected for training with a learning rate of η. The parameter update is:

[0023]

[0024] The teacher then learns from the student’s validation loss and after the student updates its parameters, it uses the cross entropy loss L CE (y val ,p θ(t+1) (x val )) In the validation dataset (x val ,y val ) to evaluate the new parameter θ (t+1) , use the validation set to evaluate the performance of the student model and use the function loss of the student model on the validation set as feedback for the teacher model’s knowledge transfer teaching. The cross entropy loss function is:

[0025]

[0026] At the same time, use the existing labeled data (x, y) to calculate the cross entropy loss The loss function is:

[0027]

[0028]

[0029] Among them, z i is the true label value of the i-th category; C is the total number of categories; The Softmax value of the student model on the i-th category without setting the distillation temperature.

[0030] A feature selective fitting strategy is selected for multi-scale classification, and the purpose of feature selective fitting is achieved by multiplying a weight coefficient.

[0031] For the evaluation model, the model can be evaluated based on the accuracy, precision, recall, F1-score and other evaluation indicators according to the trained student model. The calculation formula is as follows:

[0032]

[0033]

[0034]

[0035]

[0036] Among them, TP (true positive) is the number of positive samples accurately identified; TN (true negative) is the number of negative samples accurately identified; FP (false positive) is the number of negative samples not accurately identified; FN (false negative) is the number of positive samples not accurately identified; the accuracy rate P is used to evaluate the accuracy of the prediction in prediction; the recall rate R is used to evaluate whether the prediction is complete; F1 is the harmonic mean of precision and recall. The larger the F1, the higher the model quality.

[0037] Set the range of accuracy values. If the accuracy value is less than the set range, continue training; if the accuracy value is greater than the set range, save the weights for artifact classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is an overall flow chart provided by an embodiment of the present invention.

[0039] Figure 2 It is a block diagram of a knowledge distillation method based on meta-learning provided in an embodiment of the present invention.

[0040] Figure 3 It is a feature fitting strategy diagram provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and examples.

[0042] The present invention provides a multi-scale knowledge distillation artifact recognition method based on meta-learning, comprising the following steps:

[0043] Step S1: Collect workpiece photos and design multi-scale tasks;

[0044] Step S2: Select the pre-trained ResNet34 network as the teacher model, use the teacher model to infer each sample in the training set, and the output probability distribution is q ψ , i.e. soft label;

[0045] Step S3: Use the EfficientNet V2 network as the student model, and the output probability distribution is p θ ;

[0046] Step S4: Perform meta-learning-based knowledge distillation and use the feedback from students’ progress to improve the teacher’s knowledge transfer ability throughout the distillation process;

[0047] Step S5: Minimize q ψ With p θ The cross entropy loss of

[0048] Step S6: Use the test set to evaluate the performance of the trained model;

[0049] Step S7: using the finally obtained model to perform artifact recognition on multi-scale artifacts.

[0050] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, step S1 specifically includes the following steps:

[0051] Step S11: In the data preprocessing stage, firstly, the obtained images are screened to remove blurred images and images with poor quality; secondly, the workpiece images are enhanced by performing data enhancement, such as horizontal flipping, vertical flipping, adding Gaussian noise and Gaussian filtering, etc., to increase the amount of data. The more data sets there are, the better the generalization ability and recognition accuracy of the model can be;

[0052] Step S12: In the task division stage, the generated workpiece image data set is divided into multiple scale tasks of small size, medium size and large size according to the scale range and shape characteristics of the workpiece;

[0053] Step S13: 80% of the total data set is randomly selected as the training set, 10% is used as the validation set, and the remaining 10% is used as the test set.

[0054] In the above-mentioned meta-learning-based multi-scale knowledge distillation artifact recognition method, in step S2, the teacher model extracts local features of the artifact image through a series of convolutional layers and pooling layers, and then integrates the information of all feature maps through a global pooling operation in the last layer to obtain a global feature vector of a fixed length. This global feature vector can capture the overall features of the artifact image.

[0055] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, in step S2, as Figure 1 As shown, the distillation temperature T is set to generate soft labels, and the teacher model Softmax function is introduced. The function is as follows:

[0056]

[0057] Among them, z c is the cth element of the input vector; T is the distillation temperature; exp(·) represents e raised to the power of x.

[0058] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, in step S3, as Figure 1 As shown, the student model is trained with the soft labels output by the teacher model, and the distillation loss is:

[0059] L distill =-∑ i qψ (x)log(p θ )

[0060] Among them, L distill is the distillation loss; q ψ is the probability distribution of soft labels from the teacher model; p θ is the predicted probability distribution from the student model; i is the index of the class.

[0061] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, step S4 specifically includes the following steps:

[0062] Step S41: The student learns from the teacher.

[0063] Step S42: The teacher learns from the student’s validation loss.

[0064] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, in step S41, as Figure 2 As shown, given an input x, the teacher q ψ Generate conditional class distribution q ψ (x) to train students. The input x does not need any manual label. (x,q ψ (x)) This distribution is used as the supervisory signal corresponding to the sample. Its parameters are updated through the back propagation of cross entropy loss. The SGD optimizer is selected for training with a learning rate of η. The parameter update is:

[0065]

[0066] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, in step S42, as Figure 2 As shown, after the student updates the parameters, the cross entropy loss L is used CE (y val ,p θ(t+1) (x val )) In the validation dataset (x val ,y val ) to evaluate the new parameter θ (t+1) , use the validation set to evaluate the performance of the student model and use the function loss of the student model on the validation set as feedback for the teacher model’s knowledge transfer teaching. In this way, the teacher model can modify the knowledge it transfers to the student model in real time according to the training status of the student model.

[0067] The cross entropy loss function is:

[0068]

[0069] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, in step S42, L CE (y val ,p θ(t+1) (x val )) is calculated using the updated student network, but it is the teacher network that is updated, and the loss on the validation set is a function of the teacher network.

[0070] In the above-mentioned meta-learning-based multi-scale knowledge distillation artifact recognition method, in step S4, a stronger supervision signal is introduced at the same time, and the cross entropy loss is calculated using the existing labeled data (x, y) The loss function is:

[0071]

[0072]

[0073] In the above formula: z i is the true label value of the i-th category; C is the total number of categories; The Softmax value of the student model on the i-th category without setting the distillation temperature.

[0074] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, in step S4, it is very necessary for the student model to selectively learn knowledge information from the teacher model according to different categories, because not all feature knowledge from the teacher model needs to be fully learned by the student model. Figure 3 As shown, the present invention selects a feature selective fitting strategy for multi-scale classification, and achieves the purpose of feature selective fitting by multiplying a weight coefficient.

[0075] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, in step S4, selecting the feature selective fitting strategy specifically includes the following steps:

[0076] Step 1: Perform feature selection on the teacher model to filter out features that are useful for the student model;

[0077] Step 2: Based on the selected features, a fitting strategy is developed to ensure that the student model can effectively use these features for learning;

[0078] Step 3: During the training process, dynamically adjust the feature selective fitting strategy based on the model’s feedback and performance indicators to optimize the predictive performance of the student model.

[0079] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, in step S5, minimize q ψ With pθ The cross entropy loss is:

[0080]

[0081] In the above-mentioned multi-scale knowledge distillation artifact recognition method based on meta-learning, in step S6, the test set is input into the trained model for performance evaluation. If it meets the actual classification requirements, the final classification model is obtained. Otherwise, knowledge distillation learning and training are continued until the required performance indicators are met.

[0082] For the evaluation model, the model can be evaluated based on the accuracy, precision, recall, F1-score and other evaluation indicators according to the trained student model. The calculation formula is as follows:

[0083]

[0084]

[0085]

[0086]

[0087] Among them, TP (true positive) is the number of positive samples accurately identified; TN (true negative) is the number of negative samples accurately identified; FP (false positive) is the number of negative samples not accurately identified; FN (false negative) is the number of positive samples not accurately identified; the accuracy rate P is used to evaluate the accuracy of the prediction in prediction; the recall rate R is used to evaluate whether the prediction is complete; F1 is the harmonic mean of precision and recall. The larger the F1, the higher the model quality.

[0088] In the above-mentioned meta-learning-based multi-scale knowledge distillation artifact recognition method, in step S7, the artifact image is classified using the final model to obtain the artifact image classification result.

[0089] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A multi-scale knowledge distillation artifact recognition method based on meta-learning, characterized in that: The method specifically comprises the following steps: Step S1: Collect workpiece photos and design multi-scale tasks; Step S2: Select the pre-trained ResNet34 network as the teacher model, use the teacher model to infer each sample in the training set, and the output probability distribution is q ψ , i.e. soft label; Step S3: Use the EfficientNet V2 network as the student model, and the output probability distribution is p θ ; Step S4: Perform meta-learning-based knowledge distillation and use the feedback from students’ progress to improve the teacher’s knowledge transfer ability throughout the distillation process; Step S5: Minimize q ψ With p θ The cross entropy loss of Step S6: Using the finally obtained model, perform artifact recognition on multi-scale artifacts.

2. According to the meta-learning-based multi-scale knowledge distillation artifact recognition method of claim 1, it is characterized in that: In step S2, the teacher model ResNet34 is a deep convolutional neural network, which first has a 7*7 convolution layer + batch normalization + ReLU activation function, and then a 3*3 maximum pooling layer, which is composed of multiple residual blocks in the middle, and each residual block contains two convolution layers and an identity mapping. Finally, after the global average pooling layer and the fully connected layer, the feature vector is mapped to the category label. The teacher model extracts local features of the artifact image through a series of convolutional layers and pooling layers, and then integrates the information of all feature maps through a global pooling operation in the last layer. Soft labels are probability distributions generated by the teacher model to describe the characteristics of the input data. They contain more information and knowledge, helping the student model learn the decision-making process and feature representation of the teacher model.

3. According to the multi-scale knowledge distillation artifact recognition method based on meta-learning in claim 1, it is characterized in that: In step S3, the student model EfficientNet V2 is a lightweight neural network model, which mainly uses the MBConv module and the Fused-MBConv module, and the activation function uses the SILU activation function. The student model is trained using the soft labels output by the teacher model.

4. According to the multi-scale knowledge distillation artifact recognition method based on meta-learning in claim 1, it is characterized in that: In step S4, the knowledge distillation based on meta-learning is trained by the following method: First, students learn from teachers. The learning process is as follows: Given an input x, the teacher q ψ Generate conditional class distribution q ψ (x) to train students. The input x does not need any manual label. (x,q ψ (x)) This distribution is used as the supervisory signal corresponding to the sample. Its parameters are updated through the back propagation of cross entropy loss. The SGD optimizer is selected for training with a learning rate of η. The parameter update is: i (t+1) =θ (t) -η▽ θ L CE (q ψ (x),p θ (x))| θ(t) The teacher then learns from the student’s validation loss and the learning process is as follows: After the student updates the parameters, the cross entropy loss L is used CE (y val ,p θ(t+1) (x val )) In the validation dataset (x val ,y val ) to evaluate the new parameter θ (t+1) , use the validation set to evaluate the performance of the student model and use the function loss of the student model on the validation set as feedback for the teacher model’s knowledge transfer teaching. The cross entropy loss function is: L CE (y val ,p θ(t+1) (x val ))=R(θ (t+1) )=R(θ (t) -η▽ θ L CE (q ψ (x),p θ (x))| θ(t) ) At the same time, use the existing labeled data (x, y) to calculate the cross entropy loss The loss function is: Among them, z i is the true label value of the i-th category; C is the total number of categories; The Softmax value of the student model on the i-th category without setting the distillation temperature.

5. According to the meta-learning-based multi-scale knowledge distillation artifact recognition method of claim 1, it is characterized in that: In step S4, the meta-learning-based knowledge distillation artifact recognition method performs multi-scale classification by selecting a feature selective fitting strategy. The feature selective fitting strategy achieves the purpose of feature selective fitting by multiplying a weight coefficient.

Citation Information

Cited By

  • Calligraphy work evaluation method based on residual network and expert knowledge distillation

    CN119323798A