A few-sample object classification method and apparatus based on imitation learning

By using imitation learning methods and training a target classification model with base class task sample sets and target task sample sets, the problem of poor classification performance in small sample training is solved, and the stability and accuracy of the model are improved, especially in the fields of military target recognition and component defect recognition.

CN114595743BActive Publication Date: 2026-01-30INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210061198.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2026-01-30
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

Existing machine learning classification methods based on few-sample training suffer from poor classification performance, especially in the fields of military target recognition, component defect recognition, and fine-grained target recognition, where stability, accuracy, and generalization are insufficient.

Method used

The imitation learning method is adopted to obtain pre-training parameters and network tuning parameters through imitation learning of the base class task sample set and the target task sample set, and to train the target classification model, including task imitation learning and sample imitation learning, so as to improve the accuracy of the model parameters.

Benefits of technology

It improves the stability, accuracy, and generalization of the classification model under small sample conditions, thereby enhancing the classification performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114595743B_ABST
    Figure CN114595743B_ABST
Patent Text Reader

Abstract

This invention provides a few-shot target classification method and apparatus based on imitation learning. The method includes: acquiring samples to be classified; inputting the samples to be classified into a target classification model, and acquiring the classification result output by the target classification model; wherein the target classification model is trained based on pre-trained parameters obtained through imitation learning from a base class task sample set, network tuning parameters, and a target task sample set. Through task imitation learning and sample imitation learning, the accuracy of the model parameters is improved, thereby enhancing the stability, accuracy, and generalization of few-shot classification, and improving the performance of the classification model under few-shot conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning technology, and in particular to a few-sample target classification method and apparatus based on imitation learning. Background Technology

[0002] With the development of machine learning technology, it has permeated almost every application field. However, in some fields, there is often a difficulty in obtaining samples, requiring the training of classification models based on a small number of samples or even just a few samples. For example, in the field of military target recognition, most military targets are limited in number and usually belong to the enemy system, making it very difficult to obtain samples of them in typical scenarios. In the field of component defect recognition, high-end components typically have a high pass rate, but the number of defective components is small and the defect types are complex and diverse, resulting in extremely scarce samples for each defect type. In the field of fine-grained target recognition, as target categories become increasingly refined, the number of samples belonging to each sub-category gradually decreases, making accurate labeling increasingly difficult, and so on.

[0003] Existing machine learning classification methods based on small sample training suffer from poor classification performance, and the corresponding classification models also have considerable deficiencies in terms of stability, accuracy, and generalization. Summary of the Invention

[0004] This invention provides a few-shot target classification method and apparatus based on imitation learning, which solves the problem of poor classification performance of existing machine learning classification methods based on few-shot training, and improves the stability, accuracy and generalization of few-shot classification.

[0005] This invention provides a few-shot target classification method based on imitation learning, comprising:

[0006] Obtain the sample to be classified;

[0007] Input the sample to be classified into the target classification model and obtain the classification result output by the target classification model;

[0008] The target classification model is trained using pre-trained parameters obtained by imitation learning from the base class task sample set, network optimization parameters, and the target task sample set.

[0009] According to the present invention, a few-shot target classification method based on imitation learning is provided, wherein the target classification model is trained based on pre-training parameters obtained by imitation learning from a base class task sample set, network tuning parameters, and a target task sample set, including:

[0010] Obtain the base class task sample set, the target task sample set, and the classification model;

[0011] Based on the base class task sample set, the number of tasks in the target task sample set is used for imitation learning and the classification model is trained to obtain the pre-trained classification model and pre-trained model parameters.

[0012] Based on the base class task sample set, the number of tasks and samples in the target task sample set are used for imitation learning, and the pre-trained classification model is trained to obtain network tuning parameters.

[0013] The classification model is trained based on the target task sample set, the pre-training parameters, and the network tuning parameters to obtain the target classification model.

[0014] According to the present invention, a few-shot target classification method based on imitation learning is provided, wherein imitation learning is performed on the number of tasks in the target task sample set and the classification model is trained to obtain a pre-trained classification model and pre-trained model parameters, including:

[0015] Randomly initialize the network parameters of the classification model;

[0016] Based on the number of tasks in the target task sample set, the base class task sample set is randomly sampled multiple times with an equal number of tasks to obtain multiple sub-task sample sets;

[0017] The classification model is trained based on the current subtask sample set to obtain the model parameters corresponding to the current subtask sample set. The network parameters of the classification model are updated based on the model parameters corresponding to the current subtask sample set and the momentum update rule. The next subtask sample set is updated to the current subtask sample set to train the classification model with the updated network parameters, until all subtask sample sets are trained to obtain the pre-trained classification model and pre-trained model parameters.

[0018] According to the present invention, a few-shot target classification method based on imitation learning includes training the classification model based on the current sub-task sample set to obtain the model parameters of the current sub-task sample set, and updating the network parameters of the classification model according to the model parameters of the current sub-task sample set and the momentum update rule, comprising:

[0019] Train the classification model based on the current subtask sample set to obtain the model parameters for the current subtask sample set;

[0020] Wherein, if the current subtask sample set is the first one, the network parameters of the classification model are updated using the model parameters corresponding to the current subtask sample set;

[0021] If the current subtask sample set is not the first one, then the network parameters of the classification model are updated by weighted averaging based on the model parameters corresponding to the current subtask sample set and the model parameters corresponding to the previous subtask sample set.

[0022] According to the present invention, a few-shot target classification method based on imitation learning is provided, wherein imitation learning is performed on the number of tasks and the number of samples in the target task sample set, and the pre-trained classification model is trained to obtain network tuning parameters, including:

[0023] Based on the number of tasks and the number of samples in the target task sample set, the base class task sample set is randomly sampled multiple times with an equal number of tasks and a comparable number of samples to obtain multiple candidate task sample sets;

[0024] For each of the candidate task sample sets, the optimal tuning parameters are obtained by network performance testing. This process is repeated until all of the candidate task sample sets have been processed, resulting in a set of optimal tuning parameters.

[0025] Cluster analysis is performed on the set of winning optimization parameters to obtain the network optimization parameters.

[0026] According to the present invention, a few-shot target classification method based on imitation learning is provided, wherein for each candidate task sample set, the optimal tuning parameters are obtained by network performance testing, including:

[0027] Initialize the network parameters of the classification model corresponding to the candidate task sample set using the pre-trained parameters;

[0028] Based on the experience of optimizing small-sample classification networks, different candidate optimization parameters are obtained;

[0029] The pre-trained model is optimized under different candidate optimization parameter configurations to obtain the model parameters and the class accuracy of the model parameters under different candidate optimization parameter configurations.

[0030] The candidate tuning parameter with the highest accuracy in the category is selected as the winning tuning parameter.

[0031] The present invention also provides a target classification device based on imitation learning, comprising:

[0032] The acquisition module is used to acquire samples to be classified.

[0033] The classification module is used to input the sample to be classified into the target classification model and obtain the classification result output by the target classification model;

[0034] The target classification model is trained using pre-trained parameters obtained by imitation learning from the base class task sample set, network optimization parameters, and the target task sample set.

[0035] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the imitation learning-based few-shot target classification methods described above.

[0036] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the imitation learning-based few-shot target classification method as described above.

[0037] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the imitation learning-based few-shot target classification methods described above.

[0038] The present invention provides a few-shot target classification method and apparatus based on imitation learning. By using a target task sample set, pre-training parameters, and network tuning parameters, a classification model is optimized to obtain a target classification model. Through task imitation learning and sample imitation learning, the accuracy of the model parameters is improved, thereby enhancing the stability, accuracy, and generalization of few-shot classification, and improving the performance of the classification model under few-shot conditions. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0040] Figure 1 This is a flowchart illustrating the few-sample target classification method based on imitation learning provided in an embodiment of the present invention;

[0041] Figure 2 This is a flowchart illustrating the training process of the target classification model provided in an embodiment of the present invention;

[0042] Figure 3 This is a schematic diagram of the architecture of the few-sample target classification method based on imitation learning provided in an embodiment of the present invention;

[0043] Figure 4 This is a schematic diagram of the target classification device based on imitation learning provided in an embodiment of the present invention;

[0044] Figure 5 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0046] The following is combined with Figure 1 This invention describes a few-shot target classification method based on imitation learning, comprising:

[0047] Step 101: Obtain the sample to be classified;

[0048] Step 102: Input the sample to be classified into the target classification model and obtain the classification result output by the target classification model;

[0049] The target classification model is trained using pre-trained parameters obtained by imitation learning from the base class task sample set, network tuning parameters, and the target task sample set.

[0050] The few-shot target classification method based on imitation learning in this embodiment of the invention optimizes the classification model by using a target task sample set, pre-training parameters, and network tuning parameters. Through task imitation learning and sample imitation learning, the accuracy of the model parameters is improved, thereby enhancing the stability, accuracy, and generalization of few-shot classification and improving the performance of the classification model under few-shot conditions.

[0051] It's important to note that the base class task sample set refers to a publicly available dataset of typical classification tasks that can be downloaded from the internet. This dataset contains classification tasks for many types of targets, with each task containing a large number of samples. For example, the ImageNet dataset in image classification contains 1000 target categories (tasks), with over 1000 labeled images (samples) for each category, totaling over ten million samples. The target task sample set, on the other hand, refers to a dedicated dataset collected and labeled to meet specific application needs. This dataset contains classification tasks for a small number of target categories, with each category containing a small number of samples (small sample). For example, in bearing end-face defect recognition applications, the focus is typically on classifying four types of defects—dents, rust, scratches, and size anomalies—against normal samples (five categories in total). Each defect category usually has only 10-100 labeled samples. The classification model is a selected small sample classification model, and the trained parameters can be directly applied to the target domain. For example, in the aforementioned application of bearing end face defect recognition, the classification model includes a feature layer and a classification layer. The feature layer can use ResNet50 to extract 1024-dimensional image features from the defect image, and the classification layer can use a fully connected layer to output 5-dimensional class probabilities.

[0052] In at least one embodiment of the present invention, the aforementioned base task sample set can be obtained through public download. Furthermore, a target task sample set can be obtained as needed.

[0053] In at least one embodiment of the present invention, the target classification model is trained based on pre-trained parameters obtained through imitation learning from the base class task sample set, network optimization parameters, and the target task sample set, such as... Figure 2 As shown, the training method includes:

[0054] Step 201: Obtain the base class task sample set, the target task sample set, and the classification model;

[0055] Step 202: Based on the base class task sample set, perform imitation learning on the number of tasks in the target task sample set and train the classification model to obtain the pre-trained classification model and pre-trained model parameters.

[0056] Step 203: Based on the base class task sample set, perform imitation learning on the number of tasks and samples in the target task sample set and train a pre-trained classification model to obtain network tuning parameters;

[0057] Step 204: Train the classification model based on the target task sample set, pre-training parameters, and network tuning parameters to obtain the target classification model.

[0058] It's important to note that imitation learning includes task imitation learning and sample imitation learning. Task imitation learning trains a neural network model to mimic the scale of the target task, ensuring that the extracted features are adapted to the difficulty of the problem, thereby improving classification performance. For example, in the aforementioned bearing end-face defect recognition application, the task scale is 5. In task imitation learning, 5 sub-tasks are continuously and randomly sampled from the base class task sample set for network training. Sample imitation learning optimizes the neural network model to mimic the sample scale of the target task and analyzes the performance of the optimized network parameters to select an optimization strategy that yields good classification results for a given sample scale. For example, in the aforementioned bearing end-face defect recognition application, assuming the sample size is 10, the preferred optimization strategy is a learning rate of 0.0001, optimizing the last layer; assuming the sample size is 100, the preferred optimization strategy is a learning rate of 0.001, optimizing the last two layers. The purpose of sample imitation learning is to obtain the optimal optimization strategy for the classification network under different sample sizes.

[0059] In at least one embodiment of the present invention, the step of performing imitation learning on the number of tasks in the target task sample set and training the classification model to obtain a pre-trained classification model and pre-trained model parameters includes:

[0060] Step 301: Randomly initialize the network parameters of the classification model;

[0061] Step 302: Based on the number of tasks in the target task sample set, perform multiple random samplings of the base class task sample set with an equal number of tasks to obtain multiple sub-task sample sets;

[0062] It should be noted that the subtask sample set is randomly sampled from the base task sample set, and its number of tasks is equal to that of the target task sample set. For example, in the aforementioned bearing end face defect recognition application, the subtask sample set is randomly sampled from ImageNet, with a task scale of 5 categories, each with more than 1000 labeled images. The subtask sample set has the characteristic of "small tasks and large samples," which ensures that the sampling task is consistent with the target task in scale, and also ensures sufficient training of the model and prevents overfitting.

[0063] Step 302: Train the classification model based on the current subtask sample set to obtain the model parameters corresponding to the current subtask sample set. Update the network parameters of the classification model based on the model parameters corresponding to the current subtask sample set and the momentum update rule.

[0064] Step 304: Update the next subtask sample set with the current subtask sample set to train the classification model with the updated network parameters, until all subtask sample sets have been trained, and obtain the pre-trained classification model and pre-trained model parameters.

[0065] The above steps are continuously executed to randomly sample the base class task sample set with an equal number of tasks based on the number of tasks in the target task sample set, thereby obtaining a sub-task sample set; the classification model is trained based on the sub-task sample set to obtain the model parameters of the current sub-task sample set; the initial model parameters of the next sub-task sample set are obtained based on the model parameters of the current sub-task sample set and the momentum update rule; until the execution count threshold is reached, the pre-trained classification model and pre-trained model parameters are obtained.

[0066] In at least one embodiment of the present invention, a classification model that undergoes momentum update is defined as a momentum classification model, wherein the momentum classification model has the same network structure as the classification model;

[0067] If the current subtask sample set is the first one, then the network parameters of the momentum classification model are initialized using the model parameters of the current subtask sample set;

[0068] If the current subtask sample set is not the first one, then based on the model parameters of the current subtask sample set and the network parameters of the current momentum classification model, the updated network parameters of the momentum classification model are obtained by weighted averaging.

[0069] The network parameters of the momentum classification model are used as the initial model parameters for the sample set of the next subtask.

[0070] It should be noted that momentum update refers to updating the model parameters using a moving average to enhance the stability of the model during training. Momentum update includes the following sub-steps:

[0071] Using the model parameters F from the first subtask sample set 1 Initialize the network parameters E of the classification model 1 ;

[0072] Based on the model parameters of the current subtask sample set and the network parameters of the current classification model, the updated network parameters of the classification model are obtained by weighted averaging, and these are determined as the initial model parameters for the next subtask sample set.

[0073] Here, it is assumed that the model parameters of the current subtask sample set are F. n The model parameters are E n If the forgetting factor is λ, then the momentum update rule can be expressed as formula (1):

[0074] E n+1 =λ·E n +(1-λ)·F n E 1 =F 1 , n=2,3,…N (1)

[0075] Model parameters F based on the current subtask sample set n And the network parameters E of the current classification model n The updated network parameters E of the classification model are obtained using formula (1). n+1 and E n+1 The initial model parameters are determined for the sample set of the next subtask.

[0076] In at least one embodiment of the present invention, the step of performing imitation learning on the number of tasks and samples in the target task sample set and training the pre-trained classification model to obtain network tuning parameters includes:

[0077] Step 601: Based on the number of tasks and the number of samples in the target task sample set, perform multiple random samplings of the base class task sample set with an equal number of tasks and a comparable number of samples to obtain multiple candidate task sample sets;

[0078] It should be noted that the candidate task sample set refers to a set of C randomly selected tasks from the base task sample set, where C is the number of categories in the target task sample set, and K samples are randomly sampled from each task, where K is roughly equal to the number of samples in the target task sample set. For example, in the aforementioned application of bearing end face defect recognition, if each defect type contains an average of 20 samples, the candidate task sample set is randomly sampled from ImageNet, with a task size of 5 categories and 20 labeled images for each category. Understandably, the number of samples selected in the candidate task sample set is the average number of samples from all tasks in the target task sample set; its purpose is to mimic small-sample classification tasks.

[0079] Specifically, in this embodiment, M candidate task sample sets are randomly sampled from the base class task sample set, denoted as {S1, S2, ..., S...}. m S M}, where the threshold M is determined based on the model training cost that can be tolerated.

[0080] Step 602: For each of the candidate task sample sets, use network performance testing to obtain the optimal tuning parameters, and execute the test until all of the candidate task sample sets have been processed to obtain the optimal tuning parameter set.

[0081] Specifically, in this embodiment, the candidate task sample set S m The optimal tuning parameter α was obtained using network performance testing. m The above processing is performed on all candidate task sample sets to obtain the winning optimization parameter set, denoted as {α1, α2, ..., α...}. m , ..., α M}

[0082] Step 603: Perform cluster analysis on the set of winning optimization parameters to obtain the network optimization parameters.

[0083] Specifically, this embodiment optimizes the set of parameters {α1, α2, ..., α} for optimal tuning. m , ..., α M Perform k-means clustering analysis to obtain the largest cluster center α, and use α as the network tuning parameter for small sample target classification.

[0084] In at least one embodiment of the present invention, obtaining the optimal tuning parameters for each of the candidate task sample sets using network performance testing includes:

[0085] Step 701: Initialize the network parameters of the classification model corresponding to the candidate task sample set using the pre-trained parameters;

[0086] Step 702: Based on existing experience in optimizing small-sample classification networks, obtain different candidate optimization parameters;

[0087] It should be noted that existing few-shot classification network tuning experience refers to the empirical network tuning methods used in highly cited academic papers on few-shot classification. Candidate tuning parameters refer to the typical parameters corresponding to the optional network tuning strategies determined based on the parameter range of existing few-shot network tuning experience. For example, after analyzing the parameters of existing few-shot tuning experience, typical tuning ranges can be determined as {last layer, last two layers, last three layers, all layers}, typical learning rate parameters can be {0.01, 0.001, 0.0001, 0.00001}, and typical tuning algebras can be {1000, 2000, 4000, 8000}, resulting in a total of 64 different candidate tuning parameters. Understandably, different target sample numbers and different classification model architectures require different tuning parameter configurations.

[0088] Step 703: Perform network tuning on the pre-trained model under the different candidate tuning parameter configurations to obtain the model parameters and the class accuracy of the model parameters under the different candidate tuning parameter configurations.

[0089] Specifically, this embodiment uses the candidate task sample set S m The classification model network was tuned under each of the aforementioned 64 parameter configurations to obtain model parameters for 64 different parameter configurations. The class accuracy of the model parameters under these 64 different parameter configurations was then obtained using test samples, denoted as {s1, s2, ..., s...}. 64}

[0090] Step 704: Select the candidate tuning parameter with the highest accuracy of the category as the winning tuning parameter.

[0091] It should be noted that the class accuracy {s1, s2, ..., s} of the model parameters under 64 different tuning parameter configurations is... 64 The optimal tuning parameters are determined by using the tuning parameters that achieve the highest category accuracy.

[0092] Specifically, the process of obtaining category accuracy includes the following steps:

[0093] Step a: Randomly sample samples of the same task as the candidate task sample set from the base task sample set to obtain test samples.

[0094] It should be noted that test samples refer to a set of samples that have the same task as the candidate task sample set and have no overlap with the candidate task sample set. For example, for the candidate task sample set S... m First, remove S from ImageNet. m The samples in, and then for S m For each of the C tasks, 100 samples are randomly selected as test samples.

[0095] Step b: Use test samples to verify the effectiveness of model parameters under different tuning parameter configurations, and obtain a set of classification accuracy rates;

[0096] Classification accuracy refers to the accuracy in identifying the category of a test sample. For example, for a candidate task sample set S... m Assuming it contains 5 tasks, and the number of correctly identified items in the test samples are {80, 90, 85, 90, 95}, then the classification accuracy set is {80%, 90%, 85%, 90%, 95%}.

[0097] Step c: Calculate the class accuracy for each class in the set of classification accuracy rates. For example, you can calculate the average of the class accuracy rates in the set and use this average as the class accuracy. In this case, the class accuracy in the example above is (80+90+85+90+95) / 5 = 86%.

[0098] like Figure 3 As shown, in at least one embodiment of the present invention, when the few-shot target classification method based on imitation learning is applied to a server, it includes the following steps:

[0099] Step 1: The server can obtain the above base task sample set through public download, and obtain the target task sample set according to requirements;

[0100] Step 2: After the server obtains the base class task sample set, it uses task imitation learning to train the classification model network and obtain pre-trained parameters.

[0101] Step 3: After the server obtains the pre-trained parameters, it analyzes the performance of the classification model based on the above base class sample set and pre-trained parameters, and obtains the network tuning parameters.

[0102] Step 4: After the server obtains the above pre-training parameters and network tuning parameters, it initializes the classification model using the pre-training parameters, obtains the network tuning configuration using the network tuning parameters, and performs network tuning on the classification model using the target task sample set based on the network tuning configuration to obtain the target classification model.

[0103] Specifically, step 2 above includes the following sub-steps:

[0104] Step 2-1: The server randomly initializes the network parameters of the classification model;

[0105] Step 2-2: The server randomly samples a sub-task sample set from the base class task sample set, with the number of tasks equal to the target task sample set, and performs fixed-batch network training on the classification model to obtain the model parameters of the sub-task sample set.

[0106] The purpose of training the network in fixed batches rather than training until the network converges is to prevent the model parameters from overfitting to the sampled subtasks.

[0107] Steps 2-3: Based on the model parameters of the subtask sample set, the server uses momentum update to obtain the initial model parameters of the next subtask sample set.

[0108] Among them, the model parameters F based on the sub-task sample set n The initial model parameters E for the next subtask sample set are obtained using momentum update. n+1 .

[0109] Steps 2-4: The server continuously executes the above steps to randomly sample a sub-task sample set from the base class task sample set, with the number of tasks equal to the target task sample set. The classification model is trained in fixed batches to obtain the model parameters of the sub-task sample set. Based on the model parameters of the sub-task sample set, the initial model parameters of the next sub-task sample set are obtained by using momentum update until the execution number threshold is reached, and the pre-trained parameters are obtained.

[0110] It should be noted that steps 2-2 and 2-3 are executed repeatedly until the execution count threshold N is reached, thus obtaining the pre-trained parameters F. N The execution count threshold N is determined based on the model training cost that can be tolerated.

[0111] Specifically, step 3 above includes the following sub-steps:

[0112] Step 3-1: The server randomly samples multiple candidate task sample sets from the base class task sample set, wherein the number of tasks in the candidate task sample set is equal to the number of samples in the target task sample set;

[0113] Step 3-2: For each candidate task sample set, the server uses network performance testing to obtain the optimal tuning parameters, and executes this process until all candidate task sample sets have been processed, resulting in a set of optimal tuning parameters.

[0114] Step 3-3: The server performs cluster analysis on the set of winning optimization parameters to obtain network optimization parameters.

[0115] Specifically, step 4 includes the following sub-steps:

[0116] Step 4-1: The server initializes the classification model using pre-trained parameters to obtain the initialized classification model, where the pre-trained parameters are F. N ;

[0117] Step 4-2: The server uses network tuning parameters and the target task sample set to perform network tuning on the classification model to obtain the target classification model. The network tuning parameter is α, and the target task sample set is a small sample, usually 1-100 samples.

[0118] The target classification device based on imitation learning provided by this invention is described below. The target classification device based on imitation learning described below can be referred to in correspondence with the few-sample target classification method based on imitation learning described above. For example... Figure 4 As shown, this embodiment discloses a target classification device based on imitation learning, comprising:

[0119] Acquisition module 401 is used to acquire samples to be classified;

[0120] The classification module 402 is used to input the sample to be classified into the target classification model and obtain the classification result output by the target classification model;

[0121] The target classification model is trained using pre-trained parameters obtained by imitation learning from the base class task sample set, network tuning parameters, and the target task sample set.

[0122] The target classification device based on imitation learning in this embodiment of the invention improves the accuracy of model parameters through task imitation learning and sample imitation learning, thereby improving the stability, accuracy and generalization of small sample classification and enhancing the performance of the classification model under small sample conditions.

[0123] Figure 5An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a few-shot target classification method based on imitation learning, the method including:

[0124] Obtain the sample to be classified;

[0125] Input the sample to be classified into the target classification model and obtain the classification result output by the target classification model;

[0126] The target classification model is trained using pre-trained parameters obtained by imitation learning from the base class task sample set, network tuning parameters, and the target task sample set.

[0127] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0128] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the imitation learning-based few-sample target classification method provided by the above methods, the method comprising:

[0129] Obtain the sample to be classified;

[0130] Input the sample to be classified into the target classification model and obtain the classification result output by the target classification model;

[0131] The target classification model is trained using pre-trained parameters obtained by imitation learning from the base class task sample set, network tuning parameters, and the target task sample set.

[0132] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the few-shot target classification method based on imitation learning provided by the methods described above, the method comprising:

[0133] Obtain the sample to be classified;

[0134] Input the sample to be classified into the target classification model and obtain the classification result output by the target classification model;

[0135] The target classification model is trained using pre-trained parameters obtained by imitation learning from the base class task sample set, network tuning parameters, and the target task sample set.

[0136] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0137] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A small sample target classification method based on imitation learning, characterized in that, The method comprises the following steps: acquiring a sample to be classified, which is a bearing end face defect identification sample; inputting the sample to be classified into a target classification model to acquire a classification result output by the target classification model, wherein the classification result comprises a scratch, rust, a scratch, size abnormality and a normal sample; wherein the target classification model is obtained by training according to pre-training parameters, network tuning parameters and a target task sample set obtained by imitative learning of a base task sample set; the target classification model is obtained by training according to pre-training parameters, network tuning parameters and a target task sample set obtained by imitative learning of a base task sample set, comprising: acquiring the base task sample set, the target task sample set and the classification model; imitative learning of a task number of the target task sample set and training the classification model according to the base task sample set to obtain a pre-training classification model and pre-training model parameters; imitative learning of a task number and a sample number of the target task sample set and training the pre-training classification model according to the base task sample set to obtain network tuning parameters; training the classification model according to the target task sample set, the pre-training parameters and the network tuning parameters to obtain the target classification model; the imitative learning of the task number of the target task sample set and the training of the classification model to obtain the pre-training classification model and the pre-training model parameters, comprising: randomly initializing network parameters of the classification model; randomly sampling the base task sample set for multiple times according to an equal task number of the target task sample set to obtain multiple sub-task sample sets; training the classification model according to a current sub-task sample set to obtain model parameters corresponding to the current sub-task sample set, updating the network parameters of the classification model according to the model parameters corresponding to the current sub-task sample set and a momentum update rule, and updating a next sub-task sample set to the classification model after the updated network parameters are trained on the current sub-task sample set until all the sub-task sample sets are trained to obtain the pre-training classification model and the pre-training model parameters.

2. The method of claim 1, wherein, the training of the classification model according to a current sub-task sample set to obtain model parameters of the current sub-task sample set, the updating of the network parameters of the classification model according to the model parameters of the current sub-task sample set and a momentum update rule, comprising: training the classification model according to a current sub-task sample set to obtain model parameters of the current sub-task sample set; wherein if the current sub-task sample set is the first one, the network parameters of the classification model are updated by using the model parameters corresponding to the current sub-task sample set; if the current sub-task sample set is not the first one, the network parameters of the classification model are updated by weighted average based on the model parameters corresponding to the current sub-task sample set and the model parameters corresponding to the last sub-task sample set.

3. The method of claim 1, wherein the method is based on imitation learning. the imitative learning of a task number and a sample number of the target task sample set and the training of the pre-training classification model to obtain network tuning parameters, comprising: According to the number of tasks and the number of samples of the target task sample set, the base class task sample set is randomly sampled for multiple times with equal number of tasks and equal number of samples to obtain multiple candidate task sample sets; For each candidate task sample set, a winning tuning parameter is obtained by network performance testing, and the process is performed until all the candidate task sample sets are processed to obtain a winning tuning parameter set; The winning tuning parameter set is subjected to cluster analysis to obtain the network tuning parameter.

4. The method of claim 3, wherein the method is based on imitation learning. The winning tuning parameter obtained by network performance testing for each candidate task sample set comprises: The network parameters of the classification model corresponding to the candidate task sample set are initialized by using the pre-training parameters; According to small sample classification network tuning experience, different candidate tuning parameters are obtained; The pre-training model is subjected to network tuning under the configuration of different candidate tuning parameters to obtain model parameters under the configuration of different candidate tuning parameters and the category accuracy of the model parameters under the configuration of different candidate tuning parameters; The candidate tuning parameter with the highest category accuracy is taken as the winning tuning parameter. 5.A small sample target classification device based on imitation learning, characterized in that, Comprise: The acquisition module is used to obtain a to-be-classified sample, and the to-be-classified sample is a bearing end face defect identification sample; The classification module is used to input the to-be-classified sample into a target classification model, and obtain a classification result output by the target classification model, wherein the classification result comprises a scuffing, rust, scratch, size anomaly and normal sample; The target classification model is obtained by training a pre-training parameter, a network tuning parameter and a target task sample set according to a base class task sample set and imitation learning. The target classification model is obtained by training a pre-training parameter, a network tuning parameter and a target task sample set according to a base class task sample set and imitation learning, comprising: The base class task sample set, the target task sample set and the classification model are obtained; The target task sample set is subjected to imitation learning according to the number of tasks of the base class task sample set, and the classification model is trained to obtain a pre-training classification model and a pre-training model parameter; The target task sample set is subjected to imitation learning according to the number of tasks and the number of samples of the base class task sample set, and the pre-training classification model is trained to obtain a network tuning parameter; The target classification model is obtained by training the classification model according to the target task sample set, the pre-training parameter and the network tuning parameter; The target task sample set is subjected to imitation learning according to the number of tasks of the base class task sample set, and the classification model is trained to obtain a pre-training classification model and a pre-training model parameter, comprising: The network parameters of the classification model are randomly initialized; The base class task sample set is randomly sampled for multiple times with equal number of tasks according to the number of tasks of the target task sample set to obtain multiple sub-task sample sets; According to the current sub-task sample set, the classification model is trained to obtain model parameters corresponding to the current sub-task sample set, the network parameters of the classification model are updated according to the model parameters corresponding to the current sub-task sample set and a momentum update rule, the next sub-task sample set is updated to the classification model after the updated network parameters are trained, and until all sub-task sample sets are trained, a pre-training classification model and pre-training model parameters are obtained.

6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the small sample target classification method based on imitation learning according to any one of claims 1 to 4 when executing the program.

7. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the small sample target classification method based on imitation learning according to any one of claims 1 to 4.

8. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the small sample target classification method based on imitation learning according to any one of claims 1 to 4. The computer program is executed by the processor to implement the steps of the small sample target classification method based on imitation learning according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Unsupervised pedestrian difficult sample mining method and system based on multiple clustering information

    CN112819065A

  • Speech classification network training method and device, computing equipment and storage medium

    CN113593611A