Personalized federal learning method and system based on dynamic hierarchical regulation and control

Through the federated learning method of dynamic hierarchical regulation and personalization rate division, the problems of data heterogeneity and new client joining in federated learning are solved, and the generalization ability and learning efficiency of the model are improved.

CN120235219AActive Publication Date: 2025-07-01SHANDONG UNIV OF SCI & TECH
View PDF 8 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In federated learning, the non-independent and homogeneous distribution of client data causes the model to perform poorly when multiple dispersed data sources, and the learning efficiency is low when new clients join, making it difficult to maintain the performance and generalization capabilities of the model.

Method used

A personalized federated learning method based on dynamic hierarchical regulation is adopted. By initializing global model parameters, using the personalization rate to dynamically divide and weighted average processing, combined with new client evaluation, appropriate parameter proportional migration is selected to achieve dynamic hierarchical regulation and rapid personalization of the model.

Benefits of technology

The generalization ability of the model and the learning efficiency of the new client are improved, so that the model can better adapt to diversified data sources and quickly adapt to the addition of new clients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120235219A_ABST
    Figure CN120235219A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of machine learning, and particularly relates to a personalized federal learning method and system based on dynamic hierarchical regulation, which dynamically divides model parameters of all clients received by a server side by using a personalized rate, realizes dynamic hierarchical regulation, is helpful to adjust the segmentation rate of a model more meticulously, and improves the learning efficiency. The model generalization ability is improved; and aiming at the addition of the new client in federated learning, the new client is evaluated, and the parameter proportion of the model migrated to the new client is selected according to the preset minimum individuation rate and the preset maximum individuation rate, so that the learning efficiency is improved, and the new client has the individualized federated learning capability quickly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of machine learning, and particularly 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 networked devices are not only equipped with high-performance hardware but also provide complex software functions, supporting a wide range of applications and generating a large amount of user data. The data generated by these devices often involves user privacy. Therefore, how to effectively utilize this vast amount of data while protecting privacy has become a major challenge in the field of machine learning. With the improvement of network edge computing capabilities and the increasing demand for privacy protection, a new solution - federated learning has emerged. Different from traditional distributed learning, federated learning emphasizes retaining data on local edge devices, using the computing resources of the devices for model training and inference, and only synchronizing parameters with the central server when necessary. This method effectively avoids the centralized storage and processing of user data, thus greatly enhancing data privacy protection.

[0003] One of the most important challenges in federated learning is the data heterogeneity problem. Due to its unique application scenarios, in actual use, the data faced by clients may not be independently and identically distributed (Non-Independent Identically Distribution, Non-IID), that is, for each client, the amount of data it has, the data classification and style it owns may all be different. In this scenario, if the server and clients learn a single shared model, the resulting model may perform poorly for many clients in the network. Therefore, when dealing with multiple decentralized data sources, it is necessary to effectively learn and aggregate data from different sources to maintain the performance and generalization ability of the model. Summary of the Invention

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

[0005] The technical solution of the present invention is as follows: The present invention provides a personalized federated learning method based on dynamic hierarchical regulation, including: 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 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 weighted averaged to obtain aggregated local model parameters; the current personalization rate is calculated according to the preset minimum personalization rate, the preset maximum personalization rate, the total iteration rounds and the current round; the aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters; S4: record the maximum number of local data samples in the client uploaded to the server in S3 as the target number; 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 to be tested with the target number, and 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; 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.

[0006] In S3, the current personalization rate is calculated according to the preset minimum personalization rate, the preset maximum personalization rate, the total iteration rounds and the current round, which is calculated by the formula: ,accomplish; In the formula, 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.

[0007] 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; In the formula, is the current global model parameter, is the local model parameter after aggregation, is the current personalization rate.

[0008] In S3, the aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters, which are 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 sent down, subtract the number of layers not sent down from the number of network layers to get the number of layers sent down, and reverse the number of layers from the network layer on the server side to get the network layer based on the number of sent down, which is used as the current global model parameter.

[0009] After the updated local model parameters in S3 are uploaded to the server side, they are processed by weighted averaging to obtain the aggregated local model parameters, which are implemented by the formula: , implemented; In the formula, is the aggregated local model parameter, is the local model parameter updated by the th client, is the total number of data samples of all clients, is the th client's number of data samples, is the total number of clients participating in the current training.

[0010] After obtaining the personalized federated learning model in S5, it further includes that if it is detected that a new client joins, then execute S4.

[0011] In S2, the local model parameters are updated by the formula: , implemented; In the formula, is the updated local model parameter, is the local model parameter of the t-th round, is the local model learning rate, is the bias coefficient, is the loss function.

[0012] The present invention also provides a personalized federated learning system based on dynamic hierarchical regulation, including: Initialization module: used to initialize the global model parameters of 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 with the local data of each client and update the local model parameters; Partitioning module: after the updated local model parameters are uploaded to the server side, they are processed by weighted averaging to obtain the aggregated local model parameters; calculate the current personalization rate according to the preset minimum personalization rate, preset maximum personalization rate, total number of iteration rounds, and current round; the aggregated local model parameters are partitioned using the current personalization rate to obtain the current global model parameters; New client detection module: Divide the maximum number of local data samples of the clients uploaded to the server side in the division module, and record it 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 detected. Compare the number to be detected with the target number. If the number to be detected is not less than the target number, use the current global model parameters obtained by dividing with the preset minimum personalization rate as the current global model parameters of the new clients; If the number to be detected is less than the target number, use the current global model parameters obtained by dividing with the preset maximum personalization rate as the current global model parameters of the new clients; Training module: Send the current global model parameters to the local models of the corresponding clients in the current training, and return to enter the preprocessing module until the preset conditions are met to obtain a personalized federated learning model.

[0013] Beneficial effects The present invention 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 generalization ability of the model; And for the addition of new clients in federated learning, the present invention also evaluates the new clients and selects the parameter ratio transferred to the new client model according to the preset minimum personalization rate and preset maximum personalization rate, so as to improve the learning efficiency and enable the new clients to quickly have the ability of personalized federated learning. Description of the drawings

[0014] Figure 1 It is a schematic structural diagram of a personalized federated learning method based on dynamic hierarchical regulation of the present invention. Detailed implementation manners

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

[0016] The present invention provides a personalized federated learning method based on dynamic hierarchical regulation, including: S1: Initialize the global model parameters of the server side, and send the initialized global model parameters to the local models of multiple clients to obtain the corresponding local models.

[0017] For example, the application of federated learning in the medical field can enable different hospitals and medical institutions to cooperate in training diagnostic models without sharing patient data, so as to improve the universality and accuracy of the models. Next, taking medical image diagnosis as an example, how to implement federated learning using the method of the present application will be described.

[0018] First, multiple hospitals or medical institutions determine the medical image 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.

[0019] Then, define the initial parameters of the model on the server. The initial parameters are usually pre-trained from a large dataset (such as a publicly available medical image database).

[0020] After that, the server side establishes a communication connection with the client side (multiple hospitals or medical institutions). The client side receives the initialized model parameters from the server side to help each client build a medical image diagnosis model.

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

[0022] First, preprocess the local data of each client, including data cleaning, removing missing values, outliers, and duplicate data, etc., to ensure data quality.

[0023] Then, each hospital or medical institution uses its own local medical image data to train the local model. Suppose there are three hospitals, and they use their own image data to train the model respectively. These data may include X-ray films, MRI scan images, etc.

[0024] In each hospital, the model is adjusted and trained according to the local data, and the local model parameters are updated. For example, Hospital A uses chest X-ray images to train the model, Hospital B uses CT images to train the model, and Hospital C uses MRI images to train the model. Each hospital trains its own local model, and the data always remains within the hospital. The local models are all medical image diagnosis models.

[0025] Preferably, updating the local model parameters is achieved by the formula: , where is the local model parameter updated after t rounds of training, is the local model parameter of the t-th round, is the local model learning rate, is the bias coefficient, is the loss function.

[0026] S3: After the updated local model parameters are uploaded to the server side, they are processed by weighted average to obtain the aggregated local model parameters; calculate the current personalization rate according to the preset minimum personalization rate, preset maximum personalization rate, total number of iteration rounds, and the current round; divide the aggregated local model parameters by the current personalization rate to obtain the current global model parameters.

[0027] In the upload stage of S3, after the local data of each hospital has completed local model training, the updated parameters of the local model (e.g., the weight changes of the neural network layers) are sent to the server side. Importantly, the hospital only uploads the model parameters, rather than the medical image data itself.

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

[0029] Then, the server side dynamically partitions the model parameters of all uploaded clients and distributes them to the clients.

[0030] In the partitioning stage, preferably, after the updated local model parameters are uploaded to the server side, they are processed by weighted averaging to obtain the aggregated local model parameters, which is achieved by the formula: . In the formula, is the aggregated local model parameter, is the updated local model parameter of the th client, is the total number of data samples of all clients, is the number of data samples of the th client, is the total number of clients participating in the current training.

[0031] For example, after the server side receives model updates from multiple hospitals, it uses the aggregation method of federated learning to merge these updated parameters of the local models. This application uses the weighted average method to weight the contribution of each hospital model according to its local data volume or training quality. During the aggregation process, all transmitted model updates are encrypted to protect the privacy of hospitals and patients.

[0032] Preferably, according to the preset minimum personalization rate, preset maximum personalization rate, total number of iteration rounds, and current round, the current personalization rate is calculated, which is achieved by the formula: . The personalization rate is dynamically changing and the overall trend is gradually increasing; In the formula, is the current personalization rate, is the preset minimum personalization rate, is the preset maximum personalization rate, is the current round, is the total number of iteration rounds in a cycle.

[0033] Furthermore, the aggregated local model parameters are partitioned using the current personalization rate to obtain the current global model parameters, which is achieved by the formula: . In the formula, is the current global model parameter, is the aggregated local model parameter, is the current personalization rate.

[0034] Specifically: Obtain the number of network layers on the server side. Multiply the current personalization rate by the number of network layers to obtain the non - distributed layers. After subtracting the non - distributed layers from the number of network layers, obtain the distributed layers. According to the distributed layers, reverse - infer the corresponding number of network layers from the tail of the network layers on the server side, and use the obtained network layers as the current global model parameter.

[0035] For example, the composition of the network layers is in sequence: Zero Padding, CONV, Batch Norm, ReLu, Max Pool, Conv Block, ID Block, Conv Block, ID Block, Conv Block, ID Block, Conv Block, ID Block, Avg Pool, Flattening, FC. If the calculated distributed layers are 5, then the 5 network layers of Conv Block, ID Block, Avg Pool, Flattening, and FC constitute the current global model parameter. Then, send the current global model parameter to the client. After receiving it, the client loads the current global model parameter into its own local model and keeps the layers not received unchanged.

[0036] That is to say, the server side divides the aggregated local model parameter dynamically through the personalization rate into the global model parameter sent to the client to participate in the local model update , and the personalized model parameter not sent to the client .

[0037] For the data heterogeneity problem caused by the differences in distribution, features, labels, or data quality of data from different clients (such as devices, hospitals, companies, etc.), the present invention dynamically divides the model parameters of all clients received by the server side using the personalization rate, realizes dynamic hierarchical regulation, helps to more finely adjust the segmentation rate of the model, and improves the generalization ability of the model.

[0038] S4: Denote the largest local data sample number among the clients uploaded to the server side in S3 as the target number N max ; 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, denote the local data sample number of the new client as the number to be detected , compare the quantity to be inspected with the target quantity N max , if the quantity to be inspected is not less than the target quantity N max , then use the preset minimum personalization rate to divide the obtained current global model parameters as the current global model parameters of the new client; if the quantity to be inspected is less than the target quantity N max , then use the preset maximum personalization rate to divide the obtained current global model parameters as the current global model parameters of the new client.

[0039] In actual operation, for the addition of a new client, let the new client perform transfer learning (DTL), that is, if the quantity to be inspected is not less than the target quantity , then after aggregating the local model parameters and dividing them using the preset minimum personalization rate , the obtained current global model parameters are the current global model parameters of the new client, as the source domain , and the local data samples of the new client are the target domain , where represents the sample, represents the label, is the number of local data samples of the new client. That is: use the source domain to quickly learn the model for the new client so that it performs well in the target domain , that is, minimize the loss function of the target domain.

[0040] Similarly, if the quantity to be inspected is less than the target quantity , then after aggregating the local model parameters and dividing them using the preset maximum personalization rate , the obtained current global model parameters are the current global model parameters of the new client, as the source domain , and the local data samples of the new client are the target domain .

[0041] For the addition of a new client in federated learning, the present invention first evaluates the new client and selects the parameter ratio of the model migrated to the new client according to the preset minimum personalization rate and preset maximum personalization rate, so as to improve the learning efficiency and enable the new client to quickly have the ability of personalized federated learning.

[0042] S5: Send the current global model parameters to the local models of the corresponding clients currently being trained, and return to execute S2 until a preset condition is reached to obtain a personalized federated learning model.

[0043] That is to say, each client receives the current global model parameters of the server side , which are used to replace the original model parameters of its own shared model part, and then continue training. With each round of training, the diagnostic ability of the model is continuously improved. By combining data from different hospitals, the model can learn a wider range of imaging features and improve the diagnostic accuracy for different types of diseases. Among them, the preset condition can be the preset number of rounds or the preset correct rate of the model. Eventually, the model can achieve the ability to identify a wider range of pathological features and improve the diagnostic accuracy by combining data from multiple medical institutions.

[0044] In addition, after obtaining the personalized federated learning model in S5, if it is detected that a new client joins, S4 is executed.

[0045] That is to say, whether in the training process or in the actual application of the personalized federated learning model, if a new client joins, the new client is first evaluated to determine the corresponding source domain and trained so that the new client can quickly have the ability of personalized federated learning.

[0046] The present invention 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 generalization ability of the model; and for the addition of new clients in federated learning, the present invention first evaluates the new clients and selects the parameter ratio transferred to the new client model according to the preset minimum personalization rate and preset maximum personalization rate, so as to improve the learning efficiency and enable the new client to quickly have the ability of personalized federated learning.

[0047] The present invention also provides a personalized federated learning system based on dynamic hierarchical regulation, including: Initialization module: used to initialize the global model parameters of 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 side, they are processed by weighted average to obtain the aggregated local model parameters; calculate the current personalization rate according to the preset minimum personalization rate, preset maximum personalization rate, total number of iteration rounds and the current round; divide the aggregated local model parameters using the current personalization rate to obtain the current global model parameters; New client detection module: Denote the maximum number of local data samples of the client uploaded to the server side in the partitioning module as the target quantity; Detect the total number of clients participating in the current training. If there is no new client, enter the training module. If there is a new client, denote the number of local data samples of the new client as the quantity to be detected. Compare the quantity to be detected with the target quantity. If the quantity to be detected is not less than the target quantity, use the current global model parameters obtained by partitioning with the preset minimum personalization rate as the current global model parameters of the new client; If the quantity to be detected is less than the target quantity, use the current global model parameters obtained by partitioning with the preset maximum personalization rate as the current global model parameters of the new client; Training module: Send the current global model parameters to the local models of the corresponding clients in the current training, and return to enter the preprocessing module until the preset conditions are met to obtain the personalized federated learning model.

Claims

1. A personalized federated learning method based on dynamic hierarchical regulation, characterized in that, include: S1: Initialize the server-side global model parameters, 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 weighted averaged to obtain aggregated local model parameters; the current personalization rate is calculated according to the preset minimum personalization rate, the preset maximum personalization rate, the total iteration rounds and the current round; the aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters; 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 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 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 to be inspected 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; 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.

2. The personalized federated learning method based on dynamic hierarchical regulation according to claim 1, wherein, S3. Calculate the current personalization rate according to the preset minimum personalization rate, preset maximum personalization rate, total number of iteration rounds, and current round, which is implemented by the formula: , and is realized; Wherein, is the current personalization rate, is the preset minimum personalization rate, is the preset maximum personalization rate, is the current round, is the total number of iterative rounds.

3. A personalized federated learning method based on dynamic hierarchical regulation according to claim 1, characterized in that, In step S3, the aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters, which is achieved by the formula: , where; wherein, is the current global model parameter, is the aggregated local model parameter, is the current personalization rate.

4. A personalized federated learning method based on dynamic hierarchical regulation according to claim 1, characterized in that, In S3, the aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters, which are 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 sent down, subtract the number of layers not sent down from the number of network layers to get the number of layers sent down, and reverse the number of layers from the network layer on the server side to get the network layer based on the number of sent down, which is used as the current global model parameter.

5. A personalized federated learning method based on dynamic hierarchical regulation according to claim 1, characterized in that After the updated local model parameters in S3 are uploaded to the server side, they are processed by weighted averaging to obtain the aggregated local model parameters, which are implemented by the formula: , implemented; wherein, are the aggregated local model parameters, is the local model parameter updated by the -th client, is the total number of data samples of all clients, is the number of data samples of the -th client, is the total number of clients participating in the current training.

6. A personalized federated learning method based on dynamic hierarchical regulation 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.

7. A personalized federated learning method based on dynamic hierarchical regulation according to claim 1, characterized in that, The S2 updates the local model parameters, which is implemented by the formula: , to achieve; In the formula, is the updated local model parameter, is the local model parameter at the t-th round, is the local model learning rate, is the bias coefficient, is the loss function.

8. A personalized federated learning system based on dynamic hierarchical regulation, characterized in that 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; Partitioning module: After the updated local model parameters are uploaded to the server, they are processed by weighted average to obtain aggregated local model parameters; the current personalization rate is calculated according to the preset minimum personalization rate, the preset maximum personalization rate, the total iteration rounds and the current round; the aggregated local model parameters are divided using the current personalization rate to obtain the current global model parameters; New client detection module: the maximum number of local data samples of the client uploaded to the server in the partition 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 quantity to be inspected. Compare the quantity to be inspected with the target quantity. If the quantity to be inspected is not less than the target quantity, use the current global model parameters obtained by partitioning with the preset minimum personalization rate as the current global model parameters of the new clients; If the quantity to be inspected is less than the target quantity, use the current global model parameters obtained by partitioning with the preset maximum personalization rate as the current global model parameters of the new clients; Training module: Send the current global model parameters to the local models of the corresponding clients in the current training, and return to enter the preprocessing module until the preset conditions are met to obtain the personalized federated learning model.

Citation Information

Patent Citations

  • Personalized federated learning method with efficient communication and privacy protection

    CN112668726A

  • High-generalization personalized federal learning implementation method

    CN115511109A

  • Heterogeneous test method, system and equipment for federal learning task and storage medium

    CN116257427A

  • Personalized blind box extraction method and device, electronic equipment and storage medium

    CN117009655A

  • Dynamic federated learning cluster division method, terminal and edge server

    CN117436547A