A personalized federated learning method based on meta-learning

By deploying a personalized federated learning method based on meta-learning in an IoT environment, and employing the technical means of federated learning based on meta-learning, the meta-network and the base network are trained alternately between cloud servers and clients. This solves the problem of using client model parameters as features, realizes automatic analysis of model parameters between clients to identify similarities between clients, and enables collaborative training between clients. It also solves the flexibility and stability problems of existing federated learning methods when dealing with heterogeneous clients, and achieves both flexibility and stability in personalized modeling.

CN115481560BActive Publication Date: 2025-11-28BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110660559.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-15
Publication Date
2025-11-28
Estimated Expiration
2041-06-15

AI Technical Summary

Technical Problem

Existing federated learning methods lack flexibility when dealing with clients with heterogeneous data, making it difficult to achieve good personalized modeling performance. Especially in IoT environments with limited computing resources, existing methods have high algorithmic complexity and are difficult to deploy in real-world environments.

Method used

This paper describes a personalized federated learning method based on meta-learning deployed on the client side. By using model parameters as features, a personalized federated learning method based on meta-learning is adopted. The meta-network and the base network are trained alternately between the cloud server and the client. The similarity between model parameters on the client is automatically analyzed. This meta-learning technique enhances the flexibility and stability of training by training model parameters through alternating training.

Benefits of technology

This patent can be applied to the field of federated learning technology, specifically involving federated learning methods deployed in an Internet of Things (IoT) environment, and specifically to personalized federated learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115481560B_ABST
    Figure CN115481560B_ABST
Patent Text Reader

Abstract

A personalized federated learning method based on meta learning relates to the technical field of federated learning method, solves the problems of low flexibility of collaborative training and complex algorithm, step one, the cloud server confirms the number of clients, sets the hyperparameters of the basic network and the meta network, and initializes the global model parameters; step two, the client downloads the global model parameters, and trains the local model according to the hyperparameters and the local data set; step three, upload the local model parameters, the cloud server calculates the global model parameters by using the global model aggregation method; step four, return to step two until the client gets stable local model parameters; step five, the client downloads the global model parameters and all local model parameters from the cloud server, alternately trains the meta network and the basic network, and the cloud server saves the local model parameters and calculates to update the global model parameters; step six, repeat step five until the local model reaches the required accuracy or converges. The process of the present application has flexibility and simple algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of federated learning methods, and particularly relates to a personalized federated learning method based on meta-learning. BACKGROUND

[0002] Recently, a large number of smart sensing applications oriented to decentralized data have witnessed the vigorous development of federated learning technology. Through its distributed structure, federated learning can run collaboration among a group of clients, protect client data privacy, and achieve better machine learning performance than individual work. Personalized federated learning aims to maintain a personalized model for each client while collaborating with the cloud server. Generally speaking, existing personalized federated learning methods can be divided into three categories, namely local fine-tuning method, model regularization method and multi-task learning method.

[0003] In local fine-tuning, each client receives a global model and fine-tunes it using its own local data and a few gradient descent steps. For example, J. Feng et al. (J. Feng, C. Rong, F. Sun, D. Guo, and Y. Li, “Pmf: A privacy-preserving human mobility prediction framework via federated learning,” Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, vol. 4, no. 1, pp. 1-21, 2020.) designed two personal adapters (personal bias, personal filter) for the higher layer of the user local model, which can be fine-tuned according to the user’s personal information. M. G. Arivazhagan et al. (M. G. Arivazhagan, V. Aggarwal, A. K. Singh, and S. Choudhary, “Federated learning with personalization layers,” arXiv, 2019.) proposed a base layer + personalization method, which only collaboratively trains the base layer. In model regularization, F. Hanzely et al. (F. Hanzely and P. Richtárik, “Federated learning of a mixture of global and local models,” arXiv, 2020.) added a regularization term on the distance between the local model and the global model, and used a mixing parameter to control the degree between them. T. Shen et al. (T. Shen, J. Zhang, X. Jia, F. Zhang, G. Huang, P. Zhou, F. Wu, and C. Wu, “Federated mutual learning,” arXiv, 2020) proposed a knowledge distillation method to achieve personalization, in which they applied regularization to the prediction between the local model and the global model. These methods use a unified global model as the basis for personalization and cannot provide flexible personalized modeling for various potential tasks on data-heterogeneous clients.

[0004] V. Smith et al. (V. Smith, C.-K. Chiang, M. Sanjabi, and A. S. Talwalkar, “Federated multi-task learning,” in Advances in Neural Information Processing Systems, 2017, pp. 4424-4434.) proposed a federated multi-task learning method, which treats the optimization of each client as a new task. It solves the problems of communication constraints, discreteness, and fault tolerance, and focuses on convex models. However, due to the strict requirement of the method for the strong duality of the local model, when the client uses a non-convex deep learning model, the method is no longer applicable. Y. Huang et al. (Y. Huang, L. Chu, Z. Zhou, L. Wang, J. Liu, J. Pei, and Y. Zhang, “Personalized cross-silo federated learning on non-iid data,” AAAI, 2020.) use a function containing an attention mechanism to measure the difference between model parameters. Although it simulates the pairwise collaboration between clients, it still has limitations in describing the dynamic collaboration between clients.

[0005] Existing federated learning methods can be well applied to clients with similar data characteristics and distribution, but in many application scenarios, the distribution, number, and concept of the client dataset can be different. This makes it difficult for existing federated learning to consider the problem of data attribute heterogeneity of clients when using the global model for collaborative training, and it is difficult to achieve good personalized modeling performance. Ideally, an effective method is to maintain the personalized model of the client while the client uses the global model to achieve collaborative training. Recently, some methods have integrated the personalized modeling problem of the client into federated learning. These works take the global model as the initial value, fine-tune the global model during the client training process, and achieve personalized model establishment suitable for the client. However, the unified global model still makes the process of collaborative training lack flexibility.

[0006] Meta-learning is an active research field in artificial intelligence in recent years. Due to its good generalization under limited training data, it is widely used in few-shot learning, reinforcement learning, transfer learning, etc. In recent years, meta-learning has also been used in personalized federated learning. Y. Jiang et al. (Y. Jiang, J. K. Rush, and S. Kannan, "Improving federated learning personalization via model agnostic metalearning," arXiv, 2019.) and A. Fallah et al. (A. Fallah, A. Mokhtari, and A. Ozdaglar, "Personalized federated learning: A meta-learning approach," NeurIPS, 2020.) study different combinations of model-agnostic meta-learning (MAML) type methods with federated learning from an empirical perspective. By finding an initial global model, they make it easy for the current or new clients to adapt to the local dataset by performing one or several steps of gradient descent. M. Khodak et al. (M. Khodak, M.-F. F. Balcan, and A. S. Talwalkar, "Adaptive gradient-based meta-learning methods," in NeurIPS, 2019, pp. 5917-5928.) propose ARUBA, which views meta-learning as online learning over a sequence of losses, each of which is an upper bound on the regret for a single task. These methods belong to local fine-tuning. The disadvantage is that the algorithm complexity is too high, and the requirement for computing resources is high, which makes it difficult to deploy in the actual Internet of Things environment.

[0007] Therefore, there is a need for a collaborative training process flexible, algorithm complexity lower, and lower requirement for computing resources based on meta-learning personalized federated learning method. SUMMARY

[0008] In order to solve the above problems, the present application aims to establish a hybrid model suitable for each client itself for each client, automatically extract similar clients and promote their cooperation, and realize fine-grained personalized modeling for each client. Based on this, the present application provides a personalized federated learning method based on meta-learning.

[0009] The technical scheme adopted by the present application to solve the technical problems is as follows:

[0010] A personalized federated learning method based on meta-learning, comprising the following steps:

[0011] Step one, the cloud server confirms the number of client terminals participating in collaborative training, the cloud server sets the basic network of each client terminal and sets the training hyperparameters of the meta-network of each client terminal, the cloud server initializes the global model parameters, and sends the global model parameters to each client terminal, and proceeds to step two;

[0012] Step two, the client downloads the latest global model parameters sent by the cloud server, and the client assigns the local model parameters to the global model parameters; the client uses the local training set to train the local model of the basic network under the condition of the hyperparameters according to the assigned local model parameters, obtains new local model parameters, and proceeds to step three;

[0013] Step three, the client uploads the latest local model parameters to the cloud server, and the cloud server updates the global model parameters according to the latest local model parameters and using the global model aggregation method, and proceeds to step four;

[0014] Step four, return to step two with the latest global model parameters, and proceed to step five when the client obtains stable new local model parameters through step two;

[0015] Step five, the client downloads the latest global model parameters and stable new local model parameters of all clients from the cloud server, alternately trains the meta-network and the basic network to obtain the local model of the client, the client uploads the local model parameters to the cloud server for saving, the cloud server calculates to update the global model parameters, and proceeds to step six;

[0016] Step six, repeat step five until the local model of the client reaches the required accuracy or the local model of the client converges, and stop training.

[0017] The beneficial effects of the present application are:

[0018] The personalized federated learning method based on meta-learning of the present application formalizes the personalized federated learning problem into a meta-learning task, and has the advantages of flexible collaborative training process. By taking the model parameters as features, deploying a meta-network on the client, and automatically analyzing the similarity between clients from the aspect of model parameters, the personalized problem of the local model of the client is solved. The personalized federated learning method based on meta-learning of the present application proposes an alternating training training mode to train the meta-network and the basic network, enhances the stability and flexibility of training, solves the training difficulty problem that easily occurs when the two networks are trained at the same time, and meets the requirements of training a personalized model by using the local data distributed on each client to make accurate decisions. The algorithm complexity of the present application is low, the requirement for computing resources is low, and the present application is suitable for deployment in actual Internet of Things environments. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 It is an architecture diagram of the personalized federated learning method based on meta-learning of the present application.

[0020] Figure 2 It is a network structure diagram of HAM of the personalized federated learning method based on meta-learning of the present application. Detailed Implementation

[0021] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.

[0022] To achieve efficient and accurate personalized model training in IoT applications, this invention proposes a meta-network deployed on the client side to realize personalized joint learning. The meta-network utilizes meta-learning methods, using the client's model parameters as features to learn a meta-model, automatically analyzing the similarity between different clients, and outputting hybrid model parameters to replace local model parameters, thereby obtaining better personalized model performance. For example... Figure 1 As shown, the present invention deploys a meta-network on each client, with the expectation that the meta-network can encourage strong collaboration among clients with similar model parameters and promote them to collaborate more.

[0023] In a personalized federated learning system, there are m clients connected to the cloud server (m is a positive integer), such as... Figure 1 Each client has a local dataset (obtained by sensors), containing a local training set and a local test set. The local training set is used during training, and the local test set is used during testing. A meta-network is deployed on each client. The purpose of this network is to maintain a specific meta-model based on the input model parameters. This meta-model can be used to generate hybrid model parameters for the base network on each client. Each client has the same type of base network f(·). This invention uses X = {x1, x2, ..., x...} m} represents the set of local model parameters for different clients, X∈R m×d , indicating that X is an m×d vector; x i ∈R d , representing x i Let x be a vector of length d. i Let represent the local model parameters of client i, where 0 ≤ i ≤ m, and i is a positive integer. There is a collection module on the cloud server that collects the local model parameters transmitted from the client. The cloud server collects the local model parameters x uploaded by the client. i Then, the global model parameters x are maintained through a global model aggregation method (such as FedAvg). g (Also known as global parameter or global parameter), x g ∈R d x represents g Let be a vector of length d. These model parameters x are passed... i and x g We can achieve collaborative training between clients. For each client, we represent the client's objective function as F(x). i )=L(f(xi );D i ), wherein D i represents the local training set of the client i, f(x i ) represents the local model of the client i, i.e. f(x i ) represents the output value of the local model of the client i according to the local model parameter x i of the client i, L(·) is a loss function for measuring the error between D i and f(x i ), i.e. a loss function for measuring the error between the true value and the output value of f(x i ).

[0024] Since the local data of each client is heterogeneous, our goal is to automatically analyze the similarity between the local model parameters of each client through the transmission between the cloud server and each client without exposing the local data of each client, to build a new local model f(x i ) for each client, and to realize the personalized local model establishment of the client. The effect of this personalized model will exceed the effect that can be achieved by using only the local data of the client.

[0025] A personalized federated learning method based on meta-learning, comprising the following steps:

[0026] Step one, the cloud server confirms the number of clients participating in collaborative training, each client includes a basic network and a meta-learning network, the cloud server sets the training hyperparameters of the basic network of each client and the meta-network of each client, the cloud server initializes the global model parameters, and the cloud server sends the initialized global model parameters to each client confirmed by the cloud server to participate in collaborative training. Each client includes a basic network and a meta-learning network. The cloud server can send global model parameters to each client, and the client can send local model parameters to the cloud server. The specific process of step one is as follows:

[0027] The cloud server confirms the number of clients participating in collaborative training, sets the training hyperparameters E and B of the basic network and the meta-network, E is the number of times that each edge node of the client uses the entire data of the local training set to completely train the local model in each communication round, and B is the number of small batches of samples (i.e. batch size) taken by the client when performing one backward propagation for updating the local model parameters in the local model training of the client, i.e. the number of small batches of samples taken by the client when uploading the updated local model parameters to the cloud server in the local model training of the client.

[0028] The cloud server initializes the global model parameters x g , initializes x gThe initialized global model parameters x will be either a random vector or a specific value. g Send the message to each client participating in the collaborative training and proceed to step two. The clients mentioned in steps two through six below are all those confirmed as participating in the collaborative training in step one.

[0029] Step 2: Each client downloads the latest global model parameters x sent by the cloud server. g Each client assigns values ​​to its local model parameters using the global model parameters. Based on these assigned local model parameters, the client trains the local model of the base network using the local training set, with the hyperparameters specified, to obtain the trained local model parameters. The details are as follows:

[0030] Client i downloads the global model parameters x sent by the cloud server. g Client i uses x g For local model parameters x i Assign a value to x. i =x g Client i uses its local training set D i With hyperparameters E and B, a local model of the base network is trained to obtain a new local model, i.e., new local model parameters. The formula for training the local model is as follows:

[0031]

[0032] Right now x i =x i ', where α is the learning rate, This refers to the partial derivative sign, where F() represents the objective function, i.e., F(x) i (x) is the objective function of client i. After training the local model in step two, a new local model is obtained, and the parameters of the local model at this time are x. i After training on local data, x i It has local characteristics.

[0033] When proceeding directly to step two after step one, the latest global model parameters downloaded by the client are the initialized global model parameters x sent by the cloud server. g When returning to step two after performing step three, the client downloads the latest global model parameters x sent by the cloud server. g For the newly updated global model parameter x g .

[0034] Step three, each client uploads the local model parameters obtained in step two to the cloud server, the cloud server receives the new local model parameters sent by each client, and the cloud server calculates the global model parameters according to the new local model parameters and uses the global model aggregation method to update the global model parameters. Specifically as follows:

[0035] Each client uploads the x i trained in step two to the cloud server, and the cloud server calculates the new global model parameters x g according to the received new local model parameters and using the existing global model aggregation algorithm (such as FedAvg) to update the global model parameters.

[0036] Step four, determine whether the new local model parameters at this time are stable new local model parameters, if not stable, return to step two with the updated global model parameters (i.e. the latest global model parameters), repeat step two and step three until the result of step four is that the client obtains stable new local model parameters x i in step two, and then proceed to step five with the stable new local model parameters and the latest global model parameters. Step four determines whether the local model parameters x i obtained in step two are stable x i , if yes, proceed to step five with the latest updated global model, if not, return to step two with the latest updated global model parameters.

[0037] Step five, the client downloads the latest global model parameters and the stable new local model parameters of all clients from the cloud server, and the client alternately trains the meta network and the base network to obtain the local model of the client; after obtaining the local model of the client, the client uploads the local model parameters at this time to the cloud server for saving, and the cloud server calculates the global model parameters to update the global model parameters, and proceeds to step six. Specifically as follows:

[0038] The client downloads the set X of all client local model parameters (x i in X at this time are stable x i ) and the global model parameters x g (x g at this time is the latest updated global model), and alternately trains the meta network and the base network to obtain the local model of the client using the following function:

[0039]

[0040] That is, x i = x iG(X, θ) is the objective function of the meta-network and the base network training, and θ represents the trained meta-model parameters of the meta-network. The definition of G(X, θ) is described below:

[0041]

[0042] wherein, is the output result of the meta-network, The meaning represented by is a mixed model parameter mixed with the local model parameters of each client and the global model parameters, which is described below as a mixed model parameter; θ i represents the meta-model parameters of the client i, represents the client i in and θ i is the objective function when the variable is.

[0043] x i After training, each client uploads its x i to the cloud server, and the cloud server saves the local model parameters x i , and the cloud server calculates the global model parameters x g . Through the local model parameters x i saved by the cloud server, the client downloads the just updated X from the cloud server in step five. The cloud server obtains the updated global model parameters x g by calculating the global model parameters x g , which is used by the client to download the just updated global model parameters from the cloud server in step five.

[0044] Step six, repeat step five until the local model of the client reaches the required accuracy or the local model of the client converges, stop training. Specifically: judge whether the local model of the client reaches the preset accuracy or the local model of the client converges, if the required accuracy is reached or the local model converges, the personalized federated learning is completed, otherwise return to step five. The above accuracy is calculated by the local test set.

[0045] To achieve the best meta-network training effect, the application proposes a meta-learning network (HAM) structure based on hierarchical attention enhancement. Specifically, HAM has two layers, i.e., the meta-learning network includes two network structures. Given a target client, in the first layer network structure, HAM uses an attention mechanism to analyze the relevance of the model parameter set X downloaded from the cloud server side based on other client models. According to the score of the attention mechanism, the weighted aggregation of the model parameters in X is realized, and a new model parameter, i.e., an attention enhanced model parameter, is constructed. In the second layer network structure, HAM further aggregates the local model parameters of the client, the attention enhanced model parameters and the global model parameters in the cloud server according to the global aggregation algorithm. The second layer network structure uses a similar attention mechanism as the first layer network structure to realize the trade-off between individuality and commonality.

[0046] The application proposes a hierarchical attention enhanced meta-network (HAM) as an example of a meta-network, as shown in Figure 2 . HAM contains a hierarchical structure. In the first layer network structure, the similarity between all other clients and the target client is automatically analyzed, and the local model parameters of other clients are aggregated using the assigned weighted score. The aggregation result is introduced into the second layer network structure as an attention enhanced model. In this way, other local models that are not helpful to the target client can be filtered out. In the second layer network structure, the goal is to aggregate the local model of the client, the attention enhanced model and the global model parameters to realize the trade-off between the individuality and commonality of the local model of the client. The structure of HAM is shown in Figure 2 . The following is a specific elaboration.

[0047] For the meta-network on each client, the client where the meta-network is located is taken as the target client. For a target client i, given its local model parameters x i and the set of other client local model parameters as input. We define g1(·) as the aggregation function of the first layer of HAM, which can calculate an attention enhanced model parameter i from x .The attention enhanced model parameter aggregates useful information from the local model of other clients and can be written as:

[0048]

[0049] where represents is a vector of (m-1)xd, is downloaded from the cloud server. The specific calculation method of g1(·) adopts attention mechanism, and its basic idea is to calculate the correlation between query q and key matrix K, which can be written as:

[0050]

[0051] where d is a scaling factor to avoid the value of inner product being too large; Att(·,·) represents a similarity function. In g1(·), we take x i as a query q, as a key matrix K, and calculate the attention score according to the following function:

[0052]

[0053] where represents the learnable parameters in the first layer of HAM network structure, represents the corresponding learnable parameters of x i , represents the corresponding learnable parameters of

[0054] In the second layer, the attention enhanced model parameters global model parameters x g , and local model parameters x i are taken as inputs, and g2(·) is taken as the aggregation function of the second layer. The output result is the hybrid model parameter, and the specific formula can be written as:

[0055]

[0056] The calculation method is similar to g1(·), and attention mechanism is also adopted, where represents the learnable parameters in the second layer of HAM.

[0057] The above is the calculation method of the meta-network instance. The learnable parameters of the first layer and the second layer are denoted as θ i , θ i are obtained through alternating training in step five.

[0058] The second layer network structure connects the base network, and sends to the base network. The meta-network downloads x g from the cloud server, the meta-network downloads X from the cloud server, the base network can send x i to the meta-network, and the meta-network can download

[0059] The personalized federated learning method based on meta learning formulates a personalized federated learning problem into a meta learning task, and designs a personalized federated learning method based on meta learning. By taking model parameters as features, deploying a meta network on the client side, and automatically analyzing the similarity between clients from the aspect of model parameters, the personalized problem of the local model of the client is solved. The personalized federated learning method based on meta learning proposes an alternating training mode to train the meta network and the base network, trains the two networks in an end-to-end manner, enhances the stability and flexibility of training, solves the training difficulty problem that easily occurs when the two networks are trained at the same time, and meets the collaborative training of a personalized model using local data distributed on each client to make accurate decisions.

[0060] Specifically, the application proposes a network architecture design scheme of a hierarchical attention enhanced meta network. In the first layer of the network architecture, weighted fusion of model parameters between clients can be realized, and in the second layer, weighted fusion of the attention enhanced model output by the first layer, the local model of the client and the global model parameters can be realized, and the trade-off between individuality and commonality is realized.

[0061] The performance of the HAM method of the present application (referred to as HAM) is evaluated when the data distribution is heterogeneous. The present application is compared with the most advanced methods, including FedAvg (federated averaging), FedSGD (federated stochastic gradient descent), FedProx, FedPer (see M. G. Arivazhagan, V. Aggarwal, A. K. Singh, and S. Choudhary, “Federated learning with personalization layers,” arXiv, 2019.), FedHealth (see Y. Chen, X. Qin, J. Wang, C. Yu, and W. Gao, “Fedhealth: A federated transfer learning framework for wearable healthcare,” IEEE Intelligent Systems, 2020.), FTL (see Q. Wu, K. He, and X. Chen, “Personalized federated learning for intelligent IoT applications: A cloud-edge based framework,” IEEE Computer Graphics and Applications, 2020.), and FedAMP (see Y. Huang, L. Chu, Z. Zhou, L. Wang, J. Liu, J. Pei, and Y. Zhang, “Personalized cross-silo federated learning on non-iid data,” AAAI, 2020.). Among them, FedAGD, FedAvg, and FedProx are federated learning (referred to as FL) methods. FedPer, FedHealth, FTL, and FedAMP are personalized federated learning (referred to as PFL) methods. For FedHealth, according to the method requirements, 10% of the training data of each client is used to form a public data set on the server. In order to make the experiment more comprehensive, the performance of a single-machine training method called local training is also evaluated, which can independently train the personalized model of each client without communication with the cloud server.

[0062] All experiments are implemented in PyTorch 1.5.0, running on a 4-Tesla-P100 GPU cluster, CPU is Intel(R) Xeon(R) E5-2620, memory is 128G, and the operating system is Ubuntu 16.04.7. In order to simulate the transmission overhead of long-distance clients in actual situation, the TCP protocol is used for reliable connection-oriented transmission.

[0063] The used datasets are V-MNIST dataset (V for variant, a new dataset constructed by a collection of multiple MNIST variant datasets) and W&A of China dataset (Weather and Air Quality of China dataset):

[0064] The V-MNIST dataset is a collection of 6 MNIST classification datasets, which are MNIST, rotated MNIST, noisy background MNIST, image background MNIST, rotated image background MNIST and fashion MNIST (see [Y. LeCun, “The mnist database of handwritten digits,” http: / / yann.lecun.com / exdb / mnist / , 1998.], [K. Sun, J. Zhang, H. Yong, and J. Liu, “Fpcanet: Fisher discrimination for principal component analysis network,” Knowledge-Based Systems, vol. 166, pp. 108-117, 2019.], [H. Xiao, K. Rasul, and R. Vollgraf, “Fashion-mnist: A novel imagedataset for benchmarking machine learning algorithms,” arXiv, 2017.]) They are all 10 classification tasks. In order to simulate the individual data of each node, data partition is performed on the 6 variant MNIST datasets. Independent identically distributed non-permutation random sampling is used. The entire dataset is divided into a certain number of shards, and the shard represents the number of clients. In the experiment, each variant MNIST dataset is divided into 3 sub-datasets according to the proportion of the original data amount. A total of 72795 samples are divided into 18 sub-datasets, and one sub-dataset represents one client.

[0065] The W&A of China dataset is a real weather and air quality dataset (referred to as China Weather Dataset) jointly released by the National Environmental Monitoring Center and the National Climate Data Center. The data is collected from January 1, 2017 to December 31, 2017, every hour from four municipalities directly under the central government of China (Beijing, Tianjin, Shanghai and Chongqing). There are 230044 records in 42 monitoring points. Each record consists of 13 feature elements, namely temperature, pressure, humidity, wind direction, wind speed, station number, collection time and 6 kinds of pollutant concentrations. According to the China Ambient Air Quality Standard (AAQS) (see A. MEP, “Gb 3095-2012 ambient air quality standards,” China Environmental Science Press, Beijing, 2012.), the air quality is divided into 5 levels according to the concentration of pm2.5. The characteristics of the past 48 hours are used to estimate the air quality of the next hour. The number and distribution of cross-site data are heterogeneous, and the site data are kept locally, so it is suitable for personalized federated learning applications. In the experiments of the present invention, each site is regarded as a client.

[0066] For the V-MNIST dataset, the present invention adopts the classic Alexnet (A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” in Advances in neural information processing systems, 2012, pp. 1097-1105.) as the base network for image classification. It is a CNN containing 5 convolutional layers and 3 fully connected layers. The optimizer is mini-batch gradient descent, and the initial learning rate is set to 0.02. The loss function is cross-entropy loss 3, which is often used for multi-classification problems. We set the epoch of each round of communication to E = 1, and the batch sample size in training to B = 32.

[0067] For the W&A of China dataset, we constructed a 2-layer gated recurrent unit network (GRU)

[28] with 128 hidden units in each layer as the base network for time series inference tasks. Then the results are output through the fully connected layer and compared with the true value to obtain the prediction accuracy. The optimizer is mini-batch gradient descent, and the initial learning rate is set to 0.01. The loss function is MultiLabelSoftMargin loss, which is suitable for multi-target classification. We set the epoch of each round of communication to E = 2, and the batch sample size in training to B = 32.

[0068] As shown in Table 1, the method of the present application is compared with several competing baseline methods on two different base net datasets, and Table 1 is the accuracy and precision of different methods between V-MNIST and W&A China datasets (all values in Table 1 are percentages, and % is omitted). When there is no collaboration between customers, local training is used as a benchmark to represent the training effect when there is no collaboration between customers. In the V-MNIST dataset, it is only higher than FedSGD, and in the W&A China dataset, it is significantly better than FedSGD. For the V-MNIST dataset, the local training data is not enough to support a complex image recognition task. At this point, the collaborative training between customers is important. But for the W&A China dataset, since the data characteristics are very different between different city sites, it is difficult for the federated learning method to achieve good performance. It is worth noting that for the V-MNIST dataset, its precision is very close to the accuracy, while the precision of the W&A China dataset is quite low. This is because V-MNIST is a benchmark dataset, where the number of samples of different categories is almost evenly distributed, while W&A China is a real-world dataset. The air quality is always less than the air quality. The precision describes the proportion of positives in the examples classified as positive. Usually, in the class imbalance classification problem, the precision of the model is low. This also explains why the two datasets have different effects on different baselines.

[0069] The performance of the federated learning methods FedSGD, FedAvg and FedProx in the two datasets is lower than that of the personalized federated learning method. Compared with the method of the present application, the accuracy and precision of the federated learning method on the V-MNIST and W&A China datasets are decreased by 17.44%, 7.07% and 9.84%, respectively, and decreased by 3.23%. This illustrates the necessity of establishing personalized models for customers with heterogeneous data in collaborative training.

[0070] Table 1

[0071]

[0072] The personalized federated learning methods FedPer, FedHealth and FTL are local fine-tuning methods. Although the implementation methods are different, the personalized performance they achieve is similar. FedAMP is a multi-task method that achieves the second best performance among all methods by facilitating pairwise collaboration between clients without using a single global model. Compared with the suboptimal method, the accuracy of the method on the V-MNIST and W&A China datasets is increased by 2.14% and 1.14%, respectively, and by 3.04% and 1.43%, respectively. In the cloud-edge collaborative training system of data distribution, the HAM network of the application is characterized by the model parameters of the clients, and by learning the meta-model to automatically analyze the similarity of different clients, better performance is obtained.

[0073] The above only describes the preferred embodiments of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.

Claims

1. A personalized federated learning method based on meta-learning, characterized in that, Includes the following steps: Step 1: The cloud server confirms the number of clients participating in collaborative training. The cloud server sets the basic network and the training hyperparameters of the meta-network for each client. The cloud server initializes the global model parameters and sends the global model parameters to each client. Proceed to Step 2. Step 2: The client downloads the latest global model parameters sent by the cloud server, and assigns values ​​to the local model parameters using the global model parameters. Based on the assigned local model parameters, the client trains the local model of the basic network using the local training set and under hyperparameter conditions to obtain new local model parameters, and then proceeds to Step 3. Step 3: The client uploads the latest local model parameters to the cloud server. The cloud server updates the global model parameters based on the latest local model parameters and uses the global model aggregation method, and then proceeds to Step 4. Step 4: Return to Step 2 with the latest global model parameters, and continue until a stable new local model parameter is obtained through the client in Step 2, then proceed to Step 5; Step 5: The client downloads the latest global model parameters and all stable new local model parameters from the cloud server, trains the meta-network and the base network alternately to obtain the client's local model, and uploads the local model parameters to the cloud server for storage. The cloud server calculates to update the global model parameters and proceeds to Step 6. Step 6: Repeat step 5 until the client's local model reaches the required accuracy or the client's local model converges, then stop training; The meta-learning network of client i includes a first-layer network structure and a second-layer network structure. The aggregation function of the first-layer network structure is g1(·). To enhance model parameters, where This represents the set of model parameters for all clients participating in collaborative training, excluding the target client i; the aggregation function for the second layer network structure is g2(·). Indicates the parameters of the hybrid model. x represents the learnable parameters in the second-layer network structure. g Represents global model parameters; The first layer network structure can be automatically analyzed With x i Similarity between them, and aggregated using weighted scores. The local model parameters of each client are aggregated, and the aggregated results are introduced into the second layer network structure as an attention-enhancing model.

2. The personalized federated learning method based on meta-learning as described in claim 1, characterized in that, The initialized global model parameters are random vectors or specific values.

3. The personalized federated learning method based on meta-learning as described in claim 1, characterized in that, The training hyperparameters include E and B. E represents the number of times each edge node of the client will use all the data in the local dataset to train the local model completely in each communication round. B represents the number of mini-batch samples taken by the client when uploading the updated local model parameters to the cloud server during the local model training.

4. The personalized federated learning method based on meta-learning as described in claim 3, characterized in that, Step two specifically involves: Client i downloading the latest global model parameters x sent by the cloud server. g Client i uses x g For local model parameters x i Assign a value to x. i =x g ; Client i according to x i =x g Using its local dataset D i The local model training of the base network is performed with hyperparameters E and B. The formula for local model training is as follows: Where α represents the learning rate and F() represents the objective function.

5. The personalized federated learning method based on meta-learning as described in claim 4, characterized in that, The objective function of client i is F(x) i )=L(f(x i );D i ), where D i Let f(x) represent the local dataset of client i. i L(·) represents the local model of client i, and L(·) is the model of D. i and f(x) i The loss function of the error between ).

6. The personalized federated learning method based on meta-learning as described in claim 4, characterized in that, The alternating training in step five specifically involves: Use the following functions to train the meta-network and the base network alternately: Where α represents the learning rate, G(X,θ) is the objective function for training the meta-network and the base network, and X = {x1, x2, ..., x} m }, where m is the total number of clients determined in step one, i represents a client, 0≤i≤m, x i θ represents the local model parameters, and θ represents the trained meta-model parameters of the meta-network. This is the output of the meta-network. A hybrid model parameter, θ, that combines local model parameters from various clients with global model parameters. i This represents the metamodel parameters of client i.

7. The personalized federated learning method based on meta-learning as described in claim 1, characterized in that, The global model aggregation method in step three is the federated average algorithm.

8. The personalized federated learning method based on meta-learning as described in claim 1, characterized in that, The g2(·) is calculated using an attention mechanism. The g1(·) is calculated using an attention mechanism. in, This represents the learnable parameters in the first layer of the network structure. x represents i The corresponding learnable parameters, express The corresponding learnable parameter, d, represents the scaling factor.