Small sample learning method, device and electronic device based on meta-learning

By constructing a training task set for meta-learning and cyclically updating the model and hyperparameters, the problem of insufficient generalization capabilities of meta-network in the existing technology is solved, and the effect of rapid convergence under small sample conditions is achieved, which is suitable for a variety of machine learning tasks.

CN114492624BActive Publication Date: 2025-08-1236TH RES INST OF CETC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210084037.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-21
Publication Date
2025-08-12
Estimated Expiration
2042-01-21

AI Technical Summary

Technical Problem

The existing small sample learning method only optimizes model parameters and cannot effectively improve the generalization ability of the metanet, resulting in insufficient generalization ability of the model under small sample conditions.

Method used

By constructing a training task set for meta-learning, initialize and cyclically update the model parameters and hyperparameters of the meta-network, use multiple training tasks to optimize hyperparameters until the preset conditions are met, and use the parameters at the time of stopping optimization as meta-initial parameters for training new tasks.

Benefits of technology

The generalization ability of metanets under small sample conditions is improved, so that they can quickly converge to better solutions in new tasks, and is suitable for various machine learning problems such as classification, regression and reinforcement learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114492624B_ABST
    Figure CN114492624B_ABST
Patent Text Reader

Abstract

The present invention discloses a small sample learning method, device and electronic device based on meta-learning. The method of the present invention includes: constructing a training task set for meta-learning, wherein the training task set includes multiple training tasks; initializing the model parameters and hyperparameters of the meta-network; cyclically updating the model parameters and hyperparameters of the meta-network, wherein the model parameters of the meta-network are updated using multiple training tasks, and the hyperparameters of the meta-network are optimized using the updated model parameters and a pre-constructed optimization network; when a preset condition is met, the optimization of the meta-network is stopped, and the model parameters and hyperparameters at the time of stopping the optimization are used as meta-initial parameters. In a new task, the model parameters of the meta-network are trained based on the meta-initial parameters, and the trained meta-network is used for identification and discovery. The technical solution of the present invention can significantly improve the generalization ability of the meta-network by optimizing the model parameters and hyperparameters of the meta-network respectively.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to a small sample learning method, device and electronic device based on meta-learning. Background Art

[0002] Since its rise, machine learning, and in particular deep learning, has been successfully applied to a wide range of fields, including computer vision, natural language processing, and data mining. A key factor in its success in these areas is the readily available availability of massive amounts of labeled data. However, due to factors such as privacy concerns, security concerns, and the high cost of data labeling, many real-world applications (such as those in medicine, the military, and finance) lack the means to obtain sufficient labeled training samples. Therefore, enabling a machine learning or deep learning system to efficiently learn and generalize its cognitive capabilities from very small samples has become a pressing challenge for many machine learning and deep learning researchers.

[0003] Among them, small-shot learning (also known as few-shot learning, abbreviated as FSL) is not expected to rely on large-scale training samples, thereby avoiding the high cost of data preparation in certain specific applications, and can achieve low-cost and fast model deployment for a newly emerging task with few samples.

[0004] Current small-sample learning methods generally improve the generalization ability of a meta-network by training its model parameters. However, in practice, the parameters that influence the generalization ability of a meta-network include not only model parameters but also hyperparameters. Therefore, existing techniques that only optimize model parameters can only achieve limited improvements in the generalization ability of the meta-network. Summary of the Invention

[0005] In view of this, the main purpose of the present invention is to provide a small sample learning method, device and electronic device based on meta-learning, which are used to improve the generalization ability of the meta-network.

[0006] According to a first aspect of the present invention, a small sample learning method based on meta-learning is provided, comprising:

[0007] Constructing a meta-learning training task set, wherein the training task set includes multiple training tasks;

[0008] Initialize the model parameters and hyperparameters of the meta-network;

[0009] Cyclic updating of the model parameters and hyperparameters of the meta-network, wherein the model parameters of the meta-network are updated using multiple training tasks, and the hyperparameters of the meta-network are optimized using the updated model parameters and the pre-built optimization network;

[0010] When the preset conditions are met, the optimization of the meta-network is stopped, and the model parameters and hyperparameters at the time of stopping the optimization are used as the meta-initial parameters. In the new task, the model parameters of the meta-network are trained based on the meta-initial parameters, and the trained meta-network is used for identification and discovery.

[0011] According to a second aspect of the present invention, a small sample learning device based on meta-learning is provided, comprising:

[0012] A data construction unit, configured to construct a training task set for meta-learning, wherein the training task set includes a plurality of training tasks;

[0013] Initialization unit, used to initialize the model parameters and hyperparameters of the meta-network;

[0014] An updating unit, configured to cyclically update the model parameters and hyperparameters of the meta-network, wherein the model parameters of the meta-network are updated using multiple training tasks, and the hyperparameters of the meta-network are optimized using the updated model parameters and a pre-built optimization network;

[0015] The stop updating unit is used to stop optimizing the meta-network when the preset conditions are met, and use the model parameters and hyperparameters when the optimization is stopped as the meta-initial parameters. The model parameters of the meta-network are trained based on the meta-initial parameters in the new task, and the trained meta-network is used for identification and discovery.

[0016] According to a third aspect of the present invention, an electronic device is provided, comprising a processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the above-mentioned meta-learning-based small sample learning method.

[0017] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, which stores one or more programs. When the one or more programs are executed by a processor, they implement the above-mentioned small sample learning method based on meta-learning.

[0018] At least one of the above-mentioned technical solutions adopted by the present invention can achieve the following beneficial effects: the small sample learning method, device and electronic device based on meta-learning of the embodiments of the present invention adopt different learning methods to learn the model parameters and hyperparameters of the meta-network from a large number of training tasks, so that the obtained meta-initial parameters can quickly converge to a better solution under small sample conditions when facing new machine learning tasks, thereby improving the generalization ability of the model.

[0019] And because the meta-network of this embodiment of the invention is based on a large number of training tasks, it can produce generalized performance on new tasks through a small number of iterations, that is, the method of this embodiment trains a network model that is easy to fine-tune.

[0020] In addition, since this embodiment of the invention does not impose any restrictions on the form of the meta-network, it can be adapted to any machine learning problem, such as classification problems, regression problems, and reinforcement learning problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0022] Figure 1 A flow chart of a small sample learning method based on meta-learning according to an embodiment of the present invention is shown;

[0023] Figure 2 A schematic diagram showing the use of LSTM to update meta-network hyperparameters according to one embodiment of the present invention is shown;

[0024] Figure 3 A schematic structural diagram of a small sample learning device based on meta-learning according to an embodiment of the present invention is shown;

[0025] Figure 4 A schematic structural diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0026] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. These embodiments are provided to facilitate a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention may be implemented in various forms and should not be limited by the embodiments set forth herein.

[0027] The basic concept of the embodiments of the present invention is: using different learning methods to learn the model parameters and hyperparameters of the meta-network from a large number of training tasks, where the model parameters and hyperparameters constitute the meta-initial parameters of the meta-network, and the meta-initial parameters can enable new machine learning tasks to quickly converge to a better solution even under small sample conditions.

[0028] Figure 1 FIG. 4 shows a flow chart of a small sample learning method based on meta-learning according to an embodiment of the present invention. Figure 1 As shown, the method of this embodiment includes at least steps S110 to S140:

[0029] Step S110: construct a meta-learning training task set, where the training task set includes multiple training tasks.

[0030] Unlike traditional machine learning methods, the small sample learning method of this embodiment aims to learn at the task level rather than on sample data. Therefore, this embodiment requires the construction of a training task set. To ensure the generalization ability of the meta-network, the training task set of this embodiment includes multiple training tasks, each of which includes two sets of data sets, namely, each training task includes a first data set and a second data set. The first data set and the second data set both include a support set (also called a support set) and a query set (also called a query set). The first data set is used to update the model parameters of the meta-network, and the second data set is used to optimize the hyperparameters of the meta-network.

[0031] Step S120: Initialize the model parameters and hyperparameters of the meta-network.

[0032] The meta-network in this embodiment includes an artificial neural network, an algorithmic mathematical model that mimics the behavioral characteristics of animal neural networks and performs distributed parallel information processing. This network relies on the complexity of the system to achieve information processing by adjusting the interconnections between a large number of internal nodes.

[0033] The meta-network of this embodiment includes two types of parameters: one type needs to be learned and estimated from the data, which is called model parameters (also called Parameter). This type of model parameters is the parameters of the model itself. For example, the size of the convolution layer and the convolution kernel parameters are model parameters. Another type is the tuning parameters (also called Tuning Parameters) in the machine learning algorithm, which need to be set manually and are called hyperparameters (also called Hyperparameters). For example, the learning rate, number of iterations, and batch size of a new task are all hyperparameters.

[0034] When initializing the hyperparameters and model parameters of the meta-network, randomly generated parameters can be used as the initial hyperparameters and initial model parameters of the meta-network.

[0035] Step S130 , cyclically updating the model parameters and hyperparameters of the meta-network, wherein the model parameters of the meta-network are updated using multiple training tasks, and the hyperparameters of the meta-network are optimized using the updated model parameters and the pre-built optimization network.

[0036] Here, the cyclic update of the model parameters and hyperparameters of the meta-network can be understood as: using multiple training tasks to update the model parameters of the meta-network, and using the updated model parameters and the pre-built optimization network to optimize the hyperparameters of the meta-network; and then using the updated model parameters and optimized hyperparameters to update the meta-network, and then updating the model parameters of the meta-network again through multiple training tasks, and using the updated model parameters and the optimized network to optimize the hyperparameters of the meta-network again, and updating the meta-network in this cycle.

[0037] As mentioned above, using multiple training tasks to update the model parameters of the meta-network refers to using the first data set of the multiple training tasks to update the model parameters, and using the updated model parameters and the pre-built optimization network to optimize the hyperparameters of the meta-network refers to using the second data set of the multiple training tasks and the updated model parameters to update the loss function of the optimization network, and then using the optimization network to update the hyperparameters of the meta-network.

[0038] Step S140: When the preset conditions are met, the optimization of the meta-network is stopped, and the model parameters and hyperparameters at the time of stopping the optimization are used as the meta-initial parameters. The model parameters of the meta-network are trained based on the meta-initial parameters in the new task, and the trained meta-network is used for identification and discovery.

[0039] For example, if the loss function of the optimized network is less than a set value, or the number of optimizations of the optimized network reaches the target value, the optimization of the meta-network can be stopped. The model parameters and hyperparameters at the time of stopping optimization are pseudo-meta-initial parameters. The meta-network with these meta-initial parameters can achieve rapid model convergence using a small amount of sample data when facing new tasks.

[0040] visible Figure 1 The method shown is to learn the model parameters and hyperparameters of the meta-network using different learning methods from a large number of training tasks, so that the obtained meta-initial parameters can quickly converge to a better solution when facing new machine learning tasks even under small sample conditions. And because the meta-network of this embodiment is based on a large number of training tasks, it can produce generalized performance on new tasks through a small number of iterations, that is, the method of this embodiment trains a network model that is easy to fine-tune. In addition, because this embodiment does not impose any restrictions on the form of the meta-network, it can be adapted to any machine learning problem, such as classification problems, regression problems, and reinforcement learning problems.

[0041] In some embodiments, constructing a meta-learning training task set includes:

[0042] Get multiple training tasks T i , the multiple training tasks T i Belong to the same distribution p(T), each training task T i Including initial support set and the initial query set Here i is a natural number, indicating the sequence number of the training task.

[0043] For each training task T i The initial support set Perform data enhancement processing, such as using data enhancement methods such as rotation and mirroring to enhance the initial support set Perform enhancement processing to obtain the enhanced support set, and use the enhanced support set initial query set to construct the training task Ti The first data set and the second data set.

[0044] For example, the initial support set Divide equally into the first sub-dataset and the second subdataset Then the first sub-dataset and the second subdataset Can constitute a training task T i The first data set T i ', the first sub-dataset and the initial query set Construct the second data set T i ", that is, the first data set Second dataset For the first data set T i 'And the second data set T i "The support set, For the first data set T i 'The first query set, The second data set T i ” for the second query set.

[0045] In some embodiments, the model parameters of the meta-network are updated through multiple training tasks, including: for any training task T in the training task set T i Perform the following steps:

[0046] Step 1: Use the meta-network to train the task T i The first support set of The supporting sample data in is classified to obtain the classification results.

[0047] The meta-network is used to extract features from the supporting sample data to obtain feature data. According to the labels of the supporting sample data, the feature data with the same label are classified into one category to obtain multiple initial classifications. The feature data in each initial classification are averaged to obtain the classification result.

[0048] For example, the meta-network of this embodiment includes a feature extractor, which is a convolutional layer of a ResNet network (also known as a residual neural network), including multiple residual modules, each of which includes a convolutional layer, two residual blocks, and a maximum pooling layer. The feature extractor is used to train the task T i The first support set of Extract features from the supporting sample data, then divide features with the same label into one category, and calculate the average value of features in each category. Here m is the number of sample data in the class, and y(v) is the label of the sample data. Thus, multiple classifications can be obtained, and the set of these multiple classifications is represented as {v0,v1,…v n}, n is the number of categories.

[0049] Step 2: Use the meta-network to calculate the training task T i The first query set The Euclidean distance between the query sample data in and the classification results of the support sample data of the training task.

[0050] The first query set The query sample data in is input into the feature extractor to obtain the first query set The feature representation of the query sample data in , calculates each query sample data v and each classification result v j The Euclidean distance between

[0051] Step 3: Set the training task T i The Euclidean distance is used as the optimization target, and the model parameters of the meta-network are updated by the SGD (Stochastic Gradient Descent, also known as stochastic gradient descent) optimization algorithm to obtain the corresponding training task T i The updated model parameters.

[0052] According to the first query set The query sample data and each classification result v j The Euclidean distance between them constructs the distance vector f θ ={d1,d2,...d n}As the Softmax layer of the meta-network, the first query set From each feature to each classification result v j The shortest distance between them is the optimization goal, and the meta-network is trained, that is, the feature extractor of the meta-network is trained. For each training task T i Gradient on Update the model parameters θ to get the updated model parameters θ i ' and training mission T i The loss function

[0053] In this embodiment, the loss function of the meta-network under the optimization objective is obtained and gradient Calculate the training task T i The learning rate α, the gradient And the loss function The product of the three is used as the difference between the current model parameter θ of the meta-network and the product of the three as the updated model parameter θ i '.

[0054] here,

[0055]

[0056]

[0057] Here, θ and θ i ' are the model parameters of the meta-network when it is finer in this round and the updated model parameters, α is the training task T i The learning rate, x j For the first data set T i 'In the sample data, y j is x j .

[0058] This embodiment can update the meta-network's hyperparameters after one or more rounds of model parameter updates. In one embodiment, after each round of model parameter updates, the meta-network's hyperparameters are updated: the updated model parameters are used to update the optimization network's loss function; and the meta-network's hyperparameters are used as input to the optimization network, which then optimizes the hyperparameters.

[0059] In some embodiments, updating the loss function of the optimization network using the updated model parameters includes:

[0060] Use the updated model parameters to update the model parameters of the meta-network, that is, the updated model parameters θ i 'Assign values to the model parameters in the meta-network to complete the update of the model parameters. Use the meta-network to train the task T i The second data set T i The second support set The support sample data is classified to obtain the classification result; the training task T is calculated using the meta-network i The second query set The query sample data in the training task T i The Euclidean distance between the various classification results of the support sample data; the training task T i In the second data set T i "The Euclidean distance under the optimization target is used to obtain the loss function of the meta-network under the optimization target. Using the sum of the loss functions of multiple training tasks Update the loss function of the optimized network, for example, by optimizing the hyperparameters so that Minimize, that is Here l is the learning rate of the new task, N is the number of iterations, and b is the batch size.

[0061] This embodiment can use a proximal policy optimization algorithm to train the optimization network's loss function until appropriate hyperparameters are obtained. After obtaining appropriate hyperparameters and model parameters, the model parameters of the meta-network are trained based on the meta-initial parameters in a new task. The trained meta-network is then used for identification and discovery. The new task should conform to the task distribution p(T) described above, ensuring that the meta-initial parameters can quickly adapt to the new task, thereby improving the model's convergence speed and accuracy.

[0062] Since the second data set also needs to be classified and Euclidean distance calculated during the hyperparameter optimization process, this embodiment makes the first data set and the second data set of the training task have the same support set when constructing the training task to simplify the calculation steps in the hyperparameter optimization process.

[0063] To facilitate understanding of the above embodiments of the present invention, meta-learning is performed on the training task of time series signals as an example. For the time series signal task, a training task is constructed using multiple speech classification tasks or multiple voiceprint recognition tasks, and the data set of the training task is grouped and processed to obtain two data sets for the training task.

[0064] like Figure 2 As shown, an LSTM (Long Short-Term Memory) network is used to construct an optimization network. The LSTM network is then used to optimize the meta-network's hyperparameters. The LSTM network's softmax layer outputs the optimized hyperparameters, which are then used to update the meta-network. The meta-network also performs a memory-based loop update of model parameters. When the LSTM network's loss function falls below a preset value, the meta-network update is stopped, and the current hyperparameters and model parameters are used as the meta-initial parameters.

[0065] The embodiment of the present invention also provides a small sample learning device based on meta-learning, which has the same technical concept as the small sample learning method based on meta-learning in the aforementioned embodiment.

[0066] Figure 3 FIG. 4 shows a schematic diagram of a small sample learning device based on meta-learning according to an embodiment of the present invention. Figure 3 As shown, the small sample learning device 300 based on meta-learning can implement the small sample learning method based on meta-learning. The small sample learning device 300 based on meta-learning includes:

[0067] A data construction unit 310 is configured to construct a training task set for meta-learning, wherein the training task set includes a plurality of training tasks;

[0068] Initialization unit 320, used to initialize the model parameters and hyperparameters of the meta-network;

[0069] An updating unit 330 is configured to cyclically update the model parameters and hyperparameters of the meta-network, wherein the model parameters of the meta-network are updated using multiple training tasks, and the hyperparameters of the meta-network are optimized using the updated model parameters and a pre-built optimization network;

[0070] The stop updating unit 340 is used to stop optimizing the meta-network when a preset condition is met, and use the model parameters and hyperparameters when the optimization is stopped as meta-initial parameters. In the new task, the model parameters of the meta-network are trained based on the meta-initial parameters, and the trained meta-network is used for identification and discovery.

[0071] In some embodiments, each training task includes a first data set, the first data set includes a first support set and a first query set, and the updating unit 330 includes a model parameter updating module and a hyperparameter updating module:

[0072] Model parameter update module, used to update any training task T in the training task set T i Perform the following steps: Use the meta-network to train the task T i Classify the support sample data in the first support set and obtain the classification result; use the meta-network to calculate the training task T i The Euclidean distance between the query sample data in the first query set and the classification results of the support sample data of the training task; the training task T i The Euclidean distance is used as the optimization target, and the model parameters of the meta-network are updated by the SGD optimization algorithm to obtain the corresponding training task T i The updated model parameters.

[0073] In some embodiments, the model parameter update module is used to obtain the loss function and gradient of the meta-network under the optimization objective; calculate the training task T i The product of the learning rate, the gradient and the loss function is obtained; and the difference between the current model parameters of the meta-network and the product of the three is used as the updated model parameters.

[0074] In some embodiments, a hyperparameter updating module is used to update the loss function of the optimization network using the updated model parameters; the hyperparameters of the meta-network are used as input to the optimization network, and the hyperparameters are optimized through the optimization network.

[0075] In some embodiments, each training task further includes a second data set, the second data set including a second support set and a second query set, a hyperparameter updating module for updating the model parameters of the meta-network using the updated model parameters; and using the meta-network to update the model parameters of the training task T. iThe support sample data in the second support set is classified to obtain the classification result; the training task T is calculated using the meta-network i The query sample data in the second query set is consistent with the training task T i The Euclidean distance between the various classification results of the support sample data; the training task T i The Euclidean distance under the second data set is used as the optimization target, and the loss function of the meta-network under the optimization target is obtained; and the loss function of the optimized network is updated using the sum of the loss functions of multiple training tasks.

[0076] In some embodiments, the model parameter updating module is used to use the meta-network to extract features from the supporting sample data to obtain feature data; according to the labels of the supporting sample data, the feature data with the same label are classified into one category to obtain multiple initial classifications; the feature data in each initial classification are averaged to obtain a classification result.

[0077] In some embodiments, the model parameter updating module is used to extract features from the supporting sample data using a feature extractor of the meta-network, wherein the feature extractor includes multiple residual modules, each residual module includes a convolutional layer, two residual blocks and a maximum pooling layer.

[0078] In some embodiments, the data construction unit 310 is used to obtain multiple training tasks, where the multiple training tasks belong to the same distribution, and each training task includes an initial support set and an initial query set; perform data enhancement processing on the initial support set of each training task to obtain an enhanced support set; and use the enhanced support set initial query set to construct the first data set and the second data set of the training task.

[0079] It can be understood that the above-mentioned small sample learning device based on meta-learning can implement the various steps of the small sample learning method based on meta-learning provided in the aforementioned embodiments. The relevant explanations of the small sample learning method based on meta-learning are applicable to the small sample learning device based on meta-learning and will not be repeated here.

[0080] It should be noted that:

[0081] Figure 4 FIG2 shows a schematic diagram of an electronic device according to an embodiment of the present invention. Figure 4 At the hardware level, the electronic device includes a processor and memory, and optionally an internal bus and a network interface. The memory may include internal memory, such as high-speed random-access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for its services.

[0082] The processor, interface module, communication module and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0083] Memory is used to store computer-executable instructions. The memory provides computer-executable instructions to the processor through an internal bus.

[0084] The processor executes the computer-executable instructions stored in the memory and is specifically used to implement the following operations:

[0085] Constructing a meta-learning training task set, wherein the training task set includes multiple training tasks;

[0086] Initialize the model parameters and hyperparameters of the meta-network;

[0087] Cyclic updating of the model parameters and hyperparameters of the meta-network, wherein the model parameters of the meta-network are updated using multiple training tasks, and the hyperparameters of the meta-network are optimized using the updated model parameters and the pre-built optimization network;

[0088] When the preset conditions are met, the optimization of the meta-network is stopped, and the model parameters and hyperparameters at the time of stopping the optimization are used as the meta-initial parameters. In the new task, the model parameters of the meta-network are trained based on the meta-initial parameters, and the trained meta-network is used for identification and discovery.

[0089] The present invention Figure 1 The functions performed by the meta-learning-based small-sample learning method disclosed in the illustrated embodiment can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor or by software instructions.

[0090] An embodiment of the present invention further proposes a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by a processor, they implement the aforementioned small sample learning method based on meta-learning.

[0091] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0092] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0094] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0095] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0096] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented using any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0097] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0098] It should be understood that although the terms "first," "second," and "third" may be used to describe various types of information in the present invention, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, first information may be referred to as second information, and similarly, second information may be referred to as first information without departing from the scope of the present invention.

[0099] The above are merely embodiments of the present invention and are not intended to limit the present invention. It will be apparent to those skilled in the art that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are intended to be included within the scope of the claims of the present invention.

Claims

1. A small sample learning method based on meta-learning, characterized in that: include: Constructing a meta-learning training task set, wherein the training task set includes multiple training tasks; Initialize the model parameters and hyperparameters of the meta-network; Cyclic updating of the model parameters and hyperparameters of the meta-network, wherein the model parameters of the meta-network are updated using multiple training tasks, and the hyperparameters of the meta-network are optimized using the updated model parameters and the pre-built optimization network; When the preset conditions are met, the optimization of the meta-network is stopped, and the model parameters and hyperparameters at the time of stopping the optimization are used as the meta-initial parameters. The model parameters of the meta-network are trained based on the meta-initial parameters in the new task, and the trained meta-network is used for speech classification or voiceprint recognition; Optimize the meta-network's hyperparameters using the updated model parameters and the pre-built optimization network, including: Use the updated model parameters to update and optimize the network's loss function; The hyperparameters of the meta-network are used as the input of the optimization network, and the hyperparameters are optimized through the optimization network; Each training task also includes a second data set, which includes a second support set and a second query set. The updated model parameters are used to update and optimize the loss function of the network, including: Update the model parameters of the meta-network using the updated model parameters; Use the meta-network to train the task T i Classify the support sample data in the second support set to obtain the classification result; Use the meta-network to calculate the training task T i The query sample data in the second query set is consistent with the training task T i The Euclidean distance between the classification results of the supporting sample data; The training task T i Using the Euclidean distance under the second data set as an optimization target, obtaining a loss function of the meta-network under the optimization target; The loss function of the optimized network is updated using the sum of the loss functions of multiple training tasks.

2. The method according to claim 1, characterized in that Each training task includes a first data set, the first data set includes a first support set and a first query set, and the model parameters of the meta-network are updated through multiple training tasks, including: For any training task T in the training task set T i Perform the following steps: Use the meta-network to train the task T i Classify the support sample data in the first support set to obtain the classification result; Use the meta-network to calculate the training task T i The Euclidean distance between the query sample data in the first query set and the classification results of the support sample data of the training task; The training task T i The Euclidean distance is used as the optimization target, and the model parameters of the meta-network are updated by the SGD optimization algorithm to obtain the corresponding training task T i The updated model parameters.

3. The method according to claim 2, characterized in that The training task T i The Euclidean distance is used as the optimization target, and the model parameters of the meta-network are updated by the SGD optimization algorithm to obtain the corresponding training task T i The updated model parameters include: Obtain the loss function and gradient of the meta-network under the optimization objective; Calculate the training task T i The product of the learning rate, the gradient and the loss function; The difference between the current model parameters of the meta-network and the product of the three is used as the updated model parameters.

4. The method according to claim 2, characterized in that The meta-network is used to classify the support sample data in the first support set of each training task to obtain the classification results, including: Use the meta-network to extract features from the supporting sample data to obtain feature data; According to the labels of the supporting sample data, the feature data with the same label are classified into one category to obtain multiple initial classifications; The feature data in each initial classification is averaged to obtain the classification result.

5. The method according to claim 4, characterized in that The meta-network is used to extract features from the supporting sample data to obtain feature data, including: The feature extractor of the meta-network is used to extract features from the support sample data. The feature extractor includes multiple residual modules, and each residual module includes a convolutional layer, two residual blocks and a maximum pooling layer.

6. The method according to claim 1, wherein Construct a meta-learning training task set, including: Acquire multiple training tasks, where the multiple training tasks belong to the same distribution, and each training task includes an initial support set and an initial query set; Data augmentation is performed on the initial support set of each training task to obtain an enhanced support set; and the initial query set of the enhanced support set is used to construct the first data set and the second data set of the training task.

7. A small sample learning device based on meta-learning, characterized in that: include: A data construction unit, configured to construct a training task set for meta-learning, wherein the training task set includes a plurality of training tasks; Initialization unit, used to initialize the model parameters and hyperparameters of the meta-network; An updating unit, configured to cyclically update the model parameters and hyperparameters of the meta-network, wherein the model parameters of the meta-network are updated using multiple training tasks, and the hyperparameters of the meta-network are optimized using the updated model parameters and a pre-built optimization network; A stop updating unit, configured to stop optimizing the meta-network when a preset condition is met, use the model parameters and hyperparameters at the time of stopping the optimization as meta-initial parameters, train the model parameters of the meta-network based on the meta-initial parameters in a new task, and use the trained meta-network to perform speech classification or voiceprint recognition; The update unit is also used to: Use the updated model parameters to update and optimize the network's loss function; The hyperparameters of the meta-network are used as the input of the optimization network, and the hyperparameters are optimized through the optimization network; Each training task further includes a second data set, the second data set includes a second support set and a second query set, and the updating unit is further configured to: Update the model parameters of the meta-network using the updated model parameters; Use the meta-network to train the task T i Classify the support sample data in the second support set to obtain the classification result; Use the meta-network to calculate the training task T i The query sample data in the second query set is consistent with the training task T i The Euclidean distance between the classification results of the supporting sample data; The training task T i Using the Euclidean distance under the second data set as an optimization target, obtaining a loss function of the meta-network under the optimization target; The loss function of the optimized network is updated using the sum of the loss functions of multiple training tasks.

8. An electronic device comprising: processor; as well as A memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the meta-learning-based few-shot learning method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Classification model training and classification method and device, computer equipment and storage medium

    CN113299346A

  • Task importance perception element learning method for small sample image recognition

    CN113947133A

  • Method and apparatus for training neural network model

    WO2021051987A1