An adaptive personalized federated learning method supporting heterogeneous models

By employing an adaptive personalized federated learning approach, and leveraging adaptive learning and model optimization at both the central server and participant ends, the problem of data and model heterogeneity in federated learning is solved, achieving high accuracy and privacy protection across different scenarios.

CN115271099BActive Publication Date: 2026-06-05ZHEJIANG UNIV ZHONGYUAN INST +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV ZHONGYUAN INST
Filing Date
2022-08-01
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing federated learning methods struggle to be effective in scenarios with varying degrees of data heterogeneity, and they also fail to effectively protect participant privacy and model structure.

Method used

An adaptive personalized federated learning approach is adopted, in which a global shared model is initialized through a central server and adaptive learning is performed on the participants' end. The weights of private models are updated using the stochastic gradient descent algorithm, and the model ensemble is optimized by combining KL divergence and cross-entropy loss function to achieve adaptive training of heterogeneous models.

Benefits of technology

It improves model accuracy in scenarios with varying degrees of data heterogeneity, protects participant data and model privacy, is highly adaptable, and is suitable for existing federated learning systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115271099B_ABST
    Figure CN115271099B_ABST
Patent Text Reader

Abstract

The application discloses a kind of self-adapting personalized federated learning methods of supporting heterogeneous model, the method is based on the model of each participant using structure different in supporting federated learning, by learning dynamic weight for model integration and introducing optimization target for model integration in the process of training model parameters, realize the high accuracy of data heterogeneous self-adapting personalized federated learning, can make participants benefit from federated learning in the scene of different degrees of data heterogeneity.The self-adapting personalized federated learning method of the application does not need to introduce new hyperparameters, can be conveniently deployed in existing federated learning system;Compared with traditional personalized federated learning method, the application has stronger adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to an adaptive personalized federated learning method that supports heterogeneous models. Background Technology

[0002] Artificial intelligence (AI) has become a crucial technology driving socio-economic development, deeply integrated into every aspect of people's lives. As core AI technologies, represented by deep learning, continue to achieve breakthroughs, AI increasingly relies on massive amounts of data for model training. However, this has led to the problem of excessive collection and use of personal privacy data, causing growing public awareness and concern about data privacy. The introduction of data regulatory policies and the emergence of related regulatory technologies have promoted the development of privacy-preserving AI technologies, and facilitated the advancement of federated learning—a computational paradigm that collaboratively trains machine learning models among multiple participants while protecting data privacy.

[0003] However, existing federated learning methods face two major challenges: data heterogeneity and model heterogeneity. On the one hand, the non-independent and identically distributed (non-IID) nature of training data distributed across participating devices severely limits the effectiveness of federated learning. Many studies have shown that traditional federated averaging methods converge slowly or even fail to converge when the data held by each participant is unevenly distributed. Although many researchers have proposed various personalized federated learning methods to address the data heterogeneity problem, such as those based on regularization, local tuning, model interpolation, and multi-task learning, these methods are only applicable to scenarios with a certain degree of data heterogeneity. In practice, because training data is widely distributed across participating devices, the degree of data heterogeneity is often unknown, making it difficult to select appropriate personalized federated learning methods. This has spurred the demand for adaptive personalized federated learning techniques. On the other hand, existing personalized federated learning methods are more geared towards isomorphic models, where all participants need to use models with the same structure. However, in federated learning scenarios where participants come from different business organizations, each participant may prefer to use a model that is more suitable for their own business data, and the model structure may be a confidential information of each organization. Therefore, federated learning methods that enable differentiated model structures can further protect participant privacy and provide a higher degree of personalization.

[0004] Deep Mutual Learning provides the technical foundation for training two different models simultaneously on the same data. Based on this, researchers have proposed the Federated Mutual Learning method. In Federated Learning, participants train a private model and a globally shared model simultaneously. The private model is kept locally, and its model structure and parameters are not shared. However, the structure and parameters of the globally shared model are consistent across all participants. The central server is responsible for periodically aggregating and distributing the data, serving as a medium for knowledge sharing among the participants.

[0005] In federated learning systems, each participant holds two distinct models: a private model and a globally shared model. A simple approach to improve model accuracy is to average the output predictions of both models and use the averaged result as the final outcome. However, the two models perform differently on various datasets: in highly heterogeneous datasets, the private model learns well the distribution of the corresponding participant's private dataset, resulting in better accuracy on that dataset. The globally shared model, however, is affected by data heterogeneity and typically exhibits lower accuracy. Conversely, in homogeneous datasets, the globally shared model benefits from knowledge sharing among multiple participants, leading to better accuracy. In this case, the private model relies primarily on the knowledge of the corresponding participant, resulting in lower accuracy. Directly integrating the two models in this scenario would severely impact the overall accuracy of the integrated model, which suffers from lower accuracy. Summary of the Invention

[0006] In view of the above, the present invention provides an adaptive personalized federated learning method that supports heterogeneous models, so as to carry out adaptive personalized federated learning when the private model structure and parameters of the participants are unknown, and enable the participants to benefit from federated learning in scenarios with different degrees of data heterogeneity.

[0007] An adaptive personalized federated learning method supporting heterogeneous models includes the following steps:

[0008] (1) The parameters of the globally shared model are initialized by the central server;

[0009] (2) The central server distributes the global shared model parameters to each participant in the federated learning. After receiving the global shared model parameters, the participants use the parameters to update their own global shared model.

[0010] (3) Participants perform adaptive force learning to update the weights of the private model;

[0011] (4) Participants use newly acquired private training data to simultaneously train a private model and a globally shared model based on the stochastic gradient descent algorithm;

[0012] (5) Participants upload the globally shared model parameters after one round of iterative training to the central server;

[0013] (6) After the central server collects enough global shared model parameters, it aggregates these model parameters to obtain new global shared model parameters, and then returns to the execution step (2) to distribute the new global shared model parameters to each participant. This process is repeated until the loss function of all models converges or the maximum number of iterations is reached.

[0014] Furthermore, the globally shared model is trained by the participants in the federated learning process, and aggregated by the central server. Each participant holds a copy of the globally shared model, which serves as a medium for knowledge sharing among the participants, both for their inference after the federated learning training is completed and for their use in sharing knowledge.

[0015] Furthermore, the private model is a model held by each participant in the federated learning process, and its structure and parameters are not publicly disclosed. The structures of the private models held by each participant are not entirely the same.

[0016] Furthermore, the participants are terminal devices in the federated learning system. In order to benefit from the federated learning system, i.e., to obtain model parameters with higher accuracy, they upload model parameters to the central server and download aggregated model parameters from the central server.

[0017] Furthermore, the specific implementation of step (3) is as follows: the participant first divides a small portion (e.g., 5% of the training data) from the obtained private training data as a validation set, and performs inference on the validation set using the private model and the globally shared model to obtain the prediction output p of the private model. pri The prediction output p of the globally shared model sha The participants then updated the weights of the private model using stochastic gradient descent, with the update expression as follows:

[0018]

[0019] Where: λ i λ′ represents the weights of the private model before the update. i The weights of the updated private model, where η represents the learning rate. L represents CE (p aen ,y) for λ i Find the gradient, L CE (p aen ,y) represents p aen Cross-entropy with y, p aen p pri With p shaThe result after weighted averaging, where y is the true value label.

[0020] Furthermore, the loss function expression used for training the private model in step (4) is as follows:

[0021] L pri =L CE (p pri ,y)+D KL (p pri ||p sha )+L CE (p aen ,y)

[0022] Where: L pri L is the loss function for the private model. CE (p pri ,y) represents p pri Cross-entropy with y, L CE (p aen ,y) represents p aen Cross-entropy with y, D KL (p pri ||p sha ) represents p pri Relative to p sha KL divergence, p aen p pri With p sha The result after weighted averaging, where y is the truth label and p pri p represents the predicted output of the private model. sha This is the prediction output of the globally shared model.

[0023] Furthermore, the loss function expression used for training the globally shared model in step (4) is as follows:

[0024] L sha =L CE (p sha ,y)+D KL (p sha ||p pri )+L CE (p aen ,y)

[0025] Where: L sha L is the loss function for the globally shared model. CE (p sha ,y) represents p sha Cross-entropy with y, L CE (p aen ,y) represents p aen Cross-entropy with y, D KL (p sha||p pri ) represents p sha Relative to p pri KL divergence, p aen p pri With p sha The result after weighted averaging, where y is the truth label and p pri p represents the predicted output of the private model. sha This is the prediction output of the globally shared model.

[0026] Furthermore, in step (6), after collecting a sufficient number of globally shared model parameters, the central server executes a federated averaging algorithm to aggregate these model parameters, and then distributes the aggregated new globally shared model parameters to each participant.

[0027] This invention, based on the use of models with different structures by various participants in federated learning, achieves highly accurate, data-heterogeneous adaptive, personalized federated learning by learning dynamic weights for model ensemble and introducing optimization objectives for model ensemble during model parameter training. This enables participants to benefit from federated learning in scenarios with varying degrees of data heterogeneity. Furthermore, this adaptive personalized federated learning method does not require the introduction of new hyperparameters and can be easily deployed in existing federated learning systems. Specifically, this invention has the following beneficial technical effects:

[0028] 1. This invention enables federated learning that supports heterogeneous models. While protecting the privacy of participants' private training data from being leaked, it further protects the privacy of participants' model structures, achieving a broader level of privacy protection.

[0029] 2. This invention enables an adaptive, personalized federated learning method that allows participants in federated learning to benefit from it (achieving higher accuracy models compared to using only local private data) in scenarios with varying degrees of data heterogeneity.

[0030] 3. This invention solves the problem that existing personalized federated learning methods are only effective in scenarios with a specific degree of data heterogeneity; compared with traditional personalized federated learning methods, this invention has stronger adaptability. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of the adaptive personalized federated learning system architecture of the present invention.

[0032] Figure 2 This is a flowchart illustrating the adaptive personalized federated learning method of the present invention. Detailed Implementation

[0033] To describe the present invention in more detail, the technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0034] The system architecture supporting the adaptive personalized federated learning method for heterogeneous models in this invention is as follows: Figure 1 As shown, the system mainly consists of two parts: a central server and participants. The central server is responsible for coordinating the running of federated learning methods by each participant, including the initialization of the global shared model, the reception, aggregation and distribution of the global shared model, and checking whether the global shared model has converged or whether the adaptive personalized federated learning method has reached a sufficient number of rounds to decide whether to terminate the method.

[0035] In this embodiment, each participant collaboratively trains an image classification model using the method of the present invention, and uses the private model and the globally shared model obtained from the training to perform subsequent inference.

[0036] First, the participants coordinate to select a model for image classification as a globally shared model, and jointly agree on parameters such as the number of iterations for the overall method. Then, under the coordination of the central server, as follows... Figure 2 The following process steps are shown:

[0037] (1) Initialize the global shared model: The central server initializes the parameters of the selected global shared model. The initialization algorithm can be coordinated in advance by each participant, such as through the Xavier initialization method or the Kaiming initialization method. This embodiment does not impose any constraints.

[0038] (2) Global shared model distribution: After the parameters of the global shared model are initialized, the central server distributes the parameters of the global shared model to each participant in the federated learning. After receiving the parameters of the global shared model, each participant updates its own global shared model.

[0039] (3) Learning Adaptability: In this embodiment, each participant in the federated learning process holds a private training set consisting of several training private data samples, where each training data sample is a labeled image. Each participant randomly samples 5% of the training data from its own private training set as a validation set. For each data sample in the validation set, it is used as input to the private model and the globally shared model for inference, obtaining the classification result p output by the private model. pri The classification result p output by the globally shared model sha And the weighted average classification result p is obtained according to the following formula. aen :

[0040] p aen =λ i ·p pri+(1-λ i )·p sha

[0041] The participant's private model weight coefficients λ are then updated using the stochastic gradient descent algorithm. i As shown in the following formula:

[0042]

[0043] Where: y represents the image label.

[0044] In this embodiment, in order to improve λ i To ensure the stability of the learning process, λ is updated using mini-batch gradient descent. i This involves packaging several images into a batch of data and inputting it into two models at once to obtain the classification results for that batch of data. Then, the weights λ are updated according to the above formula based on the classification results of that batch of data. i After several iterations, λ i The adaptive force learning step ends when the force converges to a suitable value. In this embodiment, λ i Iterate and update the validation set for several epochs. Note that for λ... i The scheme that modifies the number of iterations and updates is still within the protection scope of this invention.

[0045] (4) Learning Ensemble: Each participant runs this step independently; for one participant, it uses its own private training data to simultaneously train a private model and a globally shared model based on the stochastic gradient descent algorithm. The objective of training the private model is to minimize the loss function L defined as follows. pri :

[0046] L pri =L CE (p pri ,y)+D KL (p pri ||p sha )+L CE (p aen ,y)

[0047] Where: L CE (p,y) represents the cross-entropy loss function calculated based on the image classification result p and the true label y of the image output by the model, D KL (p pri ||p sha ) represents the classification result p output by the private model. pri The classification result p output by the relative global shared model sha Calculated KL divergence;

[0048] The goal of training a globally shared model is to minimize the loss function L defined as follows. sha :

[0049] L sha =L CE (p sha ,y)+D KL (p sha ||p pri )+L CE (p aen ,y)

[0050] To accomplish the above training task, this embodiment employs a mini-batch gradient descent approach. Specifically, assuming the k-th batch of data is used in the t-th training iteration, the classification result p is obtained by using the k-th batch of data as input, based on the private model and the globally shared model trained in the (t-1)-th iteration. pri and p sha Then according to L pri Update the private model according to the definition of L, and then according to L sha The definition of the global shared model is updated; after repeating the above steps for several cycles, the learning ensemble step ends.

[0051] (5) Global shared model upload: After completing steps (3) and (4) of training, participants in federated learning upload their trained global shared model to the central server, while keeping their private model locally.

[0052] (6) Global Shared Model Aggregation and Distribution: After receiving enough global shared models, the central server performs federated averaging to aggregate these models. Considering that participants in federated learning are usually not on the same local area network and that the performance of each participant's device varies, the central server sets a certain waiting time. Global shared models received within the waiting time window will be used for aggregation. After the time window ends, no more global shared models for the current round will be received. After the time window for the current round ends, the central server aggregates a new global shared model using the federated averaging algorithm. The aggregation process is shown in the following equation:

[0053]

[0054] Where: w sha This represents the new globally shared model after aggregation. This represents the globally shared model uploaded by the i-th participant.

[0055] Subsequently, the central server distributes the new global shared model after aggregation to each participant; after each step (6) is completed, the central server will check whether the number of iterations of the method has reached the preset number of overall iterations, or whether the accuracy of the model has not been further improved after several consecutive rounds of aggregation; if either of the above two conditions is met, the method terminates, otherwise it will be re-executed from step (3).

[0056] The above description of the embodiments is provided to enable those skilled in the art to understand and apply the present invention. Those skilled in the art can readily make various modifications to the above embodiments and apply the general principles described herein to other embodiments without creative effort. Therefore, the present invention is not limited to the above embodiments, and any improvements and modifications made to the present invention by those skilled in the art based on the disclosure thereof should be within the scope of protection of the present invention.

Claims

1. An adaptive personalized federated learning method supporting heterogeneous models, comprising the following steps: (1) The parameters of the global shared model are initialized by the central server, wherein the global shared model is a model for image classification; (2) The central server distributes the global shared model parameters to each participant in the federated learning. After receiving the global shared model parameters, the participants use the parameters to update their own global shared model. (3) Participants perform adaptive force learning to update the weights of the private model. Specifically, participants first allocate a small portion of the obtained private training data as a validation set, and then perform inference on the validation set using both the private model and the globally shared model to obtain the predicted output of the private model. and the prediction output of the globally shared model The participants then updated the weights of the private model using stochastic gradient descent, with the update expression as follows: in: The weights of the private model before the update. For the updated weights of the private model, Indicates the learning rate. express right Find the gradient. express Cross-entropy with y express and The weighted average result, y is the true value label; the private model is a model held by each participant in the federated learning, and its structure and parameters are not publicly disclosed. The private model structures held by each participant are not exactly the same. (4) Participants use the newly acquired private training data to simultaneously train a private model and a globally shared model based on the stochastic gradient descent algorithm; The loss function used for training the private model is expressed as follows: The loss function used for training the globally shared model is expressed as follows: in: For the loss function of the private model, express Cross-entropy with y express Compared to KL divergence, For the loss function of the globally shared model, express Cross-entropy with y express Compared to KL divergence; (5) Participants upload the globally shared model parameters after one round of iterative training to the central server; (6) After the central server collects enough global shared model parameters, it aggregates these model parameters to obtain new global shared model parameters, and then returns to the execution step (2) to distribute the new global shared model parameters to each participant. This process is repeated until the loss function of all models converges or the maximum number of iterations is reached.

2. The adaptive personalized federated learning method according to claim 1, characterized in that: The globally shared model is trained by the participants in the federated learning process and aggregated by the central server. Each participant holds a copy of the globally shared model, which serves two purposes: firstly, it is used by the participants for inference after the federated learning process is completed, and secondly, it acts as a medium for the participants to share knowledge.

3. The adaptive personalized federated learning method according to claim 1, characterized in that: The participants are terminal devices in the federated learning system. In order to benefit from the federated learning system, i.e., to obtain model parameters with higher accuracy, they upload model parameters to the central server and download aggregated model parameters from the central server.

4. The adaptive personalized federated learning method according to claim 1, characterized in that: In step (6), after collecting enough global shared model parameters, the central server executes the federated averaging algorithm to aggregate these model parameters, and then distributes the aggregated new global shared model parameters to each participant.