A Multi-Terminal Collaborative Training Algorithm and System Incorporating Meta-Learning

By introducing meta-learning algorithms into federated learning, optimizing client model training and server fusion, the problems of low model transferability and accuracy are solved, and efficient model training and communication optimization are achieved.

CN114330464BActive Publication Date: 2025-07-25NANJING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011033398.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-27
Publication Date
2025-07-25
Estimated Expiration
2040-09-27

AI Technical Summary

Technical Problem

In the existing federated learning, due to the limited amount of client data, the trained models have poor mobility, low accuracy, and many communication times, and long training time when fusion.

Method used

Meta-learning algorithm is introduced in federated learning. The client uses local data samples to adjust the training model, the server performs model fusion, and evaluates the model accuracy through the test data set, optimizes model parameters, and reduces the number of communications.

Benefits of technology

It improves the mobility and accuracy of the model, reduces the number of communications and training time, and saves resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114330464B_ABST
    Figure CN114330464B_ABST
Patent Text Reader

Abstract

The present application discloses a multi-terminal collaborative training algorithm and system integrating meta-learning, including that a client loads a training model located locally and initializes the weight parameters of the network; the client uses the data samples stored locally and adjusts the training model by using a meta-learning algorithm to obtain an adjusted model; and a server performs a fusion operation on the adjusted models transmitted from multiple clients to obtain an average model. Based on federated learning, the method provided by the present application introduces a meta-learning algorithm for small-sample scenarios (i.e., a small amount of training data) in each client, can efficiently obtain meta-information in a small number of samples during training, and the trained model also has good transferability for new data. After the client models trained by this method are fused on the server side, they also have a high processing accuracy for the data sets of other clients.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence, and particularly relates to a multi-terminal collaborative training algorithm and system integrating meta-learning. Background Art

[0002] Nowadays, any artificial intelligence (AI) project may involve multiple fields, so it is necessary to integrate data from various companies and departments. However, in practical applications, due to the increasing attention to data ownership and privacy by all parties, the security management of user privacy and data has become increasingly strict, making it almost impossible to integrate data scattered in various places and institutions. Under such circumstances, training based on big data is a necessary guarantee for high precision in a certain AI project. Therefore, it is required to design a machine learning framework that meets the privacy supervision requirements, and the federated learning algorithm came into being.

[0003] In federated learning, a common algorithm is Figure 1 As shown, each client uses local data to train its own model respectively, and then transmits the trained models to the server for fusion, and then transmits the fused model back to each client for further training. Since the local data in each client is often very limited in number, the models obtained by using the training algorithm often overfit the local data. In this way, when the models from different clients are fused on the server side, each model cannot quickly adapt to the data processing on other clients, resulting in limited overall accuracy and requiring more rounds of communication to obtain a more thorough model fusion.

[0004] In the prior art, in order to minimize the number of communications as much as possible, the commonly used method is to achieve it by restricting the number of local clients that need to communicate with the server, or to use SGD (federated averaging algorithm) to obtain the test loss on the local client and communicate with the server to achieve the effect of joint training. However, although the calculation efficiency of SGD is high, this method requires a large amount of training to generate a relatively accurate model. For most clients, the local data volume far cannot reach the standard required by SGD. Therefore, it is necessary to introduce a more efficient algorithm in the local training process of the client to better utilize the relatively small amount of local data to train an improved algorithm with transferability. Summary of the Invention

[0005] The present application provides a multi-terminal collaborative training algorithm and system integrating meta-learning to solve the problems in the prior art that the models trained by clients with a small amount of data have poor transferability and low fusion accuracy.

[0006] In a first aspect, the present application provides a multi-terminal collaborative training algorithm integrating meta-learning, including:

[0007] The client loads the locally stored training model and initializes the weight parameters of the network;

[0008] The client uses the locally stored data samples and adopts a meta-learning algorithm to adjust the training model to obtain an adjusted model;

[0009] The server performs a fusion operation on the adjusted models transmitted from multiple clients to obtain an average model.

[0010] In some embodiments, after obtaining the average model, the algorithm further includes:

[0011] The server obtains a test data set containing the data samples stored by all clients, and evaluates the accuracy of the average model according to the test data set to obtain an evaluation result;

[0012] If the evaluation result meets the requirements, stop data communication and training;

[0013] If the evaluation result does not meet the requirements, re-execute the step of the client using the locally stored data samples and adopting a meta-learning algorithm to adjust the training model to obtain an adjusted model.

[0014] In some embodiments, the data samples in the test data set are divided into multiple data packets according to different categories. Among them, each data packet is represented by N-way K-shot, where N is the number of categories randomly selected from each data packet, way is the category, K is the number of data samples included in each category, and shot is the data unit.

[0015] In some embodiments, the step of adopting a meta-learning algorithm to adjust the training model includes:

[0016] The client randomly extracts a data packet from the locally stored data samples;

[0017] Use the inner loop and the outer loop to update the model parameters of the training model.

[0018] In some embodiments, updating the model parameters of the training model using the inner loop includes:

[0019] Establish multiple tasks, each task adopts the rule of gradient descent, and the updated parameter θ i ’; where i represents the i-th task;

[0020] According to the updated parameter θ i ’ calculate the cross-entropy loss L Ti , the cross-entropy loss L Ti is obtained by adding the updated parameters θ i ’ obtained under all tasks.

[0021] In some embodiments, the outer loop updates the model parameters of the training model according to the following formula:

[0022]

[0023] where θn is the model parameter of the adjusted model, β is the learning rate, T i refers to the i-th task, and ΣTi(*) refers to summing over tasks, refers to using the model with parameter θ i '.

[0024] In a second aspect, the present application also provides a system corresponding to the method provided in the first aspect.

[0025] Based on federated learning, the method provided by the present application introduces a meta-learning algorithm for small-sample scenarios (i.e., a small amount of training data) on each client. During training, meta-information in a small number of samples can be efficiently obtained, and the trained model also has good transferability for new data. The client models trained using this method have high processing accuracy for the data sets of other clients after being fused on the server side.

[0026] Due to the good transferability of the models trained by the clients, the number of communication times required for model fusion is significantly reduced. For each client, the same model accuracy can be obtained with fewer training times, shorter training time, and lower energy consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0028] Figure 1 is a schematic diagram of a common federated learning algorithm in the prior art;

[0029] Figure 2 is a flowchart of a multi-terminal collaborative training algorithm integrating meta-learning of the present application;

[0030] Figure 3 is Figure 2 a decomposition step diagram of step S200 in the algorithm shown;

[0031] Figure 4 is a flowchart of a multi-terminal collaborative training algorithm integrating meta-learning of the present application in another embodiment;

[0032] Figure 5Flowchart of one embodiment of the method provided in this application. Detailed implementation manners

[0033] Given that small sample learning and federated learning objectives overlap, that is, to train a high-precision integrated model on the premise of protecting the data privacy of client-side devices, and at the same time, the meta-learning training scheme in small samples can help the model improve its generalization ability on unseen data. Therefore, this application considers combining the two, introducing meta-learning into the client-side training of federated learning, and improving the performance of multi-terminal collaborative training in federated learning. The performance improvement is divided into three aspects: First, reduce the overall number of communications while ensuring learning performance; Second, reduce the number of end-side training times while ensuring learning performance; Third, improve the accuracy of the integrated model under the same training consumption. The solution proposed by this invention is the first effective solution to introduce end-side meta-learning into federated learning.

[0034] In the solution provided in this application, the federated learning mentioned refers to a learning technology that allows users to obtain the benefits of a shared model from this rich data without the need to centrally store the data. This method also allows us to utilize the inexpensive computing available at the network edge to scale the learning task. The characteristics of federated learning suitable for tasks are: First, training on real data from mobile devices has obvious advantages over training on proxy data usually available in data centers; Second, the data processed is privacy-sensitive or large-scale, so it is not suitable to record it in the data center for model training; Third, for supervised tasks, the labels on the dataset can be naturally inferred from the interaction between users and their devices. Since federated learning cannot independently solve the problem of less data on the client side, this application provides an improved algorithm based on federated learning.

[0035] See Figure 2 , which is a schematic structural diagram of a multi-terminal collaborative training algorithm integrating meta-learning in this application;

[0036] As can be seen from Figure 2 When a multi-terminal collaborative training algorithm integrating meta-learning provided in the embodiment of this application is applied to each client, it includes:

[0037] S100: The client loads the training model located locally and initializes the weight parameters of the network;

[0038] In this embodiment, there can be multiple clients communicating with the server, and each client can follow this method; each client (end side) usually has different training models configured locally for training local data samples. Before reading the data samples in this application, it is necessary to first initialize the weight parameters in the network to keep the training model in its initial setting.

[0039] S200: The client uses the data samples stored locally and adjusts the training model by using a meta-learning algorithm to obtain an adjusted model.

[0040] In this embodiment, the data samples used by the client refer to a small number of data samples stored locally by the client. Different from other methods in the prior art, the method of the present application is particularly applied in the case of a low number of samples. According to the different forms of data samples, the number of samples will be set to a relatively low order of magnitude accordingly. For example, if the data samples are pictures, the small number of data samples here refers to dozens to thousands of pictures, while the large number of data samples in the conventional technology generally refers to tens of thousands of pictures; if the data samples are represented by data size, the small amount of data here can refer to data with a size of several Kb to Mb, while the large number of data samples in the conventional technology generally refers to data with a magnitude of GB or above, and so on.

[0041] Further, the above data samples may be originally stored in the client, or may be obtained by the client in other ways, such as the client collecting by itself from the scene, user input, etc., or may be specified and sent by the server. If it is specified and sent by the server, before step S200, the method of the present application further includes a data acquisition step, that is, the server sends data packets containing data samples to multiple clients respectively. It should be noted here that the data packets sent by the server to each client are not repeated and may be complementary to each other.

[0042] For the extremely limited data samples on the client side, the present application first uses a meta-learning algorithm to adjust the original training model of the client, so that the model parameters sent by each client to the server are not the original model parameters, but parameters that are more conducive to fusion.

[0043] Among them, meta-learning belongs to one of the few-shot learning methods. In recent years, the classification of few-shot learning has developed rapidly. Facing numerous classification tasks, a model can be trained to meet the task requirements. There are many methods of meta-learning. For the greatest applicability, the mechanism of meta-learning is the generality of tasks, that is, in the face of different tasks, there is no need to build different models, and the same set of learning algorithms can be used to solve a variety of different tasks. Define the learnable parameters θ of a model. In the face of different tasks, the corresponding tasks can be solved by changing the value of the parameter θ. The value of the parameter θ can be learned by a meta-learner. When facing different tasks, the value of θ is continuously updated by the gradient descent method according to the loss function, so that the model continuously approaches the model that can solve this task. When the value of θ finally converges, we believe that the meta-learner has learned a better parameter θ, enabling the model to adaptively solve the corresponding task. This algorithm has the characteristic of high efficiency because it does not introduce other parameters for the learner, and the strategy for training the learner uses known optimization processes (such as gradient descent, etc.) instead of building one from scratch.

[0044] Specifically, refer to Figure 3 , the steps of adjusting the training model by using the meta-learning algorithm include:

[0045] S210: The client randomly extracts a data packet from the data samples stored locally; each data packet is represented by N-way K-shot, where N is the number of categories randomly extracted from each data packet, way is the category, K is the number of data samples included in each category, and shot is the data unit. For example, 5-way 5-shot means randomly extracting 5 categories from the remaining data samples each time, and then extracting 5 data that have not been extracted from the data included in each category, so as to form 5-way 5-shot.

[0046] S220: Use the inner loop and the outer loop to update the model parameters of the training model.

[0047] In this embodiment, the inner loop is also called the local loop, that is, the process of updating the model parameters is executed inside the client. The outer loop is also called the global loop, that is, the process of updating the model parameters is executed in the entire system including multiple clients and a server.

[0048] The inner loop is divided into multiple tasks. Each task uses the rule of gradient descent, based on the initial parameters of the model, updates to obtain updated parameters, and calculates the model loss using the updated parameters. The specific process is as follows:

[0049] First, obtain the local training model;

[0050] In each round of loop, multiple tasks are established. Each task uses the rule of gradient descent to evaluate the model loss of the extracted data packet and obtains the updated parameter θ based on the original parameter θ of the training model. i ’;

[0051] According to the updated parameter θ i ’, calculate the cross-entropy loss L Ti , and the cross-entropy loss L Ti is obtained by summing the updated parameters θ i ’ obtained under all tasks;

[0052]

[0053] where i represents the i-th task; α is the learning rate; L Ti is the cross-entropy loss;

[0054] The outer loop is to calculate the parameters for updating the original training model using the following formula after waiting for all the tasks in the inner loop to end:

[0055]

[0056] where θn is the model parameter of the adjusted model, T i refers to the i-th task, ΣTi(*) refers to summing over the tasks, refers to the model using the parameter θ i ’, and β is the learning rate.

[0057] It should be noted that in some feasible embodiments, the client that executes the outer loop operation is not all the clients that are communicatively connected to the server in the system. That is, in each outer loop, a certain proportion of clients can be randomly selected to execute the inner loop. For example, 20% of the clients are selected for local training, and the training results of this part of the data are used to calculate and update the model parameters; in the next outer loop, 20% of the clients are randomly selected from other clients to execute the inner loop to obtain updated model parameters; this is beneficial to reducing the single consumption of the system and also reducing the number of communications.

[0058] S300: The server performs a fusion operation on the adjusted models transmitted from multiple clients to obtain an average model.

[0059] In this step, after the server receives the adjusted training models (the training models after updating the parameters) from each client, it then performs a fusion operation according to the common means in the prior art. Specifically, this fusion operation can adopt various ways in the prior art, such as weighted average operation, L2 norm operation of each model, etc.; the specific means are not limited in this embodiment, and it should be considered that the methods for performing the fusion operation on the model can all be applied to this application.

[0060] The average model obtained in step S300 is obtained based on the fusion of multiple clients, but it may not be able to have high accuracy for the newly added small amount of data of each client after only one fusion. Figure 4 In some of the embodiments shown, it is necessary to add a step of evaluating the average model accuracy:

[0061] S400: The server obtains a test data set containing data samples stored in all clients, evaluates the accuracy of the average model based on the test data set, and obtains an evaluation result; wherein the test data set is equivalent to integrating the data samples stored in each client, and has the same composition as the data samples. The test data set is also divided into multiple data packets according to the categories of the data samples, wherein each data packet is represented by N-way K-shot, N is the number of categories randomly selected in each data packet, and K is the number of data samples contained in each category.

[0062] Using the test data set to evaluate the accuracy of the average model is equivalent to judging whether the average model can be applied to all data samples in the test data set. If there are data samples with lower accuracy, the average model is considered to not meet the requirements and further adjustments are required. If all requirements are met, the average model can be considered to be the final model and the training and communication processes can be stopped to save resource consumption and improve efficiency.

[0063] S410: If the evaluation result satisfies the requirement, stop data communication and training;

[0064] S420: If the evaluation result does not meet the requirements, it means that the average model at this time needs to be further adjusted, then the aforementioned steps S200-S300 are re-executed, the data packets are re-extracted, and the inner loop and outer loop operations are executed.

[0065] In this application, a meta-learning algorithm suitable for small sample learning is introduced on the client side, so that the model on the terminal side can be adjusted to the mode that best suits the new category. Even if the addition of a new category causes the fused model to not meet the requirements, it can be adjusted in a few simple steps. That is to say, in actual applications, the above step S420 is looped very few times, and it may only take a few cycles to stop the data communication and training process.

[0066] refer to Figure 5, which is a flowchart of one embodiment of the method provided in this application. First, the server can number the dataset for training by category and sample to form data packets for the training set. Each data packet is in the 5-way 5-shot form. Each time the data packets are divided, 5 categories are randomly selected from the remaining data, and 5 data that have not been selected are drawn from 500 data in each category to form 5-way 5-shot. A total of 50 test data packets can be formed. Each data packet is in the 5-way 5-shot form, and the method is similar to that of the training set data packets, but it does not need to be assigned to the client for the time being.

[0067] After the data packets are divided, part of the data packets in the training set are assigned to 10 clients, and the data packets between the clients do not repeat.

[0068] The training is divided into an inner loop (local loop) and an outer loop (global loop). In the outer loop, the inner loops of each client are carried out in parallel. When the outer loop starts, the server can communicate the updated model parameters to each client at the same time. The client performs the inner loop and the outer loop according to the data packets stored locally and the model parameters, and continuously updates its own model. When the inner and outer loops end, the model of the client is evaluated once on the test set. If the new model meets the requirements, the training and communication are stopped. If it does not meet the requirements, the new model is used to perform the inner and outer loops again.

[0069] As can be seen from the above technical solutions, this application provides a multi-terminal collaborative training algorithm integrating meta-learning, including that the client loads the training model located locally and initializes the weight parameters of the network; the client uses the data samples stored locally and adopts the meta-learning algorithm to adjust the training model to obtain the adjusted model; the server performs a fusion operation on the adjusted models transmitted from multiple clients to obtain the average model. The method provided in this application, on the basis of federated learning, introduces the meta-learning algorithm for the small-sample scenario (i.e., a small amount of training data) in each client, can efficiently obtain the meta-information in a small amount of samples during training, and the trained model also has good transferability for new data. The client models trained by this method have high processing accuracy for the datasets of other clients after being fused on the server side.

[0070] Corresponding to the above algorithm, this application also provides a multi-terminal collaborative training system integrating meta-learning, including:

[0071] A server and multiple clients communicatively connected to the server;

[0072] The client is configured to execute the following methods:

[0073] Load the training model located locally and initialize the weight parameters of the network;

[0074] Using the data samples stored locally, the training model is adjusted by a meta - learning algorithm to obtain an adjusted model;

[0075] Send the adjusted model to the server;

[0076] The server is configured to execute the following method:

[0077] Perform a fusion operation on the adjusted models transmitted from multiple clients to obtain an average model.

[0078] Furthermore, the server is also configured to:

[0079] Obtain a test data set containing the data samples stored by all clients, and evaluate the accuracy of the average model according to the test data set to obtain an evaluation result;

[0080] If the evaluation result meets the requirements, stop data communication and training;

[0081] If the evaluation result does not meet the requirements, send a control instruction to the corresponding client to make the client re - execute the step of using the data samples stored locally and adjusting the training model by a meta - learning algorithm to obtain an adjusted model.

[0082] Furthermore, the client is configured with:

[0083] An extraction unit for randomly extracting a data packet from the data samples stored locally;

[0084] A parameter update unit for updating the model parameters of the training model using inner - loop and outer - loop.

[0085] Updating the model parameters of the training model using the inner - loop includes:

[0086] Establish multiple tasks, each task using the rule of gradient descent to obtain updated parameters θ i ’; where i represents the i - th task;

[0087] According to the updated parameters θ i ’ calculate the cross - entropy loss L Ti , and the cross - entropy loss L Ti is obtained by summing the updated parameters θ i ’ obtained under all tasks;

[0088] The outer - loop updates the model parameters of the training model using the following formula:

[0089]

[0090] ​​​​​Among them, θn is the model parameter of the adjusted model.

[0091] For the functions and effects of the system provided in this embodiment, refer to the description in the foregoing method embodiment, which will not be elaborated herein.

[0092] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present invention. This application is intended to cover any variations, uses, or adaptations of the present invention, which follow the general principles of the present invention and include known common knowledge or conventional technical means in the technical field not disclosed by the present invention. The specification and examples are only regarded as exemplary, and the true scope and spirit of the present invention are pointed out by the following claims.

Claims

1. A multi-terminal collaborative training algorithm integrating meta-learning, characterized in that, Including: The client loads the locally located training model and initializes the weight parameters of the network; The client uses the data samples and adopts the meta-learning algorithm to adjust the training model to obtain an adjusted model; wherein, the data samples are from the data packets sent by the server to each client, and the data packets sent by the server to each client are not repeated; The server performs a fusion operation on the adjusted models transmitted from multiple clients to obtain an average model; Among them, the steps of adjusting the training model by using the meta-learning algorithm include: The client randomly extracts a data packet from the data samples; Inside the client, the model parameters of the training model are updated using the inner loop, and the model loss is calculated using the updated parameters; When all the clients performing the inner loop complete the inner loop, a certain proportion of the clients are randomly selected to update the model parameters of the training model using the outer loop to obtain the adjusted training model; After obtaining the average model, the algorithm further includes: The server evaluates the accuracy of the average model according to the test data set containing the data samples sent to all clients to obtain an evaluation result; If the evaluation result meets the requirements, stop data communication and training; If the evaluation result does not meet the requirements, re-execute the step of the client using the data samples and adopting the meta-learning algorithm to adjust the training model to obtain an adjusted model.

2. The multi-terminal collaborative training algorithm integrating meta-learning according to claim 1, characterized in that, The data samples in the test data set are divided into multiple data packets according to different categories. Among them, each data packet is represented by N-way K-shot, where N is the number of categories randomly extracted from each data packet, way is the category, K is the number of data samples included in each category, and shot is the data unit.

3. A multi-terminal collaborative training algorithm integrating meta-learning according to claim 1, characterized in that Updating the model parameters of the training model using the inner loop includes: Establish multiple tasks, and for each task, based on the original parameters θ of the training model, obtain the updated parameters θ using the rule of gradient descent i '; where i represents the i-th task; According to the updated parameter θ i ’ calculate the cross-entropy loss L Ti , where the cross-entropy loss L Ti is obtained by summing up the updated parameters θ i ’ under all tasks.

4. A multi-terminal collaborative training algorithm integrating meta-learning according to claim 3, characterized in that The model parameters of the training model are updated using the outer loop according to the following formula: Among them, θn is the model parameter of the adjusted model, β is the learning rate, and T i refers to the i-th task, and ΣTi(*) refers to the summation of tasks. refers to using the parameter θ i 's model.

5. A multi-terminal collaborative training system integrating meta-learning, characterized in that, The system includes a server and multiple clients communicatively connected to the server; The client is configured to execute the following method: Load the locally located training model and initialize the weight parameters of the network; Use the data samples and adopt the meta-learning algorithm to adjust the training model to obtain an adjusted model; wherein, the data samples are from the data packets sent by the server to each client, and the data packets sent by the server to each client are not repeated; Send the adjusted model to the server; Among them, the steps of adjusting the training model by using the meta-learning algorithm include: The client randomly extracts a data packet from the data samples; Inside the client, the model parameters of the training model are updated using the inner loop, and the model loss is calculated using the updated parameters; When all the clients performing the inner loop complete the inner loop, a certain proportion of the clients are randomly selected to update the model parameters of the training model using the outer loop to obtain the adjusted training model; The server is configured to execute the following method: Perform a fusion operation on the adjusted models transmitted from multiple clients to obtain an average model; The server is further configured to: Evaluate the accuracy of the average model according to the test data set containing the data samples stored by all clients to obtain an evaluation result; If the evaluation result meets the requirements, stop data communication and training; If the evaluation result does not meet the requirements, send a control instruction to the corresponding client to make the client re - execute the step of using the locally stored data samples and adjusting the training model with a meta - learning algorithm to obtain an adjusted model.

6. The multi-terminal collaborative training system integrating meta-learning according to claim 5, characterized in that, Updating the model parameters of the training model using the inner loop includes: Establish multiple tasks, and for each task, adopt the rule of gradient descent to obtain the updated parameter θ based on the original parameter θ of the training model i '; where i represents the i-th task; According to the updated parameter θ i ’ calculate the cross-entropy loss L Ti , where the cross-entropy loss L Ti is obtained by summing up the updated parameters θ i ’ obtained under all tasks; The outer loop updates the model parameters of the training model and is obtained by the following formula: where θn is the model parameter of the adjusted model, β is the learning rate, and T i refers to the i-th task, and ΣTi(*) refers to the summation of tasks. refers to using the parameter θ i 's model.

Citation Information

Patent Citations

  • A data processing method an device and apparatus

    CN109034175A

  • Method for establishing data analysis model

    CN111190487A