A Model Fine-Tuning and Head Aggregation Method in Federated Learning

By conducting model head training on the client and global representation aggregation on the central server, combining model fine-tuning and head aggregation methods, the model personalization and generalization performance problems caused by data heterogeneity in federated learning are solved, and personalized performance and global model are achieved.

CN114936595BActive Publication Date: 2025-07-11SICHUAN ARTIFICIAL INTELLIGENCE RESEARCH INSTITUTE (YIBIN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210488179.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-06
Publication Date
2025-07-11
Estimated Expiration
2042-05-06

AI Technical Summary

Technical Problem

When the existing federated learning method faces the problem of non-independent and homogeneous distribution of data, it is difficult to improve the personalized performance of the client model while ensuring the generalization performance of the global model. Especially when data heterogeneity increases, the model may diverge on local data, affecting the enthusiasm of users to participate and the global model performance declines.

Method used

By conducting model head training on the client and performing global representation aggregation on the central server, a generalized global model adapted to different clients is generated. Combined with model fine-tuning and head aggregation methods, a model with personalized and generalized capabilities is provided to the client and the server respectively.

Benefits of technology

It improves the performance of personalized federated learning, and provides a global model with generalization capabilities for the server side, solves the model convergence problem caused by data heterogeneity, and enhances the generalization capabilities of the global model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114936595B_ABST
    Figure CN114936595B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for model fine-tuning and head aggregation in federated learning, comprising the following steps: S1: receiving, by a client, a deep learning model sent by a central server, and performing head training on the deep learning model at the client; S2: performing global representation aggregation on the deep learning model after head training in the central server to generate a generalized global model to adapt to different clients. The present invention proposes a new method for model fine-tuning and head aggregation in federated learning. This method first improves the traditional federated learning training method by using the model fine-tuning method, provides different personalized head models for each client, and improves the performance of personalized federated learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of federated learning, and specifically relates to a model fine-tuning and head aggregation method in federated learning. Background Art

[0002] With the continuous development of deep learning technology, the extensive use of modern mobile devices, and the maturity of technologies such as the Internet of Things, the demand for model computing and prediction on edge devices is increasing continuously. The growing number of users on these edge devices is very important for enhancing the performance of the current deep models on the user side. Under the traditional machine learning conditions, each device needs to upload local data to the central server for model training. Further, in the face of a large amount of data, in order to speed up the training speed, using distributed machine learning for distributed training on multiple nodes is a solution. However, like the traditional machine learning method, the distributed machine learning method does not consider the protection of user privacy data on edge devices and how to handle the problem of non-independent and identically distributed data among different users. This training strategy where the central server can access all data may lead to the leakage of user data and increase the risk of being attacked.

[0003] Against this background, the concept of federated learning has gradually emerged. Starting from the protection of user privacy, it defines a decentralized training process, enabling users to store data locally and jointly train a well-performing model without uploading. Specifically, taking the first federated learning algorithm FedAVG as an example, its federated learning process is generally divided into three parts: a) The central server sends the global model to the participating training clients; b) Each client updates the model on local data and sends it back to the client after completion; c) The central server receives all the updated models sent back and aggregates them into a new global model. Repeat the above steps until the model converges.

[0004] It should be emphasized that FedAVG does not converge or perform well under all conditions. Due to the diversity of data categories and the non-uniformity of sample sizes among different clients, the data distribution varies significantly across clients, that is, there is the problem of non-independent and identically distributed data. This data heterogeneity problem is a major challenge within the theoretical framework of federated learning. As the sample sizes and data distribution differences of client data increase, that is, the degree of non-independent and identically distributed (non-i.i.d) increases, the convergence difficulty of the global model in federated learning rises, and even if the model converges, its performance will be significantly reduced. From the user's perspective, when the degree of non-i.i.d among client data increases, the trained global model may even diverge directly on local data, which directly dampens users' enthusiasm for participating in federated learning. Therefore, it is a natural idea to consider generating personalized models adapted to their data distributions for each client.

[0005] Personalized Federated Learning (PFL) is precisely a sub-direction of research on federated learning algorithms that generates personalized models for each user under heterogeneous data conditions. Starting from the user perspective, PFL endeavors to improve the performance of the model on its local data distribution for each client through federated learning and personalized methods. Recently, there have been various studies on federated learning personalization, including using multi-task learning methods, meta-learning, hybrid global and local models, and using representation learning and personalized layer methods, etc. These methods have all generated appropriate local models for clients under data heterogeneous conditions and achieved relatively excellent performance in tests.

[0006] However, it should be noted that as the degree of personalization of the client local model increases, its generalization performance will continuously decline. Most of the current PFL algorithms only start from the client perspective, only seeking to enhance the personalization ability and generalization ability of the model on local data, and ignoring the provision of a global model with generalization performance for the server. Summary of the Invention

[0007] To solve the above problems, the present invention proposes a method for model fine-tuning and head aggregation in federated learning.

[0008] The technical solution of the present invention is: A method for model fine-tuning and head aggregation in federated learning includes the following steps:

[0009] S1: Receive the deep learning model sent by the central server through the client, and perform head training on the deep learning model at the client;

[0010] S2: Perform global representation aggregation on the deep learning model after head training in the central server to generate a generalized global model to adapt to different clients.

[0011] Further, step S1 includes the following sub-steps:

[0012] S11: Receive the deep learning model sent by the central server through the client. Take the fully connected layer at the top of the deep learning model as the head of the deep learning model, take the remaining body of the deep learning model as the global representation of the deep learning model, and form the complete model of the client with the head and global representation of the deep learning model;

[0013] S12: Use the complete model of the client to train the local data of the client for τ sync rounds to obtain gradients;

[0014] S13: Update the head and global representation of the deep learning model according to the gradients;

[0015] S14: Keep the updated global representation unchanged and update the head of the deep learning model to complete the head training.

[0016] Further, in step S11, the expression of the objective function of the deep learning model is where w represents the global representation of the deep learning model, h i represents the head of the deep learning model, F(w, h) represents the overall optimization objective function of the model, f i represents the local model optimization objective function on the i-th client, h represents the head of the global model, and N represents the number of clients;

[0017] In step S11, the expression of the complete model of the client is (w, h i ).

[0018] Further, in step S12, the gradient is calculated as follows:

[0019]

[0020] where B represents the training batch size, represents the gradient calculation function of the i-th client model, represents the global representation parameter, represents the model head of the i-th client in the k-th federated training round, represents the training sample under the current training round.

[0021] Further, in step S13, the calculation formulas for updating the head h i and global representation w of the deep learning model are as follows:

[0022]

[0023] where, represents the global representation of the i-th client in the k-th round of federated training at the (t + 1)-th local training round, represents the model head at the (t + 1)-th training round, represents the global representation at the t-th training round, represents the model head at the t-th training round, and η represents the learning rate, represents the gradient.

[0024] Furthermore, in step S14, update the head h of the deep learning model i The calculation formula is:

[0025]

[0026] where represents, represents, represents, η represents the learning rate, represents the gradient.

[0027] Furthermore, step S2 includes the following sub-steps:

[0028] S21: Return the updated global representation and head to the central server, aggregate the global representation on the central server, and use the head dictionary of the central server to determine whether the storage space of the client is empty. If so, directly store the updated head in the head dictionary; otherwise, replace the returned head with the latest head;

[0029] S22: Aggregate all the heads in the head dictionary to generate a generalized head;

[0030] S23: Concatenate the generalized head and the aggregated global representation to generate a generalized global model to adapt to different clients.

[0031] Furthermore, in step S21, the calculation formula for aggregating the global representation of the deep learning model is:

[0032]

[0033] where w k represents the global representation in the k-th round of federated training, and N k represents the number of clients in the k-th round of federated training, represents the global representation of the i-th client in the k-th round of federated training;

[0034] In step S21, the calculation formula for replacing the returned head:

[0035]

[0036] Among them, {h0, …, h N} represents a dictionary storing the model heads, represents the model head of the i-th client in the k-th round of federated training, and k represents the number of rounds of federated training.

[0037] Furthermore, in step S22, the generalization head h global has the following expression:

[0038]

[0039] Among them, N represents the number of clients, and h i represents the parameters of the deep learning model head.

[0040] The beneficial effects of the present invention are as follows: The present invention proposes a new method for model fine-tuning and head aggregation in federated learning. This method first improves the traditional federated learning training method by using model fine-tuning, provides different personalized head models for each client, and improves the performance of personalized federated learning. At the same time, after completing the personalized federated learning training process, the present invention aggregates the personalized heads to provide a globally generalized model for the server side. On the basis of improving the performance of the personalized federated learning algorithm, the present invention takes into account the server side's demand for a globally generalized model and improves the comprehensive performance of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 is a flowchart of the model fine-tuning and head aggregation method;

[0042] Figure 2 is a structural diagram of the model fine-tuning and head aggregation method;

[0043] Figure 3 is a schematic diagram showing the performance improvement of the FedHA module for FedFT in global testing;

[0044] Figure 4 is a schematic diagram showing the performance improvement of the FedHA module for FedRep in global testing. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] The following further describes the embodiments of the present invention with reference to the accompanying drawings.

[0046] As Figure 1 shown, the present invention provides a method for model fine-tuning and head aggregation in federated learning, including the following steps:

[0047] S1: Receive the deep learning model sent by the central server through the client and perform head training on the deep learning model at the client;

[0048] S2: Aggregate the global representations of the deep learning model after head training in the central server to generate a generalized global model to adapt to different clients.

[0049] In traditional federated learning, there are mainly two types of participants: the central server responsible for distributing and aggregating models, and each client that receives the model and uses local data for model training. The requirements of these two different parties for the model are also different. The central server hopes to combine multiple clients to provide itself with a global model with good generalization ability, while each client hopes to obtain a personalized model that can adapt to its own data. Personalized federated learning starts from the perspective of the client, improves the personalization ability of the model, and makes the model adapt to different clients.

[0050] As Figure 2 shown, the present invention is mainly divided into a model head fine-tuning part (abbreviated as FedFT) and a model head aggregation part (abbreviated as FedHA). The FedFT part can be regarded as a new improved personalized federated learning algorithm, which can generate different model heads trained for different clients, and its purpose is also to improve the personalization ability of the model on different clients. The FedHA part will run after the FedFT part. At this time, each client already has a trained model head. FedHA will aggregate the model heads and then splice them with the already trained model body part to provide the central server with a global model with generalization ability.

[0051] In the embodiment of the present invention, the local model training process is set to two stages. In the first stage, use the complete model (w, h i ) to train for τ sync rounds on the client's local data. At this time, synchronously update the global representation part w and the model head h i . During the training process, first calculate and obtain the gradients on the local data . After obtaining the gradients, w and h i can be synchronously updated. In the second stage, the update method of the parameters is very similar to that in the first stage, but the difference and the key point is that at this time, the global representation part w is frozen and the model head h i is fine-tuned. In these two update stages, the most important setting is that τ head should be much larger than τ sync . Specifically, only synchronously update the global representation part w and the model head h i for very few rounds. In most local update rounds, mainly perform fine-tuning on the model head h iThe fine-tuning process. The importance of this setting is that a small number of synchronous update processes will not cause the global representation w to overfit to the local data, enabling it to still maintain a high generalization ability. And a large number of fine-tuning processes for the model head h i make the model head more personalized, which helps to improve the personalized performance of the model on the client side. Step S1 includes the following sub-steps:

[0052] S11: Receive the deep learning model sent by the central server through the client. Take the fully connected layer at the top of the deep learning model as the head of the deep learning model, take the remaining body of the deep learning model as the global representation of the deep learning model, and form the complete model of the client by combining the head and the global representation of the deep learning model;

[0053] S12: Use the complete model of the client to train the local data of the client for τ sync rounds to obtain the gradient;

[0054] S13: Update the head and the global representation of the deep learning model according to the gradient;

[0055] S14: Keep the updated global representation unchanged and update the head of the deep learning model to complete the head training.

[0056] In the embodiment of the present invention, in step S11, the expression of the objective function of the deep learning model is where w represents the global representation of the deep learning model, h i represents the head of the deep learning model, F(w, h) represents the overall optimization objective function of the model, f i represents the local model optimization objective function on the i-th client, h represents the global model head, and N represents the number of clients;

[0057] In step S11, the expression of the complete model of the client is (w, h i ).

[0058] In the embodiment of the present invention, in step S12, the gradient is calculated by the formula:

[0059]

[0060] where B represents the training batch size, represents the gradient calculation function of the i-th client model, represents the global representation parameter, represents the model head of the i-th client in the k-th federated training round, represents the training sample in the current training round.

[0061] In the embodiment of the present invention, in step S13, the head h of the deep learning model is updated i The calculation formulas for the global representation w and the head h are as follows:

[0062]

[0063] Wherein, represents the global representation of the i-th client in the local (t + 1)-th training round in the k-th round of federated training, represents the model head in the (t + 1)-th training round, represents the global representation in the t-th training round, represents the model head in the t-th training round, η represents the learning rate, represents the gradient.

[0064] In the embodiment of the present invention, in step S14, the head h of the deep learning model is updated i The calculation formula is as follows:

[0065]

[0066] Wherein, represents, represents, represents, η represents the learning rate, represents the gradient.

[0067] In the embodiment of the present invention, in terms of function and purpose, FedHA is a part independent of FedFT. FedFT is a personalized federated learning algorithm, the purpose of which is to improve the performance of the model on the client side, while the purpose of FedHA is to provide a global model with good generalization ability for the central server. However, in terms of structure and implementation, FedHA relies on FedFT to be realized. Specifically, during the operation of FedFT, like the traditional federated learning process, the central server selects several participating clients in each federated round and runs the above-mentioned FedFT update process on each client. After the client finishes training, it sends the updated global representation w and the model head h i back to the central server. At this time, only the global representation part w is aggregated on the central server. The model heads h i sent back by each client do not participate in the aggregation process, but are stored in the head dictionary (Head Dict) maintained by the FedHA part on the central server. In the head dictionary, the numbers of each client and the corresponding storage spaces are stored. At the end of each round of federated training, the central server will receive the model heads h i, the server sends these personalized headers to the header dictionary, which checks the corresponding storage space according to the corresponding numbers. If it is empty, it stores directly; if not, it replaces with the new personalized header. When the FedFT process is completed, the header dictionary on the central server also stores the trained personalized headers on each client. At this time, the FedHA part aggregates all the personalized headers in the header dictionary to generate a generalized header that matches the global model for the central server. Then the aggregated generalized header is concatenated with the global representation w that has been trained for multiple rounds to generate a generalized global model (w, h global ).

[0068] Step S2 includes the following sub-steps:

[0069] S21: Return the updated global representation and the header to the central server, aggregate the global representation on the central server, and use the header dictionary on the central server to determine whether the storage space of the client is empty. If so, directly store the updated header in the header dictionary; otherwise, replace the returned header with the latest header;

[0070] S22: Aggregate all the headers in the header dictionary to generate a generalized header;

[0071] S23: Concatenate the generalized header and the aggregated global representation to generate a generalized global model to adapt to different clients.

[0072] In the embodiment of the present invention, in step S21, the calculation formula for aggregating the global representation of the deep learning model is:

[0073]

[0074] where w k represents the global representation in the k-th federated training round, N k represents the number of clients in the k-th federated training round, represents the global representation of the i-th client in the k-th federated training round;

[0075] In step S21, the calculation formula for replacing the returned header:

[0076]

[0077] where {h0,…,h N} represents a dictionary storing model headers, represents the model header of the i-th client in the k-th federated training round, and k represents the number of federated training rounds.

[0078] In the embodiment of the present invention, in step S22, the generalization head h global has the following expression:

[0079]

[0080] where N represents the number of clients, and h i represents the parameters of the deep learning model head.

[0081] The present invention will be described below with reference to specific embodiments.

[0082] This embodiment verifies two parts of the present invention, namely the FedFT part that can be regarded as a separate personalized federated learning algorithm and the FedHA part derived therefrom for the central server. First, the personalized performance of the FedFT algorithm was tested on three datasets: Cifar10, Cifar100, and FEMNIST. The datasets used and the baseline algorithms for comparison are introduced below:

[0083] Cifar10: The Cifar10 dataset contains 60,000 color images with a size of 32×32 pixels, a total of 10 categories, and each category contains 6,000 images. Cifar10 is generally divided into 50,000 training images and 10,000 test images.

[0084] Cifar100: It is very similar to the Cifar10 dataset. The main difference is that Cifar100 contains images of 100 categories, with 600 images in each category, divided into 500 to 500 training images and 100 test images, and other basic parameters are the same.

[0085] FEMNIST: This dataset is established by dividing the data in the extended MNIST dataset according to whether the category is a number or a character, and it contains a total of 62 categories.

[0086] In the test instance, only 10 character categories are used, and the samples are assigned to the clients according to the lognormal distribution. In addition, the total number of clients is set to N = 150, with an average of 148 samples per client. In addition, a variety of well-known baseline algorithms are used as controls:

[0087] Local test: Under this test condition, a local model is generated according to the number of clients in the test settings. Each client only has local data and only updates the model on the local data. The test accuracy shown is the weighted average of all clients on their respective test data.

[0088] FedAvg: The most basic federated learning framework algorithm. In each round, the central server will select a portion of clients to participate in training at a ratio of c = 0.1 and send the server model to the clients. The selected clients will update the model on their local data, and after the update is completed, send the new model back to the server. The server will perform weighted averaging on all the updated models to serve as the new service model. It should be emphasized that the FedAvg method only generates one global model, and the result of weighted averaging after local testing on each client is the same as the global testing result.

[0089] FedPer: FedPer is a method that first uses learning global representations and personalized heads in personalized federated learning to enhance the personalization ability of local models. This method allows the central server to jointly train a global representation with multiple clients, and maintain a personalized head locally at the client. This head is not sent to the central server and is only used to make the local model more adapted to the local data distribution.

[0090] LG-FedAvg: LG-FedAvg also uses the method of model layering, keeping a part of the model locally and allowing another part to participate in the aggregation process of federated learning to enhance the generalization ability. The difference is that LG-FedAvg adopts the method of learning local representations and global personalized heads.

[0091] FedRep: This method is very similar to the FedFT method proposed in the present invention, both focusing on using a personalized model head to enhance the personalization ability of the model. The difference is that the FedRep method tends to directly perform multiple rounds of model head learning by the client after receiving the parameters sent by the server, and then learn the shared representation.

[0092] The test results are shown in Table 1.

[0093] Table 1

[0094]

[0095] The personalized performance of FedFT and the above various baseline algorithms in local tests is compared here. The experiments were conducted on a total of 6 different data heterogeneity conditions of three datasets, namely Cifar10, Cifar100, and FEMNIST. On the Cifar10 and Cifar100 datasets, the FedFT method only synchronously updates the global representation and the personalized head once, and then fine-tunes the head for 9 rounds. The number of local updates of the global representation and the personalized head in the FedRep method is the same as that in FedFT. The number of local updates of other methods is the same as the number of times the FedFT method updates the global representation. Specifically, in FEMNIST, in order to enhance the learning ability of the FedFT method for the general global representation under highly data heterogeneous conditions, the number of synchronous updates is increased to 3, and the total number of personalized head updates remains unchanged. The number of updates of other methods also increases accordingly.

[0096] The results are shown in Table 1. It can be seen that the FedFT method has achieved the best performance under various data heterogeneity conditions. In the settings with less data heterogeneity (such as Cifar10, n = 100, s = 5), the FedFT method has the highest performance improvement compared to other comparison methods. This can be attributed to the fact that when the degree of data heterogeneity is low, it is relatively simple to find a shared representation applicable to all clients, and at the same time, the differences in the personalized heads between clients are not too large. Therefore, the head fine-tuning method is efficient and applicable.

[0097] On the other hand, the performance of the FedHA part in FedFTHA is also verified through examples. The effectiveness of the FedHA method in improving the generalization ability of the global model is verified in the global test experiment. At the same time, it is verified that the FedHA method can also improve the performance of the server model in the global test for other personalized federated learning using representation learning and personalized heads.

[0098] Specifically, the FedFTHA method is split into two parts. First, the FedFT method is used to train the model for 100 rounds. At the end of the training, the FedFT method provides a personalized model for each client and also provides a global model containing a general shared representation for the server. This global model without using the FedHA method is defined as "FedFT". Then, the FedHA method is used on the server side to generate a generalized head, and this head is concatenated with the general shared global representation. The resulting global model is written as "FedFT + FedHA". The prediction performances of "FedFT", "FedFT + FedHA", and the FedAVG method on all test data on the server side are compared. Experiments were conducted under 3 different data heterogeneity conditions of the Cifar10 dataset, and the results are as shown in 3 and Figure 4As shown. It can be found that under all data heterogeneity settings, FedFT and FedRep without using the FedHA method perform worse than FedAvg in the global test. For FedFT, using the FedHA method does enhance the generalization ability of the global model, and the global test accuracy of "FedFT+FedHA" is higher than that of FedAvg under three different settings. Among them, under the conditions of n = 100 and s = 5, the improvement effect of the FedHA method is the highest, which can be attributed to the fact that when the number of data types included in each client increases, the difference between its personalized heads decreases, enhancing the generalization ability of h after head aggregation.

[0099] For FedRep, due to its training method of updating the personalized head in multiple rounds first in local updates, the personalized head of FedRep is overfitted to the local data, resulting in poor performance of the aggregated global model. Even so, "FedRep+FedHA" still provides the server with a global model close to or even exceeding the FedAvg method. This also reflects that FedHA is a general method that can provide a global model with generalization performance for personalized federated learning algorithms using representation learning and personalized head methods without compromising personalized performance.

[0100] The beneficial effects of the present invention are as follows: The present invention proposes a new method for model fine-tuning and head aggregation in federated learning. This method first improves the traditional federated learning training method by using model fine-tuning, provides different personalized head models for each client, and improves the performance of personalized federated learning. At the same time, after completing the personalized federated learning training process, the present invention aggregates the personalized heads to provide the server with a global model with generalization ability. On the basis of improving the performance of the personalized federated learning algorithm, the present invention takes into account the server's demand for a global generalization model and improves the comprehensive performance of the algorithm.

[0101] Those of ordinary skill in the art will realize that the embodiments described herein are to assist the reader in understanding the principles of the present invention, and it should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those of ordinary skill in the art can make various other specific deformations and combinations without departing from the essence of the present invention according to the technical revelations disclosed in the present invention, and these deformations and combinations are still within the protection scope of the present invention.

Claims

1. A method for model fine-tuning and head aggregation in federated learning, characterized in that, It includes the following steps: S1: Receive the deep learning model sent by the central server through the client, and perform head training on the deep learning model at the client; S2: Aggregate the global representations of the deep learning model after head training in the central server to generate a generalized global model to adapt to different clients; The step S1 includes the following sub-steps: S11: Receive the deep learning model sent by the central server through the client. Take the fully connected layer at the top of the deep learning model as the head of the deep learning model, take the remaining body of the deep learning model as the global representation of the deep learning model, and form the complete model of the client with the head and global representation of the deep learning model; S12: Use the complete model of the client to train the local data of the client for τ sync rounds to obtain gradients; S13: Update the head and global representation of the deep learning model according to the gradient; S14: Keep the updated global representation unchanged and update the head of the deep learning model to complete the head training; The step S2 includes the following sub-steps: S21: Return the updated global representation and head to the central server, and aggregate the global representation on the central server. Use the head dictionary of the central server to judge whether the storage space of the client is empty. If so, directly store the updated head in the head dictionary. Otherwise, use the latest head to replace the returned head; S22: Aggregate all the heads in the head dictionary to generate a generalized head; S23: Concatenate the generalized head and the aggregated global representation to generate a generalized global model to adapt to different clients.

2. The method for model fine-tuning and head aggregation in federated learning according to claim 1, wherein In the step S11, the expression of the objective function of the deep learning model is where w represents the global representation of the deep learning model, and h i represents the head of the deep learning model on the i-th client, F(w, h) represents the overall optimization objective function of the model, and f i represents the local model optimization objective function on the i-th client, h represents the global model head, and N represents the number of clients; In the step S11, the expression of the complete model of the client is (w, h i ).

3. The method for model fine-tuning and head aggregation in federated learning according to claim 1, wherein In the step S12, the gradient is calculated by the following formula: where B represents the training batch size, represents the gradient calculation function of the i-th client model, represents the global representation parameter, represents the model head of the i-th client at the k-th round of federated training, represents the training samples in the current training round.

4. The method for model fine-tuning and head aggregation in federated learning according to claim 1, wherein In the step S13, update the head h of the deep learning model i and the calculation formulas for the global representation w are as follows: Among them, represents the global representation of the \(i\)-th client in the \(k\)-th round of federated training at the \((t + 1)\)-th local training round, represents the model head at the \((t + 1)\)-th training round, represents the global representation at the \(t\)-th training round, represents the model head at the \(t\)-th training round, and \(\eta\) represents the learning rate, represents the gradient.

5. The method for model fine-tuning and head aggregation in federated learning according to claim 1, wherein In the step S14, update the head h of the deep learning model i The calculation formula of which is: Among them, represents the global representation of the i-th client in the k-th round of federated training, represents the model head of the (t + 1)-th training round, represents the model head of the t-th training round, and η represents the learning rate, represents the gradient.

6. The method for model fine-tuning and head aggregation in federated learning according to claim 1, wherein In the step S21, the calculation formula for aggregating the global representation of the deep learning model is: Among them, w k represents the global representation in the k-th federated training round, and N k represents the number of clients in the k-th federated training round, represents the global representation of the i-th client in the k-th federated training round; In the step S21, the calculation formula for replacing the returned head: Among them, {h0, …, h N} represents a dictionary storing the model heads, represents the model head of the i-th client in the k-th round of federated training, and k represents the number of rounds of federated training.

7. The method for model fine-tuning and head aggregation in federated learning according to claim 1, wherein In the step S22, the generalization head h global has the following expression: Among them, N represents the number of clients, and h i represents the parameters of the head of the deep learning model.

Citation Information

Patent Citations

  • Federal learning optimization method and device

    CN113435604A

  • Federated Learning with Adaptive Optimization

    US20210073639A1