A personalized federated learning framework system based on fine-tuning
By pre-training and freezing deep-level parameters on the main server side, and using fine-tuning to train shallow-level models on the client side, the problem of insufficient generalization performance of the personalized joint learning framework is solved, and better model generalization and computing efficiency is achieved, while ensuring data security and storage convenience.
Patent Information
- Application Number
- CN202110051027.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-14
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-01-14
AI Technical Summary
The existing personalized joint learning framework usually trains its own network from scratch, and the operation effect is not good, and the local generalization performance of the personalized model obtained by the operation is insufficient.
By pre-collecting related field data sets on the main server side for pre-training, the deep-level network model parameters are frozen and the shallow-level neural network is only trained, and the shallow-level model is sent to the client. The client freezes shallow-level network parameters and only trains deep-level neural network parameters. The main server side selects different aggregation methods with weights for model aggregation, and uses part of the parameters of the global model for training on the client, and iterative training is repeated for multiple rounds.
It improves the local generalization performance of personalized models, improves computing efficiency, and realizes data storage and encrypted transmission through the settings of edge servers and cloud servers, ensuring data security and efficient computing.
Smart Images

Figure CN114764635B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of neural networks and federated learning, and specifically to a personalized joint learning framework system based on fine-tuning. Background Art
[0002] With the development of Internet of Things technology and the advent of 5G communication, the volume of massive data will soon exceed the data volume of the existing Internet. Edge and federated learning frameworks have attracted increasing attention. In recent years, the computing power of computing devices has been continuously improved. In particular, AI chips dedicated to neural network computing have gradually become standard in mid- to high-end devices. Federated learning is a machine learning setting in which many clients jointly train a model under the coordination of a central server while maintaining the decentralization and dispersion of training data. The long-term goal of federated learning is to analyze and learn the data of multiple data owners without exposing the data. The goal of pre-training is to allow a model (usually a neural network) to initialize its parameters with pre-trained weights. In practice, due to the insufficient size of the dataset, few people train a network from scratch. The common practice is to use a pre-trained network (such as a network trained on ImageNet for classifying 1000 classes) for re-fine-tuning (also called fine-tuning), or as a feature extractor. BERT is essentially a two-stage NLP model. The first stage is called: Pre-training, similar to Word Embedding, using existing unlabeled corpus to train a language model. The second stage is called: fine-tuning, using the pre-trained language model to complete specific NLP downstream tasks. The training cost of pre-training is very high, and generally, directly use the model trained by Google. While the cost of fine-tuning is relatively less. Fine-tuning a convolutional network replaces the input layer (data) of the network and continues to train with new data. When fine-tuning, you can choose to fine-tune all layers or some layers. Usually, the front layers extract general features of the image (generic features) (such as edge detection, color detection), and these features are useful for many tasks. The back layers extract features related to specific categories. Therefore, when fine-tuning, often only the back layers need to be fine-tuned. Edge servers provide users with a channel to access the network and the function of communicating with other server devices. Usually, edge servers are a group of servers that perform a single function, such as firewall servers, cache servers, load balancing servers, and DNS servers, etc. The process of fine-tuning is actually to initialize one's own network with the trained parameters (which can be obtained from a pre-trained model), and then continue to train with one's own data. The method of parameter adjustment is the same as the training process from scratch (gradient descent). For the initialization process, we can call our own network the target network, and the pre-trained model corresponds to the source network. It is required that the layers to be initialized in the target network be the same as those in the source network (the names, types, and set parameters of the layers, etc. are all the same). Encrypted transmission means that user data is transmitted on the Internet.To prevent data from being stolen, tampered with, and forged, such as the entrustment data of investors' online securities trading and communication security, etc., to ensure the secure transmission of information over the Internet, the technical means used, the methods of encrypted transmission mainly include encryption technology, digital signature technology, time stamps, digital certificate technology, etc. The most commonly used technology is the Secure Sockets Layer protocol (SSL). After the data is encrypted and transmitted, it can effectively ensure that the data is not stolen, thus ensuring the security of data transmission.
[0003] Since training one's own network from scratch requires a large dataset and computing time, and the computing effect cannot be guaranteed, therefore, most of the time we adopt a pre-trained model and fine-tune it to obtain the model we need. Existing personalized federated learning frameworks usually train their own networks from scratch, with poor computing effects and insufficient generalization performance of the obtained personalized models locally. For this reason, we propose a personalized federated learning framework system based on fine-tuning. Summary of the Invention
[0004] The purpose of the present invention is to provide a personalized federated learning framework system based on fine-tuning to solve the problems in the above-mentioned background technology that existing personalized federated learning frameworks usually train their own networks from scratch, with poor computing effects and insufficient generalization performance of the obtained personalized models locally.
[0005] To achieve the above purpose, the present invention provides the following technical solution: A personalized federated learning framework system based on fine-tuning adopts a fine-tuning method for the federated learning framework. The specific steps of the federated learning framework system are as follows:
[0006] Step 1: Pre-collect relevant domain datasets on the main server side of the federated learning for pre-training;
[0007] Step 2: Freeze the network model parameters of the deep layer on the main server side and only train the neural network of the shallow layer;
[0008] Step 3: The main server sends the shallow layer model to the client;
[0009] Step 4: The client freezes the network parameters of the shallow layer and only trains the neural network parameters of the deep layer;
[0010] Step 5: Conduct training on the client side. The main server side can select different aggregation methods with weights to aggregate the models uploaded by the nodes on the Server side;
[0011] Step 6: The main server side aggregates the models uploaded by the nodes and sends them to the client;
[0012] Step 7: In the next training process, the client only uses a part of the parameters of the global model. During the training process, the neural network parameters of this part of the model are fixed and not updated, and the remaining parameters are trained using their respective local data to update their own part of the parameters;
[0013] Step 8: Repeat the training and iterate for multiple rounds.
[0014] Preferably, multiple clients are set up in Step 3, and the federated learning framework deploys different parts of the shallow neural network parameters trained by the fine-tuning method to multiple clients.
[0015] Preferably, the shallow model in Step 4 learns the common features of all clients, the deep model in Step 4 learns the proprietary features of local data, and the train_test_split method is used for dataset segmentation when pre-collecting the relevant field dataset in Step 1.
[0016] Preferably, in Step 1, the main server uploads the shallow models sent to the clients multiple times to Edge Server A, uploads the datasets that have not been used multiple times to Edge Server B, and uploads the commonly used datasets to Edge Server C.
[0017] Preferably, Data Storage A and Data Storage B are actively installed on Edge Server A. Edge Server A transfers the shallow models sent to the clients multiple times to Data Storage A. Data Storage B is a backup storage. When Data Storage A is removed, Edge Server A transfers the shallow models sent to the clients multiple times to Data Storage B.
[0018] Preferably, Data Storage C and Data Storage D are actively installed on Edge Server B. Edge Server B transfers the datasets that have not been used multiple times to Data Storage C. Data Storage D is a backup storage. When Data Storage C is removed, Edge Server A transfers the datasets that have not been used multiple times to Data Storage D.
[0019] Preferably, Data Storage E and Data Storage F are actively installed on Edge Server C. Edge Server C transfers the commonly used datasets to Data Storage E. When Data Storage E is removed, Edge Server C transfers the commonly used datasets to Data Storage F.
[0020] Preferably, in the first step, the main server uploads the shallow models that have been sent to the client multiple times to the cloud server. The cloud server transfers the data of the shallow models that have been sent to the client multiple times to the encryption module. The encryption module transfers the encrypted data to the calculation module. The calculation module transfers the calculated data to the decryption module. The decryption module transfers the decrypted data to each client.
[0021] Preferably, in the first step, the main server uploads the datasets that have not been used multiple times to the cloud server. The cloud server stores the datasets that have not been used multiple times in the memory in the cloud server.
[0022] Preferably, in the first step, the main server uploads the commonly used datasets to the cloud server. The cloud server transfers the commonly used datasets to the encryption module. The encryption module transfers the encrypted data to the calculation module. The calculation module transfers the calculated data to the decryption module. The decryption module transfers the decrypted data to each client.
[0023] Compared with the prior art, the beneficial effects of the present invention are:
[0024] 1. For this personalized federated learning framework system based on fine-tuning, by pre-collecting relevant domain data at the main server side of federated learning for pre-training, freezing the parameters of the deep network model and only training the shallow neural network, the main server model is sent to the client. The client freezes the shallow network parameters and only trains the deep neural network parameters. The shallow model learns the common features of all clients, and the deep model learns the proprietary features of local data. The trained personalized model has better generalization performance locally. By training on the client side, the main server side can select different aggregation methods with weights, aggregate the models uploaded by nodes on the Server side, and then send the model to the client. The client only uses a part of the parameters of the global model in the next training process, fixes the neural network parameters of this part of the model during the training process without updating them, and uses the remaining parameters to train with their own local data and update their own part of the parameters. Repeat the training iteration for multiple rounds to obtain a personalized federated learning model with better performance on the client side and improve the operation efficiency;
[0025] 2. The personalized federated learning framework system based on fine-tuning reads fast and is convenient for data storage by setting up Edge Server A, Edge Server B, and Edge Server C, and setting all three edge servers as cache servers. By setting up six detachable data memories, it achieves the effect of storing the shallow models sent from the main server to the client multiple times, the data sets that the main server fails to use multiple times, and the commonly used data sets of the main server in the memories, facilitating the extraction of the three aspects of data sets, supplementing the data of similar data sets, making the operation of this learning framework more efficient, and at the same time facilitating the disassembly and replacement of the data memories, which is convenient for use and maintenance.
[0026] 3. The personalized federated learning framework system based on fine-tuning can perform secure transmission through the cloud server when secure data transmission is required by setting up a cloud server, an encryption module, a computing module, and a decryption module, greatly improving the guarantee of data security. The setting of the cloud server facilitates the staff to access the data sets that have not been used multiple times and is convenient for the staff to eliminate similar data sets. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram of the system of the present invention;
[0028] Figure 2 It is a schematic diagram of the scenario of the server and three edge servers of the present invention;
[0029] Figure 3 It is a schematic diagram of the scenario of the edge server and the data memory of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0030] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0031] train_test_split is the random division of the training set provided by the model_selection module of the sklearn package; fine-tuning: fine-tuning. [[ID=????]]
[0032] Embodiment 1
[0033] Please refer to Figure 1 , the present invention provides a technical solution: a personalized federated learning framework system based on fine-tuning, and its federated learning framework system specifically includes the following steps:
[0034] Step 1: Pre-collect relevant domain datasets on the main server side of federated learning for pre-training;
[0035] Step 2: Freeze the deep network model parameters on the main server side and only train the shallow neural network;
[0036] Step 3: The main server distributes the shallow model to the client;
[0037] Step 4: The client freezes the shallow network parameters and only trains the deep neural network parameters;
[0038] Step 5: During training on the client side, the main server side can choose different aggregation methods with weights to aggregate the models uploaded by the nodes on the Server side;
[0039] Step 6: After aggregating the models uploaded by the nodes, the main server side distributes them to the client;
[0040] Step 7: During the next training process, the client only uses a part of the parameters of the global model. During the training process, the neural network parameters of this part of the model are fixed and not updated, and the remaining parameters are trained using their respective local data to update their own part of the parameters;
[0041] Step 8: Repeat the training and iterate for multiple rounds.
[0042] In Step 3, the clients are divided into multiple ones, and the federated learning framework deploys different parts of the shallow neural network parameters trained by the fine-tuning method to multiple clients.
[0043] The shallow model in Step 4 learns the common features of all clients, and the deep model in Step 4 learns the proprietary features of local data.
[0044] Embodiment 2
[0045] Please refer to Figure 1 and 2 , the present invention provides a technical solution: a personalized federated learning framework system based on fine-tuning, and its federated learning framework system specifically includes the following steps:
[0046] Step 1: Pre-collect relevant domain datasets on the main server side of federated learning for pre-training;
[0047] Step 2: Freeze the deep network model parameters on the main server side and only train the shallow neural network;
[0048] Step 3: The main server distributes the shallow model to the client;
[0049] Step 4: The client freezes the shallow network parameters and only trains the deep neural network parameters;
[0050] Step 5: Training is carried out on the client side. The main server can select different aggregation methods with weights to aggregate the models uploaded by the nodes on the Server side;
[0051] Step 6: The main server side aggregates the models uploaded by the nodes and then distributes them to the client;
[0052] Step 7: During the next training process, the client only uses a part of the parameters of the global model. During the training process, the neural network parameters of this part of the model are fixed and not updated, and the remaining parameters are trained using their respective local data to update their own part of the parameters;
[0053] Step 8: Repeat the training and iterate for multiple rounds.
[0054] In Step 1, when pre-collecting the dataset in the relevant field, the train_test_split method is used to split the dataset.
[0055] In Step 1, the main server side uploads the shallow models that have been distributed to the client multiple times to Edge Server A, uploads the datasets that have not been used multiple times to Edge Server B, and uploads the commonly used datasets to Edge Server C.
[0056] Embodiment 3
[0057] Please refer to Figures 1-3 , the present invention provides a technical solution: a personalized federated learning framework system based on fine-tuning. The federated learning framework system specifically includes the following steps:
[0058] Step 1: Pre-collect datasets in the relevant field on the main server side of federated learning for pre-training;
[0059] Step 2: Freeze the deep network model parameters on the main server side and only train the shallow neural network;
[0060] Step 3: The main server distributes the shallow model to the client;
[0061] Step 4: The client freezes the shallow network parameters and only trains the deep neural network parameters;
[0062] Step 5: Training is carried out on the client side. The main server can select different aggregation methods with weights to aggregate the models uploaded by the nodes on the Server side;
[0063] Step 6: The main server side aggregates the models uploaded by the nodes and then distributes them to the client;
[0064] Step Seven: In the next training process, the client only uses a part of the parameters of the global model. During the training process, the neural network parameters of this part of the model are fixed and not updated, and the remaining parameters are trained using their respective local data to update their own part of the parameters;
[0065] Step Eight: Repeat the training and iterate for multiple rounds.
[0066] An edge server A is actively installed with a data storage A and a data storage B. The edge server A transfers the shallow model that has been sent to the client multiple times to the data storage A. The data storage B is a backup storage. When the data storage A is disassembled, the edge server A transfers the shallow model that has been sent to the client multiple times to the data storage B. The edge server A is a cache server. The data storage A and the data storage B have the same specifications, which is conducive to the replacement and maintenance of the data storage and is convenient to use.
[0067] An edge server B is actively installed with a data storage C and a data storage D. The edge server B transfers the data sets that have not been used multiple times to the data storage C. The data storage D is a backup storage. When the data storage C is disassembled, the edge server A transfers the data sets that have not been used multiple times to the data storage D. The edge server B is a cache server. The data storage C and the data storage D have the same specifications, which is conducive to the replacement and maintenance of the data storage and is convenient to use.
[0068] An edge server C is actively installed with a data storage E and a data storage F. The edge server C transfers the commonly used data sets to the data storage E. When the data storage E is disassembled, the edge server C transfers the commonly used data sets to the data storage F. The edge server C is a cache server. The data storage E and the data storage F have the same specifications, which is conducive to the replacement and maintenance of the data storage and is convenient to use.
[0069] Embodiment Four
[0070] Please refer to Figures 1-3 , the present invention provides a technical solution: a personalized federated learning framework system based on fine-tuning, and its federated learning framework system specifically includes the following steps: Step One: Pre-collect relevant domain data sets at the main server end of the federated learning for pre-training;
[0071] Step Two: Freeze the parameters of the deep network model at the main server end and only train the shallow neural network;
[0072] Step Three: The main server sends the shallow model to the client;
[0073] Step 4: The client freezes the shallow network parameters and only trains the deep neural network parameters;
[0074] Step 5: Train on the client side. The main server can select different aggregation methods with weights and aggregate the models uploaded by the nodes on the Server side;
[0075] Step 6: The main server aggregates the models uploaded by the nodes and distributes them to the clients;
[0076] Step 7: During the next training process, the client only uses a part of the parameters of the global model. During the training process, the neural network parameters of this part of the model are fixed and not updated, and the remaining parameters are trained using their respective local data to update their own part of the parameters;
[0077] Step 8: Repeat the training and iterate for multiple rounds.
[0078] In Step 1, the main server uploads the shallow models sent to the client multiple times to the cloud server. The cloud server transmits the data of the shallow models sent to the client multiple times to the encryption module. The encryption module transmits the encrypted data to the calculation module. The calculation module transmits the calculated data to the decryption module. The decryption module transmits the decrypted data to each client.
[0079] In Step 1, the main server uploads the datasets that cannot be used multiple times to the cloud server. The cloud server stores the datasets that cannot be used multiple times in the memory in the cloud server.
[0080] In Step 1, the main server uploads the commonly used datasets to the cloud server. The cloud server transmits the commonly used datasets to the encryption module. The encryption module transmits the encrypted data to the calculation module. The calculation module transmits the calculated data to the decryption module. The decryption module transmits the decrypted data to each client.
[0081] Working principle: Pre-collect relevant field data on the main server side of federated learning for pre-training. Freeze the parameters of the deep network model and only train the shallow neural network. The main server model is sent to the client. The client freezes the parameters of the shallow network and only trains the parameters of the deep neural network. The shallow model learns the common features of all clients, and the deep model learns the proprietary features of local data. The main server side can choose different aggregation methods with weights to aggregate the models uploaded by nodes on the Server side, and then send the model to the client. The client only uses a part of the parameters of the global model in the next training process, fixes the neural network parameters of this part of the model during the training process without updating, and uses the remaining parameters to train with their respective local data to update their own part of the parameters. Repeat the training iteration for multiple rounds to build the federated learning framework. There are data memories A and B actively installed on edge server A. Edge server A transfers the shallow models sent to the client multiple times to data memory A. Data memory B is a backup memory. When data memory A is removed, edge server A transfers the shallow models sent to the client multiple times to data memory B. There are data memories C and D actively installed on edge server B. Edge server B transfers the datasets that have not been used multiple times to data memory C. Data memory D is a backup memory. When data memory C is removed, edge server A transfers the datasets that have not been used multiple times to data memory D. There are data memories E and F actively installed on edge server C. Edge server C transfers the commonly used datasets to data memory E. When data memory E is removed, edge server C transfers the commonly used datasets to data memory F. Edge server A, edge server B, and edge server C are all cache servers. Data memory A and data memory B have the same specifications and are detachable. Data memory C and data memory D have the same specifications and are detachable. Data memory E and data memory F have the same specifications and are detachable, which is convenient for staff to store the shallow models sent from the main server side to the client multiple times, the datasets that have not been used multiple times by the main server side, and the commonly used datasets by the main server side in the memory, and then extract the datasets in three aspects, which is convenient for supplementing the data of similar datasets and making the operation of this learning framework more efficient. When encrypted transmission is required, upload the shallow models sent from the main server side to the client multiple times to the cloud server. The cloud server transfers the shallow model data sent to the client multiple times to the encryption module. The encryption module transfers the encrypted data to the calculation module. The calculation module transfers the calculated data to the decryption module. The decryption module transfers the decrypted data to each client. Upload the datasets that have not been used multiple times by the main server side to the cloud server. The cloud server stores the datasets that have not been used multiple times in the memory in the cloud server for staff to eliminate similar data.The main server uploads the commonly used data set to the cloud server, the cloud server transmits the commonly used data set to the encryption module, the encryption module transmits the encrypted data to the calculation module, the calculation module transmits the calculated data to the decryption module, and the decryption module transmits the decrypted data to each client to achieve encrypted transmission.
[0082] Finally, it should be noted that the above content is only used to illustrate the technical solution of the present invention, rather than a limitation on the protection scope of the present invention. Any simple modification or equivalent replacement made by those of ordinary skill in the art to the technical solution of the present invention shall not depart from the essence and scope of the technical solution of the present invention.
Claims
1. A personalized federated learning framework system based on fine-tuning, characterized in that Adopt the fine-tuning method to combine the learning framework, and the combined learning framework system specifically includes the following steps: Step 1: Pre-collect relevant domain datasets on the main server side of the federated learning for pre-training; Step 2: Freeze the deep network model parameters on the main server side and only train the shallow network model parameters; Step 3: The main server distributes the shallow network model parameters to the client; Step 4: The client freezes the shallow network model parameters and only trains the deep network model parameters; Step 5: Train on the client side, and the main server side selects different aggregation methods with weights to aggregate the models uploaded by the nodes on the Server side; Step 6: The main server side distributes the aggregated models uploaded by the nodes to the client; Step 7: During the next training process, the client only uses a part of the parameters of the global model, fixes these parameters during the training process without updating, and uses the remaining parameters to train with their respective local data to update their own part of the parameters; Step 8: Repeat the training and iterate for multiple rounds; Among them, in Step 1, the main server side uploads the shallow network model parameters that have been distributed to the client multiple times to Edge Server A, uploads the datasets that have not been used multiple times to Edge Server B, and uploads the commonly used datasets to Edge Server C.
2. The personalized federated learning framework system based on fine-tuning according to claim 1, wherein: The shallow network model in Step 4 learns the common features of all clients, the deep network model in Step 4 learns the proprietary features of local data, and the train_test_split method is used to split the dataset when pre-collecting relevant domain datasets in Step 1.
3. A personalized federated learning framework system based on fine-tuning according to claim 1, characterized in that: Data storage A and data storage B are actively installed on Edge Server A. Edge Server A transfers the shallow network model parameters that have been distributed to the client multiple times to Data storage A. Data storage B is a backup storage. When Data storage A is removed, Edge Server A transfers the shallow network model parameters that have been distributed to the client multiple times to Data storage B.
4. The personalized federated learning framework system based on fine-tuning according to claim 1, wherein: Data storage C and data storage D are actively installed on Edge Server B. Edge Server B transfers the datasets that have not been used multiple times to Data storage C. Data storage D is a backup storage. When Data storage C is removed, Edge Server A transfers the datasets that have not been used multiple times to Data storage D.
5. A personalized federated learning framework system based on fine-tuning according to claim 1, characterized in that: [[ID=,13]]Data storage E and data storage F are actively installed on Edge Server C. Edge Server C transfers the commonly used datasets to Data storage E. When Data storage E is removed, Edge Server C transfers the commonly used datasets to Data storage F.
6. A personalized federated learning framework system based on fine-tuning according to claim 1, characterized in that: In the first step, the main server uploads the shallow-level network model parameters that have been sent to the client multiple times to the cloud server. The cloud server transmits the shallow-level network model parameters that have been sent to the client multiple times to the encryption module. The encryption module transmits the encrypted data to the calculation module. The calculation module transmits the calculated data to the decryption module. The decryption module transmits the decrypted data to each client.
7. A personalized federated learning framework system based on fine-tuning according to claim 1, characterized in that: In the first step, the main server uploads the datasets that have not been used multiple times to the cloud server. The cloud server stores the datasets that have not been used multiple times in the memory in the cloud server.
8. A personalized federated learning framework system based on fine-tuning according to claim 1, characterized in that: In the first step, the main server uploads the commonly used datasets to the cloud server. The cloud server transmits the commonly used datasets to the encryption module. The encryption module transmits the encrypted data to the calculation module. The calculation module transmits the calculated data to the decryption module. The decryption module transmits the decrypted data to each client.
Citation Information
Patent Citations
Video transmission system based on edge cloud
KR102128945B1