Small-sample Feature Analysis Method and Device Based on Evolutionary Meta-Learning Model Training

Through the evolutionary meta-learning model training method, combined with federal computing and evolutionary computing, the neural network model parameters are optimized, and the problem of poor feature analysis effect of small samples is solved, achieving efficient feature analysis under small samples conditions.

CN114330650BActive Publication Date: 2025-08-01INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111520388.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2025-08-01
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

The problem of poor performance analysis of small and medium-sized samples in the prior art is especially in the fields of abnormal behavior diagnosis in the financial field, disease diagnosis in the medical field, and monitoring of endangered wildlife. Due to the scarcity of samples, it is difficult to effectively conduct model training.

Method used

Using a training method based on the evolutionary meta-learning model, the base class sample set and the target sample set are obtained, and the first neural network model is pre-trained. Then, the second neural network model is trained using the evolutionary meta-learning model, combined with federated computing and evolutionary computing, the model parameters are optimized until converge, and the target neural network model is obtained.

Benefits of technology

The performance and optimization ability of model training under small sample conditions are improved, the accuracy of feature analysis is improved, and it is suitable for feature analysis of small sample tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114330650B_ABST
    Figure CN114330650B_ABST
Patent Text Reader

Abstract

The present invention provides a few-shot feature analysis method, apparatus, electronic device, and storage medium based on the training of an evolutionary meta-learning model. Among them, the few-shot feature analysis method based on the training of an evolutionary meta-learning model includes: obtaining a base class sample set and a target sample set; training using a first neural network model based on the base class sample set to obtain pre-training parameters; training a second neural network model using an evolutionary meta-learning model training method based on the base class sample set and the pre-training parameters to obtain general model parameters, where the second neural network model has the same network structure as the feature layer of the first neural network model; adjusting the second neural network model based on the target sample set and the general model parameters to obtain a target neural network model. This method can improve the effect of few-shot feature analysis under few-shot conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine learning, and in particular, to a small-sample feature analysis method, device, electronic device, and storage medium based on the training of an evolutionary meta-learning model. Background Art

[0002] With the development of machine learning technology, machine learning has spread to almost all application fields. For example, military field, financial field, medical field, and part defect inspection field, etc. However, in the above fields, it is often necessary to perform relevant model training based on small samples. For example, in special application scenarios such as abnormal behavior diagnosis in the financial field or abnormal state diagnosis of equipment in key industries, the occurrence of abnormalities is a small-probability event, and a large number of training samples cannot be obtained. In the aspect of disease diagnosis in the medical field, due to a series of factors such as privacy, individual differences, or high annotation costs, there is usually a lack of annotated samples. In the monitoring of endangered wild animals, the number of endangered wild animals is scarce, and most of them live in uninhabited areas, making it difficult to capture images in typical environments and typical poses. In the detection of high-end part defects, the qualified rate of high-end parts is very high, the number of defective parts is very small, and the defect types are complex and diverse, and the samples of each defect type are extremely scarce, etc.

[0003] In the prior art, when using small samples for analysis, there is a problem of poor small-sample feature analysis effect. Summary of the Invention

[0004] The present invention provides a small-sample feature analysis method, device, electronic device, and storage medium based on the training of an evolutionary meta-learning model, so as to solve the defect of poor small-sample feature analysis effect in the prior art and achieve an improvement in the small-sample feature analysis effect.

[0005] The present invention provides a small-sample feature analysis method based on the training of an evolutionary meta-learning model, including: obtaining a base class sample set and a target sample set; training a first neural network model based on the base class sample set to obtain pre-training parameters; training a second neural network model using an evolutionary meta-learning model training method based on the base class sample set and the pre-training parameters to obtain general model parameters, where the second neural network model has the same network structure as the feature layer of the first neural network model; adjusting the second neural network model based on the target sample set and the general model parameters to obtain a target neural network model.

[0006] The present invention provides a few-shot feature analysis method based on evolutionary meta-learning model training. The method for training a second neural network model using the evolutionary meta-learning model training method to obtain general model parameters includes: initializing the feature layer parameters of the second neural network model using the feature layer parameters in the pre-trained parameters, and randomly initializing the parameters of other network layers of the second neural network model; randomly sampling multiple candidate sample sets from the base class sample set that are comparable in scale to the target sample set, training the second neural network model to obtain the model parameters of each candidate sample set, and using test samples to obtain the class accuracy corresponding to the model parameters; based on the model parameters of each candidate sample set and the class accuracy, using federated computing and evolutionary computing to obtain the synthetic model parameters and the initial model parameters of each candidate sample set in the subsequent generation; continuously executing the above steps, randomly sampling multiple candidate sample sets from the base class sample set that are comparable in scale to the target sample set, training the second neural network model to obtain the model parameters of each candidate sample set, and using test samples to obtain the class accuracy corresponding to the model parameters, and based on the model parameters of each candidate sample set and the class accuracy, using federated computing and evolutionary computing to obtain the synthetic model parameters and the initial model parameters of each candidate sample set in the subsequent generation until the neural network model converges to obtain the general model parameters.

[0007] The present invention provides a few-shot feature analysis method based on evolutionary meta-learning model training. The class accuracy includes an accuracy statistical value, and the process of obtaining the accuracy statistical value includes: randomly sampling samples with the same task as the candidate sample set from the base class sample set to obtain the test samples; using the test samples to verify the effectiveness of the model parameters of the candidate sample set to obtain a classification accuracy set; and statistically analyzing each classification accuracy in the classification accuracy set to obtain the accuracy statistical value.

[0008] The present invention provides a few-shot feature analysis method based on evolutionary meta-learning model training. Using the model parameters of each candidate sample set and the class accuracy rate, obtaining the synthetic model parameters and the initial model parameters of each candidate sample set in the backward generation through federated computing and evolutionary computing includes: screening the model parameters of each candidate sample set according to their corresponding class accuracy rates, and determining the one with the highest class accuracy rate as the preferred model parameters; using federated computing to perform model synthesis on the model parameters of each candidate sample set and the class accuracy rates corresponding to the model parameters to obtain the synthetic model parameters; randomly selecting two model parameters from the model parameters of each candidate sample set and the synthetic model parameters for crossover processing to obtain mutant model parameters, and repeating the process until the execution times threshold is reached to obtain the set of mutant model parameters; comprehensively determining the initial model parameters of each candidate sample set in the backward generation based on the preferred model parameters, the synthetic model parameters, and the set of mutant model parameters.

[0009] The present invention provides a few-shot feature analysis method. Adjusting the second neural network model to obtain the target neural network model includes: initializing the second neural network model using the general model parameters to obtain an initialized neural network model; in the network layers of the initialized neural network model, fixing the model parameters of the network layers other than the fully connected layer, and training the second neural network model using the target sample set until convergence to obtain the target neural network model.

[0010] The present invention also provides a model training device, including: a first processing module for obtaining a base class sample set and a target sample set; a second processing module for training using a first neural network model based on the base class sample set to obtain pre-training parameters; a third processing module for training a second neural network model using an evolutionary meta-learning model training method based on the base class sample set and the pre-training parameters to obtain general model parameters, where the second neural network model has the same network structure as the feature layer of the first neural network model; a fourth processing module for adjusting the second neural network model based on the target sample set and the general model parameters to obtain the target neural network model.

[0011] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the steps of any one of the above model training methods.

[0012] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the above-mentioned model training methods are implemented.

[0013] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of any one of the above-mentioned model training methods are implemented.

[0014] The small-sample feature analysis method, device, electronic device and storage medium based on evolutionary meta-learning model training provided by the present invention obtain a base class sample set and a target sample set; based on the base class sample set, use a first neural network model for training to obtain pre-training parameters; based on the base class sample set and the pre-training parameters, use the evolutionary meta-learning model training method to train a second neural network model to obtain general model parameters, wherein the above-mentioned second neural network model has the same network structure as the feature layer of the first neural network model; based on the target sample set and the general model parameters, adjust the second neural network model to obtain a target neural network model. By obtaining general model parameters through pre-training parameters and based on the base class sample set, and adjusting the second neural network model based on the target sample set and the general model parameters to obtain a target neural network model, the optimization ability is improved, and the performance of model training under small-sample conditions is improved. Description of the Drawings

[0015] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0016] Figure 1 It is one of the flow diagrams of the small-sample feature analysis method based on evolutionary meta-learning model training provided by the present invention;

[0017] Figure 2 It is another flow diagram of the small-sample feature analysis method based on evolutionary meta-learning model training provided by the present invention;

[0018] Figure 3 It is yet another flow diagram of the small-sample feature analysis method based on evolutionary meta-learning model training provided by the present invention;

[0019] Figure 4 It is still another flow diagram of the small-sample feature analysis method based on evolutionary meta-learning model training provided by the present invention;

[0020] Figure 5It is the fifth schematic flowchart of the few-shot feature analysis method based on the evolutionary meta-learning model provided by the present invention;

[0021] Figure 6 It is one of the schematic architecture diagrams of the few-shot feature analysis method based on the evolutionary meta-learning model provided by the present invention;

[0022] Figure 7 It is the schematic structural diagram of the few-shot feature analysis device provided by the present invention;

[0023] Figure 8 It is the schematic structural diagram of the electronic device provided by the present invention. Detailed implementation manners

[0024] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without making creative efforts shall fall within the protection scope of the present invention.

[0025] The following combines Figures 1 - 5 to describe the model training method of the present invention.

[0026] In one embodiment, as Figure 1 shown, a few-shot feature analysis method based on the evolutionary meta-learning model is provided. Taking the application of this method to a server as an example for illustration, the method includes the following steps:

[0027] Step 102, obtain a base class sample set and a target sample set.

[0028] Among them, the base class samples refer to the publicly available data sets of typical tasks that can be downloaded from the Internet. The data set contains many types of tasks, and each task contains a large number of samples. For example, the ImageNet data set in the field of image classification contains 1000 target categories, that is, tasks, and each target category has more than 1000 labeled images, that is, samples, and the total number of samples exceeds ten million. The target samples refer to the few-shot samples for training.

[0029] Specifically, the server can obtain the above-mentioned base class sample set through public download. And according to the requirements, obtain the target sample set.

[0030] Step 104, based on the base class sample set, use the first neural network model for training to obtain pre-training parameters.

[0031] Among them, the first neural network model refers to a common model suitable for the task to be completed, including a feature layer and a classification layer. The feature layer is determined according to the characteristics of the task. For example, the Transformer network model in the field of speech recognition, the ResNet network model in image classification, and the PointNet network model in point cloud recognition, etc. The classification layer adopts a fully connected structure, that is, a fully connected layer, and the number of output neurons is the number of tasks of the sample set, that is, the number of categories.

[0032] Specifically, after the server obtains the base class sample set and the target sample set, it first randomly initializes the neural network model, and then uses the base class sample set to train it until convergence. Since the number of neurons in the classification layer of the base class sample set is inconsistent with the number of neurons in the classification layer of the target task sample set, only the network parameters of the feature layer are retained as the pre-trained parameters of the neural network model.

[0033] Step 106, based on the base class sample set and the pre-trained parameters, use the evolutionary meta-learning model training method to train the second neural network model to obtain general model parameters, where the second neural network model has the same network structure as the feature layer of the first neural network model;

[0034] Among them, the second neural network model is a small sample training model, which can train a small sample set. This small sample set is the target sample set. The general model parameters refer to the model parameters that can be applied to different small sample learning tasks with the same task scale as the small sample set.

[0035] Specifically, after the server obtains the pre-trained parameters, based on the above base class sample set and the pre-trained parameters, use the evolutionary meta-learning model training method to train the second neural network model to obtain general model parameters.

[0036] Step 108, based on the target sample set and the general model parameters, adjust the second neural network model to obtain the target neural network model.

[0037] Specifically, after the server obtains the above general model parameters, input each target sample in the target sample set into the second neural network model for training. During the training process, continuously adjust the classification layer parameters of the second neural network model until the model converges to obtain the target neural network model.

[0038] The above-mentioned few-shot feature analysis method based on the evolutionary meta-learning model includes obtaining a base class sample set and a target sample set; based on the base class sample set, training a first neural network model to obtain pre-trained parameters; based on the base class sample set and the pre-trained parameters, training a second neural network model using the evolutionary meta-learning model training method to obtain general model parameters, where the above-mentioned second neural network model has the same network structure as the feature layer of the first neural network model; based on the target sample set and the general model parameters, adjusting the second neural network model to obtain a target neural network model. By obtaining the general model parameters through the pre-trained parameters and based on the base class sample set, and adjusting the second neural network model based on the target sample set and the general model parameters to obtain the target neural network model, the optimization ability is improved, and the performance of model training under few-shot conditions is enhanced.

[0039] In one embodiment, as Figure 2 shown, training the second neural network model using the evolutionary meta-learning model training method to obtain general model parameters includes:

[0040] Step 202: Initialize the feature layer parameters of the second neural network model using the feature layer parameters in the pre-trained parameters, and randomly initialize the parameters of other network layers of the second neural network model.

[0041] Among them, the feature layer parameters refer to the parameters of the network layer for feature extraction of samples.

[0042] Specifically, after the server obtains the above-mentioned pre-trained parameters, it initializes the feature layer parameters of the second neural network model using the feature layer parameters in the pre-trained parameters, and randomly initializes the parameters of other network layers of the second neural network model.

[0043] Step 204: Randomly sample multiple candidate sample sets from the base class sample set that are comparable in size to the target sample set, train the second neural network model to obtain the model parameters of each candidate sample set, and use the test samples to obtain the class accuracy corresponding to the model parameters.

[0044] Among them, the candidate task sample set refers to a set formed by randomly selecting C tasks from the base class sample set, where C is the number of categories in the target task sample set, and randomly sampling K samples for each task, where K is comparable to the number of samples in the target task sample set. For example, if the target task sample set contains 2 types of tasks, with 6 sample images for one type of task and 10 sample images for the other type of task, then 2 target categories can be randomly selected from ImageNet, and 8 samples are selected for each target category. It can be understood that the number of selected samples is the average value of the sample numbers in the above tasks, forming the candidate task sample set. It should be noted that the candidate task sample set is essentially a simulated small-sample feature analysis task. The test samples refer to a set composed of samples that have the same tasks as the candidate task sample set and have no intersection with the candidate task sample set. For example, first, the samples in the candidate task sample set are removed from ImageNet, and then for each of the C tasks in the candidate task sample set, 100 samples are randomly selected as test samples. The category accuracy rate refers to the accuracy rate of classifying the test samples. For example, for two tasks in the test samples, with 100 samples for each task, 60 samples are correctly identified for one task and 80 samples are correctly identified for the other task, then the category accuracy rate is 70%.

[0045] Specifically, the server first generates k candidate task sample sets, where k is the total number of candidate task sample sets in the same generation; then performs small-step training for a certain number of iterations based on the pre-trained parameters, so as to prevent the model from overfitting and obtain the model parameters corresponding to the k candidate task sample sets; finally, uses the test samples to verify the effectiveness of the obtained model parameters, and obtains the category accuracy rates corresponding to the k candidate task sample sets.

[0046] Step 206, based on the model parameters and category accuracy rates of each candidate sample set, use federated computing and evolutionary computing to obtain the synthetic model parameters and the initial model parameters of each candidate sample set in the subsequent generation.

[0047] Among them, the synthetic model parameters refer to the parameters obtained by performing average synthesis, weighted average synthesis, or adaptive weighted average synthesis on the model parameters of the k candidate task sample sets using federated computing.

[0048] Specifically, after the server obtains the model parameters and category accuracy rates of each candidate sample set, it uses federated computing and evolutionary computing to obtain the synthetic model parameters and the initial model parameters of each candidate sample set in the subsequent generation.

[0049] In one embodiment, it is assumed that the model parameters of the k candidate task sample sets are obtained and represented as {M 1 , M 2 ,..., Mk}, and the corresponding class accuracy is expressed as {mAP 1 , mAP 2 ,..., mAP k}. Then, the formula for obtaining the synthetic model parameter F by using average synthesis is expressed as:

[0050]

[0051] The formula for obtaining the synthetic model parameter F by using weighted average synthesis is expressed as:

[0052]

[0053] The formula for obtaining the synthetic model parameter F by using adaptive weighted average synthesis is expressed as:

[0054]

[0055] where g(M) is the information entropy of model M, which reflects the sufficient training degree of the model.

[0056] Assume that the model parameters are {M 1 , M 2 , …, M k}, and the average value of the corresponding number of parameters Then, the formula for performing adaptive weighted average on the above model parameters to obtain the synthetic model parameter F is expressed as:

[0057]

[0058] where i is a positive integer greater than or equal to 1 and less than or equal to k.

[0059] By using average synthesis, weighted average synthesis, or adaptive weighted average synthesis to obtain the synthetic model parameter, the purpose of improving the stability of the model parameter can be achieved.

[0060] Step 208: Continuously execute the above steps to randomly sample multiple candidate sample sets with a scale equivalent to that of the target sample set from the base class sample set, train the second neural network model to obtain the model parameters of each candidate sample set, and use the test samples to obtain the class accuracy corresponding to the model parameters. Based on the model parameters and class accuracy of each candidate sample set, use federated computing and evolutionary computing to obtain the synthetic model parameter and the initial model parameters of each candidate sample set in the subsequent generation until the neural network model converges to obtain the general model parameter.

[0061] Specifically, assume that the model parameters of each candidate sample set are expressed as {M 1 , M 2 , …, M k}, and the corresponding class accuracy is expressed as {mAP1 , mAP 2 ,..., mAP k} and find the corresponding model parameter E with the maximum class accuracy as one of the initial parameters; then through federated calculation, as shown in formulas (1), (2), (3), and (4), obtain the federated model parameter F as one of the initial parameters. Finally, through evolutionary calculation, randomly select one of the above model parameter E or the federated model parameter F as the parent generation, and randomly select one from the above model parameters {M 1 , M 2 ,…, M k} as another parent generation, perform a random crossover operation, and use the mutated model parameter EV or the federated mutated model parameter FV as one of the initial model parameters for each candidate sample set in the backward generation.

[0062] In this embodiment, by using the feature layer parameters in the pre-trained parameters to initialize the feature layer parameters of the second neural network model, randomly initializing the parameters of other network layers of the second neural network model, randomly sampling multiple candidate sample sets equivalent to the scale of the target sample set from the base class sample set, training the second neural network model to obtain the model parameters of each candidate sample set, and using the test samples to obtain the class accuracy corresponding to the model parameters. Based on the model parameters and class accuracy of each candidate sample set, using federated calculation and evolutionary calculation to obtain the synthetic model parameters and the initial model parameters of each candidate sample set in the backward generation, and continuously execute the above steps 204 and 206 until the neural network model converges to obtain the general model parameters, which can achieve the purpose of accurately obtaining the general model parameters.

[0063] In one embodiment, as Figure 3 shown, the class accuracy includes the accuracy statistical value, and the process of obtaining the accuracy statistical value:

[0064] Step 302: Randomly sample samples with the same task as the candidate sample set from the base class sample set to obtain test samples.

[0065] Specifically, after the server obtains the base class sample set, randomly sample samples with the same task as the candidate sample set in this set to obtain test samples.

[0066] Step 304: Use the test samples to verify the effectiveness of the model parameters of the candidate sample set to obtain the classification accuracy set.

[0067] Specifically, after obtaining the test samples, the server inputs the test samples into the neural network, and the model parameters used by the neural network are the model parameters trained on the candidate sample set. After the server obtains the object category accuracy set, any object category accuracy in the object category accuracy set is the corresponding classification accuracy set for each object category. For example, using the neural network model of the candidate sample set to verify the test samples, the classification accuracy set for each object category in the test samples is obtained. Suppose there are 5 object categories in the test samples, and the classification accuracy sets corresponding to categories 1 to 5 are {30%, 50%, 20%, 90%, 80%}.

[0068] Step 306: Statistically analyze each classification accuracy in the classification accuracy set to obtain an accuracy statistical value.

[0069] Specifically, after the server obtains the classification accuracy set, it statistically analyzes each classification accuracy in the classification accuracy set to obtain an accuracy statistical value. For example, the average value of each classification accuracy in the classification accuracy set can be calculated to obtain the average accuracy, and this average value is used as the accuracy statistical value.

[0070] In this embodiment, by randomly sampling samples of the same task as the candidate sample set from the base class sample set, test samples are obtained. The model parameters of the candidate sample set are effectively verified using the test samples to obtain the classification accuracy set, and each classification accuracy in the classification accuracy set is statistically analyzed to obtain the accuracy statistical value. The purpose of accurately obtaining the accuracy statistical value can be achieved.

[0071] In one embodiment, as Figure 4 shown, based on the model parameters and category accuracies of each candidate sample set, using federated computing and evolutionary computing to obtain the synthetic model parameters and the initial model parameters of each candidate sample set in the backward generation includes:

[0072] Step 402: Screen the model parameters of each candidate sample set according to their corresponding category accuracies, and determine the one with the highest category accuracy as the preferred model parameter.

[0073] Among them, the optimal model parameter refers to the parameter with the best performance among the model parameters of k candidate task sample sets. For example, suppose the category accuracy set is {20%, 30%, 60%, 70%}, and the corresponding neural network model parameters are {M1, M2, M3, M4} respectively. It can be seen that the category accuracy corresponding to the candidate task sample set 4 is the maximum value of the category accuracy, and the model parameter M4 is used as the optimal model parameter.

[0074] Specifically, sort the object category accuracies in the object category accuracy set from largest to smallest to obtain the object category accuracy with a rank of 1, which is used as the maximum object category accuracy.

[0075] Specifically, after the server obtains the maximum object category accuracy, it determines the neural network model parameters corresponding to the maximum object category accuracy as the optimal model parameters. For example, assume that the object category accuracy set corresponding to {Candidate sample set 1, Candidate sample set 2, Candidate sample set 3, Candidate sample set 4} is {20%, 30%, 60%, 70%}, and the corresponding neural network model parameters are represented as {M1, M2, M3, M4}. It can be seen that the object category accuracy corresponding to Candidate sample set 4 is the maximum object category accuracy, and the model parameter M4 corresponding to Candidate sample set 4 is used as the preferred model parameter E.

[0076] Step 404: Use federated computing to synthesize the model parameters and the category accuracies corresponding to the model parameters of each candidate sample set to obtain the synthesized model parameters.

[0077] Specifically, assume that the intermediate model parameter is represented as F, the candidate object category accuracy in the object category accuracy set is represented as mAP i , the model parameter is represented as M i , then the synthesized model parameter F is represented by the above formulas (1)(2)(3)(4).

[0078] Step 406: Randomly select two model parameters from the model parameters of each candidate sample set and the synthesized model parameters for crossover processing to obtain the mutated model parameters, and loop until the execution times threshold is reached to obtain the mutated model parameter set.

[0079] Specifically, after the server obtains the preferred model parameter E and the synthesized model parameter F, randomly select one as a parent, and randomly select one from the model parameters of each candidate sample set as the other parent, and perform crossover processing on the randomly selected two model parameters to obtain the mutated model parameter EV or FV. Loop until the execution times threshold is reached to obtain the mutated model parameter set E n or F n .

[0080] Step 408: Combine the preferred model parameters, the synthesized model parameters, and the mutated model parameter set to determine the initial model parameters of each candidate sample set in the subsequent generation.

[0081] Specifically, after the server obtains the preferred model parameter E, the synthesized model parameter F, and the mutated model parameter set E n or F nAfter that, at least one type of model parameter can be selected therefrom as the initial model parameter for each candidate sample set in the backward generation.

[0082] In one embodiment, after the server obtains the model parameters and their class accuracies of k candidate task sample sets, it selects the optimal model parameters through survival of the fittest, obtains the synthetic model parameters through federated computing, and obtains k - 2 sets of mutant model parameters through evolutionary computing. The three are combined to form k model parameters as the initial model parameters for each candidate task sample set in the next generation.

[0083] In one embodiment, the server has obtained the model parameters and their class accuracies of k candidate task sample sets in the first generation, and used survival of the fittest, federated computing, and evolutionary computing to obtain k model parameters as the initial model parameters for the second-generation candidate task sample sets; the second generation then randomly samples k candidate task sample sets and continues to train based on the initial model parameters given by the first generation to obtain the model parameters and their class accuracies of the k candidate task sample sets in the second generation; and so on, continuously training until the neural network model converges, until the training times threshold is reached. For example, if the training threshold is 100 generations, then after 100 generations of training, the training ends, and general model parameters with generalization ability are obtained.

[0084] In one embodiment, the above-mentioned set of mutant model parameters is obtained by randomly selecting two model parameters from the model parameters {M 1 , M 2 , …, M k} of k candidate task sample sets and the synthetic model parameter F for crossover processing to obtain the mutant model parameters, and a total of k - 2 times are executed to obtain the set of mutant model parameters, where k is the total number of candidate task sample sets.

[0085] In this embodiment, the model parameters of each candidate sample set are screened according to their corresponding class accuracies, and the one with the highest class accuracy is determined as the optimal model parameter. For the model parameters of each candidate sample set and their corresponding class accuracies, federated computing is used to synthesize the model to obtain the synthesized model parameters. Among the model parameters of each candidate sample set and the synthesized model parameters, two model parameters are randomly selected for crossover processing to obtain the mutant model parameters. This is looped until the execution times threshold is reached to obtain the mutant model parameter set. By comprehensively considering the optimal model parameter, the synthesized model parameter, and the mutant model parameter set, the initial model parameters of each candidate sample set in the backward generation are determined. The mutant model parameters obtained through the above crossover processing can achieve the purpose of enhancing the diversity of model parameters. The synthesized model parameters obtained through federated computing enhance the convergence stability in the case where the candidate task sample sets do not satisfy independent and identically distributed conditions; the mutant model parameters obtained through evolutionary computing enrich the diversity of the initial model parameters of each candidate task sample set in the next generation and improve the optimization ability; combining the advantages of meta-learning, federated computing, and evolutionary computing improves the performance of model training under small sample conditions.

[0086] In one embodiment, as Figure 5 shown, adjusting the second neural network model to obtain the target neural network model includes:

[0087] Step 502, initializing the second neural network model with the general model parameters to obtain the initialized neural network model.

[0088] Specifically, after the server obtains the general model parameters, it uses the general model parameters to initialize the neural network model to obtain the initialized neural network model.

[0089] Step 504, in the network layers of the initialized neural network model, fix the model parameters of the network layers other than the fully connected layer, and use the target sample set to train the second neural network model until convergence to obtain the target neural network model.

[0090] Specifically, after the server obtains the initialized neural network model, it fixes the model parameters of the other network layers except the last layer (i.e., the fully connected layer) of the initialized neural network model, and uses the target sample set to train the neural network model until convergence to obtain the target neural network model. Among them, the target sample set can be regarded as a new class, that is, a small sample, which is a sample that needs to perform object category classification and has a certain sample size, usually 1 - 100 samples.

[0091] In this embodiment, by initializing a neural network model using general model parameters to obtain an initialized neural network model, it is possible to fix the model parameters of the network layers other than the fully connected layer in the network layers of the initialized neural network model, and use the samples to be trained to train the neural network model until convergence to obtain a target neural network model, achieving the purpose of obtaining an optimal target neural network model that can converge quickly.

[0092] In this embodiment, by initializing a second neural network model using general model parameters to obtain an initialized neural network model, in the network layers of the initialized neural network model, fix the model parameters of the network layers other than the fully connected layer, and use the target sample set to train the second neural network model until convergence to obtain a target neural network model, achieving the purpose of obtaining a target neural network model with optimal performance.

[0093] In one embodiment, as Figure 6 shown, taking the training process of small sample feature analysis as an example. The following steps are required:

[0094] Step 1: Select multiple meta-samples from the base class samples, i.e., a large number of samples, for parallel training of the neural network model of the same generation to obtain the model parameters corresponding to different meta-samples. For example, input meta-sample 1-1, meta-sample 1-2, meta-sample 1-3, and meta-sample 1-4 into the parallel training of the corresponding sub-neural network models respectively to obtain the corresponding parameters M 1-1 、M 1-2 、M 1-3 and M 1-4 .

[0095] Step 2: Use the mechanism of survival of the fittest and genetic variation to obtain the initial parameters of the next generation model.

[0096] Step 3: Loop through the above steps 1 and 2 to obtain the general feature model parameters of the neural network model.

[0097] Step 4: Use the general feature model parameters obtained in step 3 to optimize the parameters of the last layer of the above neural network model, and use the new class sample set to train the neural network model to obtain a small sample feature analysis model that can converge quickly.

[0098] It can be understood that the neural network model in step 3 or step 4 has the same network structure as the neural network model in step 1.

[0099] Through the operation of the above steps in this embodiment, it is possible to initialize the small sample feature analysis model using the above general feature model parameters with good stability and strong generalization ability, and improve the fast convergence ability of small sample learning.

[0100] In one embodiment, the specific implementation process of step 2 is as follows: Obtain a test sample, and input the test sample into the neural network models corresponding to each of the above parallel meta-sample sets to obtain the average accuracy of the object categories of the neural network models corresponding to each meta-sample set. Based on the principle of survival of the fittest, individuals with stronger adaptability have longer life cycles. Retain the neural network model parameter E corresponding to the meta-sample set with the highest average accuracy as an initial parameter of the next-generation model; Based on the idea of federated computing, obtain a federated model parameter F with certain fault tolerance and good convergence as one or more initial parameters of the next-generation model.

[0101] In one embodiment, the process of obtaining the federated model parameter F is based on the individual model parameters {M 1 , M 2 , …, M k} and their average accuracy {mAP 1 , mAP 2 , …, mAP k} (k is the number of individual models in the same generation). It can be understood that M 1 includes the model parameters M Figure 6 output by the first meta-sample in each generation as shown in 1-1 , M 2-1 , M 3-1 , ……, M 2 includes the model parameters M Figure 6 output by the second meta-sample in each generation as shown in 1-2 , M 2-2 , M 3-2 , ……, and so on. The individual model parameters include the parameters output by the neural network models obtained after training and iterating with each meta-sample in the same generation. Similarly, mAP 1 in the average accuracy includes the average accuracy of the model parameters output by the first meta-sample in each generation as shown in Figure 6 , mAP 2 includes the average accuracy of the model parameters output by the second meta-sample in each generation as shown in Figure 6 , and so on. The above federated model parameter F is comprehensively calculated by any of the following methods:

[0102] Method 1: Calculate the average value of each individual model parameter to obtain the federated model parameter F, expressed as the above formula (1):

[0103] Method 2: Perform weighted averaging on all individual model parameters according to the above average accuracy to obtain the federated model parameter F, expressed as the above formula (2).

[0104] 12k

[0105] Method 3: Adaptive weighted averaging is performed on all individual models according to the average value {m, m, …, m} of all the parameter quantities in the individual model parameters to obtain the federated model parameters F, which is expressed as the above formula (4).

[0106] In one embodiment, as Figure 6 shown, based on the mechanism of survival of the fittest and genetic variation, mutation can be performed on the model parameters E of the neural network model with the highest average accuracy or the federated model parameters F above to obtain the individual mutant model parameters EV or the federated mutant model parameters FV, which are used as an initial parameter of the next-generation model. Specifically, one of the model parameters E of the neural network model with the highest average accuracy and the federated model parameters F is randomly selected as a parent, and one of all the individual model parameters {M 1 , M 2 , …, M k} is randomly selected as another parent, and then a random crossover operation is performed to generate an initial parameter of the next-generation model. The number of mutant model parameters is determined according to actual needs, and the corresponding number of the above operations can be performed to ensure that the number of individual models in the same generation remains unchanged.

[0107] In one embodiment, specifically in the above step 3, the initial model parameters of the first-generation individuals are obtained by using random initialization or overall training on the base class set. All individuals in the first generation share the same initial model parameters to avoid inconsistency in the overall form of the model parameters among individuals; the updated individual model parameters under different sample tasks are obtained by running the above step 1, and the initial model parameters of the next-generation individuals are obtained by running the above step 2. The above steps 1 and 2 are repeatedly executed for a total of n times to obtain the general feature model parameters F n of the neural network model; it should be noted that since the pre-trained classification layer network structure is inconsistent with the small-sample feature analysis classification layer network structure, only the pre-trained parameters of the feature network in the neural network model are retained after overall training on the base class set, and the classification layer parameters are randomly initialized. They can also be initialized with the class prototype feature vectors in the meta-sample or meta-task set, so as to accelerate the convergence speed. All individuals in the first generation share the same initial model parameters to avoid inconsistency in the overall form of the model parameters among individuals.

[0108] In one embodiment, it should be noted that as Figure 6The large number of samples of the base class and the small number of samples of the new class shown in the figure respectively represent: Assuming that there are C categories in the small-sample new-class set, and there are K samples in each category, that is, the small-sample new-class set can be represented as a small-sample classification task of {C-Way K-Shot}. Assuming that there are C′ (C′ > C) categories in the base-class set of a large number of samples, and there are K′ (K′ >> K) samples in each category, which can be extracted based on a large-scale common-type target data set. For example, it can be extracted from the common-type target data set ImageNet. The small-sample new-class set is an uncommon-type target and has no intersection with the target categories in the base-class set. Randomly sample C categories from the base-class set, and randomly sample K samples from each category to obtain a meta-sample, that is, a meta-task set. Repeated sampling multiple times can obtain multiple meta-samples, that is, a meta-task set.

[0109] In one embodiment, the process of obtaining individual model parameters is as follows: Based on the initial model parameters, that is, the first-generation or evolutionary computing model parameters, use the multiple meta-samples or meta-task sets obtained in the same generation to train the neural network model under different scenario tasks respectively, and obtain the individual model parameters under different scenario tasks. For example, use the backpropagation training of the ResNet50 feature network and the fully connected classification layer to obtain the individual model parameters of each meta-sample or meta-task set. It can be understood that different scenario tasks are different meta-samples or meta-task sets.

[0110] The model training device provided by the present invention will be described below. The model training device described below can be correspondingly referred to the model training method described above.

[0111] In one embodiment, as Figure 7 shown, a model training device 700 is provided, including: a first processing module 702, a second processing module 704, a third processing module 706, and a fourth processing module 708, where: The first processing module is used to obtain a base-class sample set and a target sample set; The second processing module is used to train using the first neural network model based on the base-class sample set to obtain pre-training parameters; The third processing module is used to train the second neural network model using the evolutionary meta-learning model training method based on the base-class sample set and the pre-training parameters to obtain general model parameters, where the second neural network model has the same network structure as the feature layer of the first neural network model; The fourth processing module is used to adjust the second neural network model based on the target sample set and the general model parameters to obtain a target neural network model.

[0112] In one embodiment, the third processing module 706 is configured to initialize the feature layer parameters of the second neural network model by using the feature layer parameters in the pre-trained parameters, and randomly initialize the parameters of other network layers of the second neural network model; randomly sample multiple candidate sample sets equivalent to the scale of the target sample set from the base class sample set, train the second neural network model to obtain the model parameters of each candidate sample set, and use the test samples to obtain the category accuracy corresponding to the model parameters; based on the model parameters and the category accuracy of each candidate sample set, use federated computing and evolutionary computing to obtain the synthetic model parameters and the initial model parameters of each candidate sample set in the backward generation; continuously execute the above steps to randomly sample multiple candidate sample sets equivalent to the scale of the target sample set from the base class sample set, train the second neural network model to obtain the model parameters of each candidate sample set, and use the test samples to obtain the category accuracy corresponding to the model parameters, based on the model parameters and the category accuracy of each candidate sample set, use federated computing and evolutionary computing to obtain the synthetic model parameters and the initial model parameters of each candidate sample set in the backward generation until the neural network model converges to obtain the general model parameters.

[0113] In one embodiment, the third processing module 706 is configured to randomly sample samples with the same task as the candidate sample set from the base class sample set to obtain the test samples; use the test samples to verify the effectiveness of the model parameters of the candidate sample set to obtain a set of classification accuracies; and count each classification accuracy in the set of classification accuracies to obtain the accuracy statistic value.

[0114] In one embodiment, the third processing module 706 is configured to screen the model parameters of each candidate sample set according to the corresponding category accuracy, and determine the one with the highest category accuracy as the preferred model parameters; perform model synthesis on the model parameters of each candidate sample set and the category accuracy corresponding to the model parameters by using federated computing to obtain the synthetic model parameters; randomly select two model parameters from the model parameters of each candidate sample set and the synthetic model parameters for crossover processing to obtain mutant model parameters, and loop until the execution times threshold is reached to obtain the set of mutant model parameters; and comprehensively determine the initial model parameters of each candidate sample set in the backward generation based on the preferred model parameters, the synthetic model parameters, and the set of mutant model parameters.

[0115] In one embodiment, a fourth processing module 708 is configured to initialize the second neural network model by using the general model parameters to obtain an initialized neural network model; in the network layers of the initialized neural network model, fix the model parameters of the network layers other than the fully connected layer, and use the target sample set to train the second neural network model until convergence to obtain the target neural network model.

[0116] Figure 8 FIG. illustrates a schematic physical structure diagram of an electronic device, such as Figure 8 shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communication bus 840. Among them, the processor 810, the communications interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the logical instructions in the memory 830 to execute a few-shot feature analysis method based on evolutionary meta-learning model training. The method includes: obtaining a base class sample set and a target sample set; training a first neural network model based on the base class sample set to obtain pre-training parameters; training a second neural network model by using an evolutionary meta-learning model training method based on the base class sample set and the pre-training parameters to obtain general model parameters, where the second neural network model has the same network structure as the feature layer of the first neural network model; adjusting the second neural network model based on the target sample set and the general model parameters to obtain a target neural network model.

[0117] In addition, when the logical instructions in the above-mentioned memory 830 can be implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store program codes.

[0118] 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 can execute a few-shot feature analysis method based on an evolutionary meta-learning model. The method includes: obtaining a base class sample set and a target sample set; training using a first neural network model based on the base class sample set to obtain pre-training parameters; training a second neural network model using an evolutionary meta-learning model training method based on the base class sample set and the pre-training parameters to obtain general model parameters, where the second neural network model has the same network structure as the feature layer of the first neural network model; adjusting the second neural network model based on the target sample set and the general model parameters to obtain a target neural network model.

[0119] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements a few-shot feature analysis method based on an evolutionary meta-learning model. The method includes: obtaining a base class sample set and a target sample set; training using a first neural network model based on the base class sample set to obtain pre-training parameters; training a second neural network model using an evolutionary meta-learning model training method based on the base class sample set and the pre-training parameters to obtain general model parameters, where the second neural network model has the same network structure as the feature layer of the first neural network model; adjusting the second neural network model based on the target sample set and the general model parameters to obtain a target neural network model.

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

[0121] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the essence of the above technical solution, 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., and includes several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of each embodiment of the present invention.

Claims

1. A few-shot feature analysis method based on the training of an evolutionary meta-learning model, characterized in that, Applied to a server, including: Obtain a base class sample set and a target sample set, where the base class samples in the base class sample set are labeled images in the field of image classification; Based on the base class sample set, use the first neural network model for training to obtain pre-training parameters; Based on the base class sample set and the pre-training parameters, use the evolutionary meta-learning model training method to train the second neural network model to obtain general model parameters, where the second neural network model has the same network structure as the feature layer of the first neural network model; Based on the target sample set and the general model parameters, adjust the second neural network model to obtain a target neural network model; The step of using the evolutionary meta-learning model training method to train the second neural network model to obtain general model parameters includes: Use the feature layer parameters in the pre-training parameters to initialize the feature layer parameters of the second neural network model, and randomly initialize the parameters of other network layers of the second neural network model; Randomly sample multiple candidate sample sets from the base class sample set that are comparable in scale to the target sample set, train the second neural network model to obtain the model parameters of each candidate sample set, and use the test samples to obtain the class accuracy corresponding to the model parameters; Based on the model parameters of each candidate sample set and the class accuracy, use federated computing and evolutionary computing to obtain synthetic model parameters and the initial model parameters of each candidate sample set in the backward generation; Continuously execute the above steps to randomly sample multiple candidate sample sets from the base class sample set that are comparable in scale to the target sample set, train the second neural network model to obtain the model parameters of each candidate sample set, and use the test samples to obtain the class accuracy corresponding to the model parameters. Based on the model parameters of each candidate sample set and the class accuracy, use federated computing and evolutionary computing to obtain synthetic model parameters and the initial model parameters of each candidate sample set in the backward generation until the neural network model converges to obtain the general model parameters.

2. The method according to claim 1, characterized in that, The class accuracy includes an accuracy statistic value, and the process of obtaining the accuracy statistic value includes: Randomly sample samples with the same task as the candidate sample set from the base class sample set to obtain the test samples; Use the test samples to verify the effectiveness of the model parameters of the candidate sample set to obtain a classification accuracy set; Statistically analyze each classification accuracy in the classification accuracy set to obtain the accuracy statistic value.

3. The method according to claim 1, wherein The step of using federated computing and evolutionary computing based on the model parameters of each candidate sample set and the class accuracy to obtain synthetic model parameters and the initial model parameters of each candidate sample set in the backward generation includes: Screen the model parameters of each candidate sample set according to the corresponding class accuracy, and determine the one with the highest class accuracy as the preferred model parameter; For the model parameters of each of the candidate sample sets and the class accuracy corresponding to the model parameters, use federated computing to perform model synthesis to obtain the synthesized model parameters; Randomly select two model parameters from the model parameters of each of the candidate sample sets and the synthesized model parameters for cross processing to obtain mutant model parameters, and loop until the execution times threshold is reached to obtain the mutant model parameter set; Based on the preferred model parameters, the synthesized model parameters, and the mutant model parameter set, determine the initial model parameters of each of the candidate sample sets in the backward generation.

4. The method according to claim 1, characterized in that, The adjusting the second neural network model to obtain a target neural network model includes: Use the general model parameters to initialize the second neural network model to obtain an initialized neural network model; In the network layer of the initialized neural network model, fix the model parameters of the network layers other than the fully connected layer, and use the target sample set to train the second neural network model until convergence to obtain the target neural network model.

5. A small-sample feature analysis device based on the training of an evolutionary meta-learning model, characterized in that, Applied to a server, including: A first processing module, configured to obtain a base class sample set and a target sample set, wherein the base class samples in the base class sample set are labeled images in the field of image classification; A second processing module, configured to train a first neural network model based on the base class sample set to obtain pre-training parameters; A third processing module, configured to train a second neural network model using an evolutionary meta-learning model training method based on the base class sample set and the pre-training parameters to obtain general model parameters, wherein the second neural network model has the same network structure as the feature layer of the first neural network model; A fourth processing module, configured to adjust the second neural network model based on the target sample set and the general model parameters to obtain a target neural network model; The third processing module is specifically configured to: Use the feature layer parameters in the pre-training parameters to initialize the feature layer parameters of the second neural network model, and randomly initialize the parameters of other network layers of the second neural network model; Randomly sample multiple candidate sample sets from the base class sample set that are comparable in scale to the target sample set, train the second neural network model to obtain the model parameters of each candidate sample set, and use test samples to obtain the class accuracy corresponding to the model parameters; Based on the model parameters of each of the candidate sample sets and the class accuracy, use federated computing and evolutionary computing to obtain synthesized model parameters and the initial model parameters of each of the candidate sample sets in the backward generation; Continuously execute the above steps to randomly sample multiple candidate sample sets comparable to the scale of the target sample set from the base class sample set, train the second neural network model to obtain the model parameters of each candidate sample set, and use the test samples to obtain the class accuracy corresponding to the model parameters. Based on the model parameters of each candidate sample set and the class accuracy, use federated computing and evolutionary computing to obtain the synthetic model parameters and the initial model parameters of each candidate sample set in the backward generation until the neural network model converges to obtain the general model parameters.

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, When the processor executes the program, it implements the steps of few-shot feature analysis based on the evolutionary meta-learning model according to any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of few-shot feature analysis based on the evolutionary meta-learning model according to any one of claims 1 to 4.

8. A computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of few-shot feature analysis based on the evolutionary meta-learning model according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Base class selection method and device for small sample learning

    CN111461179A