A personalized federated learning method and system based on dynamic hierarchical regulation

Through the personalized federated learning method of dynamic hierarchical regulation, the problems of data heterogeneity in federated learning and low learning efficiency when new clients are joined are solved, and the efficient generalization and rapid adaptation of the model on multiple clients are achieved.

CN120235219BActive Publication Date: 2025-08-05SHANDONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510703003.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-08-05
Estimated Expiration
2045-05-29

AI Technical Summary

Technical Problem

In federated learning, data heterogeneity of client data causes the model to perform poorly with multiple dispersed data sources and inefficient learning when new clients join.

Method used

The personalized federated learning method of dynamic hierarchical regulation is adopted, and the current personalization rate is calculated by presetting the minimum personalization rate, maximum personalization rate, total iteration rounds and current rounds, dynamically divide the model parameters, and evaluate the parameter ratio of the new client to achieve dynamic hierarchical regulation and rapid personalization of the model.

Benefits of technology

It improves the generalization ability of the model and the learning efficiency of the new client, so that the model performs better on different clients and quickly adapts to the addition of new clients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120235219B_ABST
    Figure CN120235219B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of machine learning technology, and specifically relates to a personalized federated learning method and system based on dynamic hierarchical regulation. The method dynamically divides the model parameters of all clients received by the server side using the personalization rate to achieve dynamic hierarchical regulation, which helps to more finely adjust the segmentation rate of the model and improve the model generalization ability. In addition, for the addition of new clients to federated learning, the present invention also evaluates the new clients and selects the parameter ratio migrated to the new client model based on the preset minimum personalization rate and the preset maximum personalization rate, so as to improve learning efficiency and enable the new clients to quickly acquire the ability 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 field of machine learning technology, and specifically relates to a personalized federated learning method and system based on dynamic hierarchical regulation. Background Art

[0002] Modern mobile phones, wearable devices, automotive infotainment systems, and other connected devices are equipped with not only high-performance hardware but also sophisticated software capabilities, supporting a wide range of applications and generating vast amounts of user data. The data generated by these devices often involves user privacy concerns. Therefore, effectively utilizing this vast amount of data while protecting privacy has become a major challenge in the field of machine learning. With the advancement of edge computing capabilities and the growing demand for privacy protection, a new solution—federated learning—has emerged. Unlike traditional distributed learning, federated learning emphasizes retaining data locally on edge devices, leveraging their computing resources for model training and inference, and synchronizing parameters with a central server only when necessary. This approach effectively avoids centralized storage and processing of user data, significantly enhancing data privacy.

[0003] One of the most significant challenges in federated learning is data heterogeneity. Due to its unique application scenarios, in practice, the data of clients may not be independent and identically distributed (IID). This means that each client may have a different amount of data, different data categories, and different data styles. In this scenario, if the server and clients learn a single shared model, the resulting model may not perform well for many clients in the network. Therefore, when dealing with multiple dispersed data sources, it is necessary to effectively learn and aggregate data from different sources to maintain model performance and generalization capabilities. Summary of the Invention

[0004] The present invention provides a personalized federated learning method and system based on dynamic hierarchical regulation.

[0005] The technical solutions of the present invention are as follows:

[0006] The present invention provides a personalized federated learning method based on dynamic hierarchical regulation, comprising:

[0007] S1: Initialize the global model parameters on the server side, send the initialized global model parameters to the local models of multiple clients, and obtain the corresponding local models;

[0008] S2: Use the local data of each client to train the corresponding local model and update the local model parameters;

[0009] S3: After the updated local model parameters are uploaded to the server, they are weighted averaged to obtain aggregated local model parameters. The current personalization rate is calculated based on the preset minimum personalization rate, the preset maximum personalization rate, the total number of iterations, and the current iteration. The aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters.

[0010] S4: The maximum number of local data samples in the client uploaded to the server in S3 is recorded as the target number; the total number of clients participating in the current training is detected. If no new clients exist, S5 is executed. If a new client exists, the number of local data samples of the new client is recorded as the number to be tested, and the number to be tested is compared with the target number. If the number to be tested is not less than the target number, the current global model parameters obtained by dividing using the preset minimum personalization rate are used as the current global model parameters of the new client; if the number to be tested is less than the target number, the current global model parameters obtained by dividing using the preset maximum personalization rate are used as the current global model parameters of the new client;

[0011] S5: Send the current global model parameters to the local model of the corresponding client currently being trained, and return to execute S2 until the preset conditions are met to obtain a personalized federated learning model.

[0012] In step S3, the current personalization rate is calculated according to the preset minimum personalization rate, the preset maximum personalization rate, the total number of iterations, and the current round, as shown in the formula: ,accomplish;

[0013] Where, is the current personalization rate, To preset the minimum personalization rate, To preset the maximum personalization rate, For the current round, is the total number of iterations.

[0014] In S3, the aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters, which are given by the formula: ,accomplish;

[0015] Where, is the current global model parameter, are the aggregated local model parameters, is the current personalization rate.

[0016] In S3, the aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters, which are specifically:

[0017] Get the number of network layers on the server side, multiply the current personalization rate by the number of network layers to get the number of layers not delivered, subtract the number of layers not delivered from the number of network layers to get the number of layers delivered. Based on the number of delivered layers, reverse infer the corresponding number of layers from the network layer on the server side to get the network layer, which is used as the current global model parameter.

[0018] In S3, after the updated local model parameters are uploaded to the server, they are processed by weighted average to obtain the aggregated local model parameters, which are given by the formula: ,accomplish;

[0019] Where, are the aggregated local model parameters, For the The local model parameters updated by each client, is the total number of data samples from all clients, For the The number of data samples per client, The total number of clients participating in the current training.

[0020] After the personalized federated learning model is obtained in S5, if it is detected that a new client has joined, S4 is executed.

[0021] Said S2 updates the local model parameters as follows: ,accomplish;

[0022] Where, are the updated local model parameters, is the local model parameter of the tth round, is the local model learning rate, is the bias coefficient, is the loss function.

[0023] The present invention also provides a personalized federated learning system based on dynamic hierarchical regulation, comprising:

[0024] Initialization module: used to initialize the global model parameters on the server side, and send the initialized global model parameters to the local models of multiple clients to obtain the corresponding local models;

[0025] Preprocessing module: used to train the corresponding local model using the local data of each client and update the local model parameters;

[0026] Partitioning module: After the updated local model parameters are uploaded to the server, they are weighted averaged to obtain aggregated local model parameters. The current personalization rate is calculated based on the preset minimum personalization rate, the preset maximum personalization rate, the total number of iterations, and the current iteration. The aggregated local model parameters are partitioned using the current personalization rate to obtain the current global model parameters.

[0027] New client detection module: The maximum number of local data samples of the client uploaded to the server in the partitioning module is recorded as the target number; the total number of clients participating in the current training is detected. If there is no new client, the training module is entered. If there is a new client, the number of local data samples of the new client is recorded as the number to be tested. The number to be tested is compared with the target number. If the number to be tested is not less than the target number, the current global model parameters obtained by partitioning using the preset minimum personalization rate are used as the current global model parameters of the new client; if the number to be tested is less than the target number, the current global model parameters obtained by partitioning using the preset maximum personalization rate are used as the current global model parameters of the new client;

[0028] Training module: Sends the current global model parameters to the local model of the corresponding client currently being trained, returns to the preprocessing module, and returns until the preset conditions are met to obtain a personalized federated learning model.

[0029] Beneficial effects

[0030] The present invention uses the personalization rate to dynamically divide the model parameters of all clients received by the server, realizing dynamic hierarchical regulation, which helps to more finely adjust the segmentation rate of the model and improve the generalization ability of the model. In addition, for the addition of new clients in federated learning, the present invention also evaluates the new clients and selects the parameter ratio migrated to the new client model according to the preset minimum personalization rate and the preset maximum personalization rate, so as to improve learning efficiency and enable the new clients to quickly acquire the ability of personalized federated learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 This is a structural diagram of a personalized federated learning method based on dynamic hierarchical regulation in the present invention. DETAILED DESCRIPTION

[0032] The following examples are intended to illustrate the present invention rather than to further limit the present invention.

[0033] The present invention provides a personalized federated learning method based on dynamic hierarchical regulation, comprising:

[0034] S1: Initialize the global model parameters on the server side, and send the initialized global model parameters to the local models of multiple clients to obtain the corresponding local models.

[0035] For example, the application of federated learning in the medical field allows different hospitals and medical institutions to collaborate on training diagnostic models without sharing patient data, thereby improving the model's universality and accuracy. The following uses medical imaging diagnosis as an example to describe how to implement federated learning using this application's method.

[0036] First, multiple hospitals or medical institutions determine the medical imaging diagnosis model to be used for the task on the server side. For example, this model may be a convolutional neural network for classifying X-ray, MRI or CT images.

[0037] The initial parameters of the model are then defined on the server. The initial parameters are usually pre-trained using a large dataset (such as a public medical imaging database).

[0038] Afterwards, the server establishes a communication connection with the client (multiple hospitals or medical institutions), and the client receives the initialized model parameters from the server to help each client build a medical imaging diagnosis model.

[0039] S2: Use the local data of each client to train the corresponding local model and update the local model parameters.

[0040] First, the local data of each client is preprocessed, including data cleaning, removal of missing values, outliers and duplicate data, etc., to ensure data quality.

[0041] Each hospital or medical institution then trains its own model using its own local medical imaging data. For example, consider three hospitals, each using its own imaging data for model training. This data might include X-rays, MRI scans, and more.

[0042] At each hospital, the model is adjusted and trained based on local data, updating local model parameters. For example, Hospital A trains its model using chest X-ray images, Hospital B uses CT images, and Hospital C uses MRI images. Each hospital trains its own local model, and the data remains within the hospital. Local models are all medical imaging diagnostic models.

[0043] Preferably, the local model parameters are updated as follows: ,accomplish;

[0044] Where, are the updated local model parameters after t rounds of training, is the local model parameter of the tth round, is the local model learning rate, is the bias coefficient, is the loss function.

[0045] S3: After the updated local model parameters are uploaded to the server, they are weighted averaged to obtain the aggregated local model parameters. The current personalization rate is calculated based on the preset minimum personalization rate, the preset maximum personalization rate, the total number of iterations, and the current round. The aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters.

[0046] During the upload phase in S3, after each hospital completes local model training, it sends the updated model parameters (for example, changes to the weights of the neural network layers) to the server. Importantly, the hospital only uploads the model parameters, not the medical imaging data itself.

[0047] Specifically, first, the server randomly selects the clients participating in the training and communicates to obtain the model parameters of each client after completing local training. .

[0048] Then, the server will upload all the client's model parameters Dynamically divide and send to the client.

[0049] In the division stage, preferably, after the updated local model parameters are uploaded to the server, they are processed by weighted average to obtain aggregated local model parameters, which are given by the formula: ,accomplish;

[0050] Where, are the aggregated local model parameters, For the The local model parameters updated by each client, is the total number of data samples from all clients, For the The number of data samples per client, The total number of clients participating in the current training.

[0051] For example, after receiving model updates from multiple hospitals, the server uses federated learning aggregation to merge the updated parameters of these local models. This application uses a weighted average approach, weighting the contribution of each hospital model by the amount of local data or training quality. During the aggregation process, all transmitted model updates are encrypted to protect the privacy of hospitals and patients.

[0052] Preferably, the current personalization rate is calculated according to the preset minimum personalization rate, the preset maximum personalization rate, the total number of iteration rounds and the current round, as follows: ,realize that the personalization rate changes dynamically and the overall trend is gradually increasing;

[0053] Where, is the current personalization rate, To preset the minimum personalization rate, To preset the maximum personalization rate, For the current round, is the total number of iterations in a cycle.

[0054] Furthermore, the aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters, which are given by the formula: ,accomplish;

[0055] Where, is the current global model parameter, are the aggregated local model parameters, is the current personalization rate.

[0056] Specifically:

[0057] Get the number of network layers on the server side, multiply the current personalization rate by the number of network layers to get the number of layers not delivered, subtract the number of layers not delivered from the number of network layers to get the number of layers delivered. Based on the number of delivered layers, reverse infer the corresponding number of layers from the end of the network layer on the server side to get the network layer, which is used as the current global model parameter.

[0058] For example, the network layers are composed of the following order: Zero Padding, CONV, Batch Norm, ReLu, Max Pool, Conv Block, ID Block, Conv Block, ID Block, Conv Block, ID Block, Conv Block, IDBlock, Avg Pool, Flattening, FC. If the calculated number of layers to be sent is 5, then the five network layers of Conv Block, IDBlock, Avg Pool, Flattening, and FC constitute the current global model parameters. These global model parameters are then sent to the client. Upon receiving them, the client loads them into its local model, leaving any unsent layers intact.

[0059] That is, the server will aggregate the local model parameters By personalization rate Dynamically divide the model into global model parameters that are sent to the client to participate in local model updates , and personalized model parameters that are not sent to the client .

[0060] To address the data heterogeneity problem caused by differences in distribution, features, labels or data quality of data from different clients (for example, equipment, hospitals, companies, etc.), the present invention dynamically divides the model parameters of all clients received by the server using the personalization rate to achieve dynamic hierarchical regulation, which helps to more finely adjust the model's segmentation rate and improve the model's generalization ability.

[0061] S4: The maximum number of local data samples uploaded from S3 to the client on the server side is recorded as the target number Nmax ; Detect the total number of clients participating in the current training. If there is no new client, execute S5. If there is a new client, record the number of local data samples of the new client as the number to be tested. , compare the number of pending inspections With the target number N max If the number of items to be inspected is Not less than the target number N max , then use the preset minimum personalization rate The current global model parameters obtained by division are the current global model parameters of the new client; if the number of Less than the target number N max , then use the preset maximum personalization rate The current global model parameters obtained by the division are the current global model parameters of the new client.

[0062] In actual operation, for the addition of new clients, let the new clients perform transfer learning (DTL), that is, if the number of clients to be tested is Not less than the target quantity , then the aggregated local model parameters use the preset minimum personalization rate After the division, the current global model parameters are the current global model parameters of the new client, which are used as the source domain. , the local data sample of the new client is the target domain ,in Represents a sample, Indicates a label, is the number of local data samples of the new client. In other words: using the source domain To quickly learn models for new clients so that they can It performs well on the target domain, i.e., minimizes the loss function of the target domain.

[0063] Similarly, if the number of Less than the target number , then the aggregated local model parameters use the preset maximum personalization rate After the division, the current global model parameters are the current global model parameters of the new client, which are used as the source domain. , the local data sample of the new client is the target domain .

[0064] In response to the addition of new clients in federated learning, the present invention first evaluates the new clients and selects the parameter ratio to be migrated to the new client model based on the preset minimum personalization rate and the preset maximum personalization rate, so as to improve learning efficiency and enable the new clients to quickly acquire the ability of personalized federated learning.

[0065] S5: Send the current global model parameters to the local model of the corresponding client currently being trained, and return to execute S2 until the preset conditions are met to obtain a personalized federated learning model.

[0066] That is, each client receives the current global model parameters from the server. , which replaces some of the original model parameters in the shared model, and then continues training. With each round of training, the model's diagnostic capabilities continuously improve. By combining data from different hospitals, the model can learn a wider range of imaging features, improving the diagnostic accuracy of different types of diseases. The preset conditions can include a preset number of rounds or a preset accuracy rate for the model. Ultimately, by combining data from multiple medical institutions, the model can identify a wider range of pathological features, improving diagnostic accuracy.

[0067] In addition, after obtaining the personalized federated learning model, S5 further includes executing S4 if it is detected that a new client has joined.

[0068] That is to say, whether in the training process or in the actual application of the personalized federated learning model, if a new client is added, the new client is first evaluated, the corresponding source domain is determined, and training is performed so that the new client can quickly acquire the ability of personalized federated learning.

[0069] The present invention uses the personalization rate to dynamically divide the model parameters of all clients received by the server, realizing dynamic hierarchical regulation, which helps to more finely adjust the segmentation rate of the model and improve the generalization ability of the model. In addition, for the addition of new clients in federated learning, the present invention first evaluates the new clients and selects the parameter ratio migrated to the new client model based on the preset minimum personalization rate and the preset maximum personalization rate, so as to improve learning efficiency and enable the new clients to quickly acquire the ability of personalized federated learning.

[0070] The present invention also provides a personalized federated learning system based on dynamic hierarchical regulation, comprising:

[0071] Initialization module: used to initialize the global model parameters on the server side, and send the initialized global model parameters to the local models of multiple clients to obtain the corresponding local models;

[0072] Preprocessing module: used to train the corresponding local model using the local data of each client and update the local model parameters;

[0073] Partitioning module: After the updated local model parameters are uploaded to the server, they are weighted averaged to obtain aggregated local model parameters. The current personalization rate is calculated based on the preset minimum personalization rate, the preset maximum personalization rate, the total number of iterations, and the current iteration. The aggregated local model parameters are partitioned using the current personalization rate to obtain the current global model parameters.

[0074] New client detection module: The maximum number of local data samples of the client uploaded to the server in the partitioning module is recorded as the target number; the total number of clients participating in the current training is detected. If there is no new client, the training module is entered. If there is a new client, the number of local data samples of the new client is recorded as the number to be tested. The number to be tested is compared with the target number. If the number to be tested is not less than the target number, the current global model parameters obtained by partitioning using the preset minimum personalization rate are used as the current global model parameters of the new client; if the number to be tested is less than the target number, the current global model parameters obtained by partitioning using the preset maximum personalization rate are used as the current global model parameters of the new client;

[0075] Training module: Sends the current global model parameters to the local model of the corresponding client currently being trained, returns to the preprocessing module, and returns until the preset conditions are met to obtain a personalized federated learning model.

Claims

1. A personalized federated learning method based on dynamic hierarchical control, characterized by: include: S1: Initialize the global model parameters on the server side, send the initialized global model parameters to the local models of multiple clients, and obtain the corresponding local models; S2: Use the local data of each client to train the corresponding local model and update the local model parameters; S3: After the updated local model parameters are uploaded to the server, they are processed by weighted average to obtain the aggregated local model parameters; according to the preset minimum personalization rate , preset maximum personalization rate , total iteration rounds and the current round , according to the formula: , calculate the current personalization rate ; Aggregated local model parameters Leverage current personalization rates Divide by the formula: , get the current global model parameters , specifically: Get the number of network layers on the server side. Multiply the current personalization rate by the number of network layers to get the number of layers not delivered. Subtract the number of layers not delivered from the number of network layers to get the number of layers delivered. Based on the number of delivered layers, reverse-infer the corresponding number of layers from the server-side network layer to get the network layer, which is used as the current global model parameter. S4: The maximum number of local data samples in the client that uploads S3 to the server is recorded as the target number; Detect the total number of clients participating in the current training. If no new clients exist, execute S5. If a new client exists, record the number of local data samples of the new client as the number to be tested, compare the number to be tested with the target number, and if the number to be tested is not less than the target number, use the current global model parameters obtained by dividing using the preset minimum personalization rate as the current global model parameters of the new client. If the number of clients to be inspected is less than the target number, the current global model parameters obtained by dividing the client using the preset maximum personalization rate are used as the current global model parameters of the new client. S5: Send the current global model parameters to the local model of the corresponding client currently being trained, and return to execute S2 until the preset conditions are met to obtain a personalized federated learning model for application in medical imaging diagnosis.

2. A personalized federated learning method based on dynamic hierarchical control according to claim 1, characterized in that: In S3, after the updated local model parameters are uploaded to the server, they are processed by weighted average to obtain the aggregated local model parameters, which are given by the formula: ,accomplish; Where, are the aggregated local model parameters, For the The local model parameters updated by each client, is the total number of data samples from all clients, For the The number of data samples per client, The total number of clients participating in the current training.

3. The personalized federated learning method based on dynamic hierarchical control according to claim 1, characterized in that: After the personalized federated learning model is obtained in S5, if it is detected that a new client has joined, S4 is executed.

4. The personalized federated learning method based on dynamic hierarchical control according to claim 1 is characterized in that: Said S2 updates the local model parameters as follows: ,accomplish; Where, are the updated local model parameters, is the local model parameter of the tth round, is the local model learning rate, is the bias coefficient, is the loss function.

5. A personalized federated learning system based on dynamic hierarchical control, characterized by: include: Initialization module: used to initialize the global model parameters on the server side, and send the initialized global model parameters to the local models of multiple clients to obtain the corresponding local models; Preprocessing module: used to train the corresponding local model using the local data of each client and update the local model parameters; Division module: After the updated local model parameters are uploaded to the server, they are processed by weighted average to obtain the aggregated local model parameters; according to the preset minimum personalization rate , preset maximum personalization rate , total iteration rounds and the current round , according to the formula: , calculate the current personalization rate ; Aggregated local model parameters Leverage current personalization rates Divide by the formula: , get the current global model parameters , specifically: Get the number of network layers on the server side. Multiply the current personalization rate by the number of network layers to get the number of layers not delivered. Subtract the number of layers not delivered from the number of network layers to get the number of layers delivered. Based on the number of delivered layers, reverse-infer the corresponding number of layers from the server-side network layer to get the network layer, which is used as the current global model parameter. New client detection module: The maximum number of local data samples uploaded to the server by the client in the partitioning module is recorded as the target number; Detect the total number of clients participating in the current training. If there are no new clients, enter the training module. If there are new clients, record the number of local data samples of the new clients as the number to be tested. Compare the number to be tested with the target number. If the number to be tested is not less than the target number, use the current global model parameters obtained by dividing using the preset minimum personalization rate as the current global model parameters for the new client. If the number of clients to be inspected is less than the target number, the current global model parameters obtained by dividing the client using the preset maximum personalization rate are used as the current global model parameters of the new client. Training module: Send the current global model parameters to the local model of the corresponding client currently being trained, return to the preprocessing module until the preset conditions are met, and obtain a personalized federated learning model for application in medical imaging diagnosis.

Citation Information

Patent Citations

  • Personalized federated learning method with efficient communication and privacy protection

    CN112668726A

  • Self-adaptive clustering federated learning method based on prototype network in heterogeneous scene

    CN119989034A