F EDERATED L EARNING WITH D ECOUPLED P ROBABILISTIC -W EIGHTED G RADIENT A GGREGATION
Anonymous authors
Paper under double-blind review
A BSTRACT
In the federated learning paradigm, multiple mobile clients train local models independently based on datasets generated by edge devices, and the server aggregates parameters/gradients from local models to form a global model.
However, existing model aggregation approaches suffer from high bias on both data distribution and parameter distribution for non-IID datasets, which result in severe accuracy drop for increasing number of heterogeneous clients.
In this paper, we proposed a novel decoupled probabilistic-weighted gradient aggregation approach called FeDEC for federated learning.
The key idea is to optimize gradient parameters and statistical parameters in a decoupled way, and aggregate the parameters from local models with probabilistic weights to deal with the heterogeneity of clients.
Since the overall dataset is unaccessible by the central server, we introduce a variational inference method to derive the optimal probabilistic weights to minimize statistical bias.
We further prove the convergence bound of the proposed approach.
Extensive experiments using mainstream convolutional neural network models based on three federated datasets show that FeDEC signiﬁcantly outperforms the state-of-the-arts in terms of model accuracy and training efﬁciency.
I NTRODUCTION
Federated learning (FL) has emerged as a novel distributed machine learning paradigm that allows a global machine learning model to be trained by multiple mobile clients collaboratively.
In such paradigm, mobile clients train local models based on datasets generated by edge devices such as sensors and smartphones, and the server is responsible to aggregate parameters/gradients from local models to form a global model without transferring data to a central server.
Federated learning has been drawn much attention in mobile-edge computing (Konecný et al.
; Sun et al.
with its advantages in preserving data privacy (Zhu & Jin (2020)
; Jiang et al.
; Keller et al.
and enhancing communication efﬁciency (Shamir et al.
; Smith et al.
; Zhang et al.
; McMahan et al.
; Wang et al.
Gradient aggregation is the key technology of federated learning, which typically involves the following three steps repeated periodically during training process: (1) the involved clients train the same type of models with their local data independently; (2) when the server sends aggregation signal to the clients, the clients transmit their parameters or gradients to the server; (3) when server receives all parameters or gradients, it applies an aggregation methods to the received parameters or gradients to form the global model.
The standard aggregation method FedAvg (McMahan et al.
(2017)) and its variants such as FedProx (Li et al.
(2020a))
, Zeno (Xie et al.
and q-FedSGD (Li et al. (2020b)) applied the synchronous parameter averaging method to the entire model indiscriminately.
Agnostic federated learning (AFL) (Mohri et al.
(2019)) deﬁned an agnostic and risk-averse objective to optimize a mixture of the client distributions.
FedMA (Wang et al.
(2020)) constructed the shared global model in a layer-wise manner by matching and averaging hidden elements with similar feature extraction signatures.
The recurrent neural network (RNN) based aggregator (Ji et al.
(2019)) learned an aggregation method to make it resilient to Byzantine attack.
Despite the efforts that have been made, applying the existing parameter aggregation methods for large number of heterogeneous clients in federated learning still suffers from performance issues.
It was reported in (Zhao et al.
that the accuracy of a convolutional neural network (CNN) model trained by FedAvg reduces by up to 55% for highly skewed non-IID dataset.
The work of
(Wang et al.
(2020)) showed that the accuracy of FadAvg (McMahan et al.
and FedProx (Li et al.
(2020a)) dropped from 61% to under 50% when the client number increases from 5 tounder heterogeneous data partition.
A possible reason to explain the performance drops in federated learning could be the different levels of bias caused by inappropriate gradient aggregation, on which we make the following observations.
Data Bias:
In the federated learning setting, local datasets are only accessible by the owner and they are typically non-IID.
Conventional approaches aggregate gradients uniformly from the clients, which could cause great bias to the real data distribution.
Fig.
1 shows the distribution of the real dataset and the distributions of uniformly taking samples from different number of clients in the
CIFAR-10 dataset (Krizhevsky (2009)).
It is observed that there are great differences between the real data and the sampled distributions.
The more clients involved, the more difference occurs.
[Figure]
[Figure]
Parameter Bias: A CNN model typically contains two different types of parameters: the gradient parameters from the convolutional (Conv) layers and full connected (FC) layers; and the statistical parameters such as mean and variance from the batch normalization (BN) layers.
Existing approaches such as FedAvg average the entire model parameters indiscriminately using distributed stochastic gradient descent (SGD), which will lead to bias on the means and variances in BN layer.
Fig.
2 shows the means and variances in BN layer distribution of a centrally-trained CNN model and that of FedAvg-trained models with different number of clients on non-IID local datasets.
It is observed that the more clients involved, the larger deviation between the central model and the federated learning models.
Our contributions : In the context of federated learning, the problems of data bias and parameter bias have not been carefully addressed in the literature.
In this paper, we propose a novel gradient aggregation approach called FeDEC.
The main contribution of our work are summarized as follows.
(1) We propose the key idea of optimizing gradient aggregation with a decoupled probabilisticweighted method.
To the best of our knowledge, we make the ﬁrst attempt to aggregate gradient parameters and statistical parameters separatively, and adopt a probabilistic mixture model to resolve the problem of aggregation bias for federated learning with heterogeneous clients.
(2) We propose a variational inference method to derive the optimal probabilistic weights for gradient aggregation, and prove the convergence bound of the proposed approach.
(3) We conduct extensive experiments using ﬁve mainstream CNN models based on three federated datasets under non-IID conditions.
It is shown that FeDEC signiﬁcantly outperforms the state-of-the-arts in terms of model accuracy and training efﬁciency.
R ELATED W ORK
We summarize the related work as two categories: parameter/gradient aggregation for distributed learning and federated learning.
Distributed Learning :
In distributed learning, the most famous parameter aggregation paradigm is the Parameter Server Framework (Li et al.
In this framework, multiple servers maintain a partition of the globally shared parameters and communicate with each other to replicate and migrate parameters, while the clients compute gradients locally with a portion of the training data, and communicate with the server for model update.
Parameter server paradigm had motivated the development of numerous distributed optimization methods (Boyd et al.
(2011); Dean et al.
Dekel et al.
; Richtárik & Takác (2016); Zhang et al. (2015)).
Several works focused on improving the communication-efﬁciency for distributed learning (Shamir et al.
; Smith et al.
; Zhang et al.
To address the issue of model robustness, Zeno (Xie et al.
(2019)) was proposed to make distributed machine learning tolerant to an arbitrary number of faulty workers.
The
RNN based aggregator (Ji et al.
(2019)) adopted a meta-learning approach that utilizes a recurrent neural network (RNN) in the parameter server to learn to aggregate the gradients from the workers, and designed a coordinatewise preprocessing and postprocessing method to improve its robustness.
Federated Learning :
Federated learning (Koneˇcn`y et al.
(2015)) is an emerging edge distributed machine learning paradigm that aims to build machine-learning models based on datasets distributing across multiple clients.
One of the standard parameter aggregation methods is FedAvg (McMahan et al.
(2017)), which combines local stochastic gradient descent (SGD) on each client with a server that performs parameter averaging.
The lazily aggregated gradient (Lag) method (Chen et al.
(2018)) allowed clients running multiple epochs before model aggregation to reduce communication cost.
For heterogeneous datasets, FedProx (Li et al. (2020a))
modiﬁed FedAvg by adding a heterogeneity bound on datasets and devices to tackle heterogeneity.
The FedMA (Wang et al.
method, derived from AFL Mohri et al.
and PFNM (Yurochkin et al.
(2019)), demonstrated that permutations of layers can affect the gradient aggregation results, and proposed a layer-wise gradient aggregation method to solve the problem.
For fair resources allocation, the q-FedSGD (Li et al.
(2020b)) method encouraged a more uniform accuracy distribution across devices in federated networks.
However, all the methods did not differentiate gradient parameters and statistical parameters and aggregated the entire model in a coupled manner.
In this paper, we make the ﬁrst attempt to decouple the aggregation of gradient parameters and statistical parameters with probabilistic weights to optimize the global model to achieve fast convergence and high accuracy in non-IID conditions.
F E DEC: A D ECOUPLED G RADIENT A GGREGATION M ETHOD 3. O BJECTIVE OF F EDERATED L EARNING WITH N ON -IID D ATA
Consider a federated learning scenario with K clients that train their local CNN models independently based on local datasets x 1 ; x 2 ; : : : ; x K and report their gradients and model parameters to a central server.
The objective of the server is to form an aggregate global CNN model to minimize the loss function over the total datasets x = f x 1 ; x 2 ; : : : ; x K g .
Conventional federated learning tends to optimize the following loss function:
[Equation]
where W is the parameters of the global model, W k ( k = 1 ; 2 ; (cid:1) (cid:1) (cid:1) ; K ) is the parameters of the k -th local model;
L ( (cid:1) ) and L k ( (cid:1) ) indicate the loss functions for global model and local models accordingly.
The above objective assumes training samples uniformly distributed among the clients, so that the aggregated loss can be represented by the sum of percentage-weighted of the local losses.
As discussed in section 1, conventional federated learning has two drawbacks.
Firstly, local datasets are collected by mobile devices used by particular users, which are typically non-IID.
Training samples on each client may be drawn from a different distribution, therefore the data points available locally could be bias from the overall distribution.
Secondly, since a neural network model is typically consists of convolutional (Conv) layers and full-connected (FC) layers that are formed by gradient parameters, and batch normalization (BN) layers that are formed by statistical parameters such as mean and variance, aggregating them without distinction will cause severe deviation of the global model parameters.
To address the above issues, we propose a decoupled probabilistic-weighted approach for federated learning that focuses on optimizing the following loss function:
[Equation]
where (cid:3) indicates NN; mean and var ; W tNN , W t mean and W tvar are the parameters of Conv and
FC layers of the global model after t -th aggregation epoch; W t (cid:0) 1 ;k NN , W t (cid:0) 1 ;k mean and W t (cid:0) 1 ;k var are the k -th local model been trained several local epoch based t (cid:0) 1 -th global model; (cid:25) k
( k = 1 ; : : : ; K ) is the probability that a sample is drawn from the distribution of the k -th client, i.e., (cid:25) k 2 [0 ; 1] ( k = 1 ; : : : ; K ) and ∑ Kk =1 (cid:25) k
= 1 .
The above formulation objects to minimize the expected loss over K clients with non-IID datasets.
Next, we will introduce a decoupled method called FeDEC to optimize the parameters of different types of layers separatively, and derived the probability weights (cid:25) k for parameter aggregation.
3. D ECOUPLED P ROBABILISTIC -W EIGHTED G RADIENT A GGREGATION M ETHOD
In this section, we proposed a decoupled method to derive the global model with respect to W tNN (parameters of Conv and FC layers) and W tmean ; W tvar (statistical parameters of BN layers).
3.2. G RADIENT A GGREGATION FOR C ONV AND FC L AYERS
Since the parameters of Conv and FC layers are neural network weights which are updated by distributed gradient descent method (Nesterov (1983)), they are appropriate to be aggregated with a similar approach that adapts conventional federated average for non-IID datasets.
Let
[Equation]
k
[Equation] [Equation]
[Equation]
K ) , where NN (cid:3) indicates NN parameters after full local training.
be the gradient of the k -th client in the t -th training epoch.
After receiving the gradients from K clients, the central server update the parameters of global model as follows.
[Equation]
where (cid:12) is the learning rate for parameter update, (cid:25) tk ( k = 1 ; : : : ; K ) are the probabilistic weights with ∑ Kk =1 (cid:25) tk = 1 that are derived in section 3.2.3.
3.2. P ARAMETER A GGREGATION FOR M EANS AND V ARIANCES IN BN
Different from the Conv and FC layers, the BN layers mainly contain statistical parameters such as mean and variance.
Conventional federated learning aggregates BN layers and other layers without distinction, which could lead to high bias of means and variances in BN layer of the global model.
Thus we propose a different way to aggregate means and variances in BN layer as follows.
In t -th training epoch, the means and variances W tmean ; W tvar in BN layer, which are updated by:
[Equation]
where W t;kmean and W t;kvar indicate the means and variances in BN layers of the k -th client in epoch t ; (cid:25) tk ( k = 1 ; : : : ; K ) are probabilistic weights with ∑ Kk =1 (cid:25) tk = 1 that are derived in section 3.2.3.
In the above equations, we update the mean with the weighted average of local models, and update the variance with the weighted pooled variance (Killeen (2005)), which can give an unbias estimation of parameters of the whole dataset under non-IID conditions (see Appendix A.2).
3.2. D ERIVATION OF P ROBABILISTIC W EIGHTS
We adopt a mixture probabilistic model to describe non-IID datasets in federated learning.
Without loss of generality, in the t -th training epoch, we assume the mini-batch samples of each client follows a Gaussian distribution N k ( (cid:22) k ; (cid:27) k ) ( k = 1 ; : : : ; K ) , where (cid:22) k ; (cid:27) k are the mean and standard deviation of the distribution that vary among clients.
We omit the upper script t for simplicity thereafter.
The whole samples can be described as a Gaussian Mixture Model (GMM) with the following probability function:
[Equation]
where (cid:21) =
f (cid:25) k ; (cid:22) k ; (cid:27) k
j k = 1 ; 2 ; (cid:1) (cid:1) (cid:1) ; K g are the parameters of the GMM model 1 .
In federated learning, the local data samples are accessed by particular client and the central server can only observe the statistics of local dataset such as mean and standard variance.
Without knowing the overall samples, conventional expectation-maximization (EM) algorithm (Dempster et al.
(1977)) cannot be applied to derive (cid:21) .
Alternatively, we introduce a variational inference method to estimate the parameters of (cid:21) .
[Figure]
Speciﬁcally, we construct a variational Bayesian generative model to generate data that are close to the reported statistics of local models as possible, and use the generated data to estimate the GMM model parameters.
The plate notions of the generative model are shown in
Fig.
The notations are explained as follows.
(cid:15) s tk = f W t;kmean ; W t;kvar g is the observed statistics from the feature maps of k -th client.
(cid:15) z tk = f
z tk;i j
( i = 1 ; 2 ; (cid:1) (cid:1) (cid:1) ; C ) g is a vector of latent variables with length C , where z tk;i 2 [0 ; 1] , ∑ Ci =1 z tk;i = 1 , and C is the number of classes for a classiﬁcation task.
z tk can be viewed as a data distribution that represents the probability of a sample in client k
belonging to the classes.
(cid:15) (cid:18) =
f (cid:18) k g are generative model parameters, and ϕ =
f ϕ k g are variational parameters.
The solid lines in Fig.
3 denote the generative model p (cid:18) k
( z tk ) p (cid:18) k
( s tk j z tk ) , and the dashed lines denote the variational approximation q ϕ k
( z tk j s tk ) to the intractable posterior p (cid:18) k
( z tk j s tk )
We approximate p (cid:18) k
( z tk j s tk ) with q ϕ k
( z tk j s tk ) by minimizing their divergence:
[Equation]
To derive the optimal value of the parameters ϕ k and (cid:18) k , we compute the marginal likelihood of s tk :
[Equation]
In Eq.
8, the ﬁrst term is the KL-divergence (Joyce (2011)) of the approximate distribution and the posterior distribution; the second term is called the ELBO (Evidence Lower BOund) on the marginal likelihood of dataset in the k -th client.
Since log p ( s tk ) is non-negative, the minimization problem of Eq.
7 can be converted to maximize the ELBO.
To solve the problem, we change the form of ELBO as:
[Equation]
p (cid:18) k
( s tk j
[Equation]
tk )] | {z } Decoder : (9) The above form is a variational encoder-decoder structure: the model q ϕ k ( z tk j s tk ) can be viewed as a probabilistic encoder that given an observed statistics s tk
it produces a distribution over the possible values of the latent variables z tk ; The model p (cid:18) k
( s tk j z tk ) can be refered to as a probabilistic decoder that reconstructs the value of s tk based on the code z tk .
According to the theory of variational inference (Kingma & Welling (2014)), the problem in Eq.
9 can be solved with stochastic gradient descent (SGD) method using a fully-connected neural network to optimize the mean squared error loss function.
With the derived optimal parameters ϕ (cid:3) k ; (cid:18) (cid:3) k , we can extract the latent variables
z tk that is interpreted as the sample distribution of client- k .
Therefore z tk can be used to infer the parameters ( (cid:25) k ; (cid:22) k ; (cid:27) k ) of k -th component of the GMM model.
Speciﬁcally, the probabilistic weights (cid:25) k can be represented by
[Equation]
C ONVERGENCE A NALYSIS
In this section, we will show that the convergence of the proposed FeDEC algorithm is theoretically guaranteed.
We use the following assumptions and lemmas, and the convergence guarantee is provided in Theorem 1.
Assumption 1 (Unbiased Gradient): We assume that the stochastic gradients g ti is an unbiased estimator of the true gradient ∇ f ( w ti ) , i.e., E [ g ti ] =
∇ f ( w ti ) , where f ( (cid:1) ) is any convex objective function and w ti is its variables.
Assumption 2 (Gradient Convex Set):
We assume that gradient set G is a convex set, where all gradients g 1 ; g 2 ; : : : ; g K are in G , and any g =
∑ Ki =1 (cid:21) i g i ( 8 (cid:21) i > 0 and ∑ Ki =1 (cid:21) i = 1 ) is in G .
Lemma 1 (L-Lipschitz Continuity): For a function f ( (cid:1) ) is Lipschitz continuous if there exists a positive real constant L such that, for all real x 1 and x 2 :
[Equation]
Lemma 2 (Jensen’s Inequality): If f ( w ) is a convex function on W , and E [ f ( w )] and f ( E [ w ]) are ﬁnite, then:
[Equation]
Deﬁnition 1 (Projection Operation): Assume w (cid:3) is an intermediate result of optimization, we deﬁne a project operator ∏ W ( w (cid:3) ) to project w (cid:3) to the domain W , which is computed by:
[Equation]
Deﬁnition 2 (Diameter of Domain):
Given a function f ( w ) , where w 2 W , and W is f ’s domain of deﬁnition.
The diameter of W is denoted by (cid:0) : for every w
[Equation]
Theorem 1 (Guaranteed Convergence Rate): If a convex function f ( w ) is L-Lipschitz continuous function, then jj∇ f ( w ) jj (cid:20) L .
Let (cid:0) be the diameter of domain.
Applying equations (3)(4)(5) for gradients aggregation, we have the following convergence rate for the proposed FeDEC algorithm:
[Equation]
where (cid:22) w T is the average result of w for total training epoch T , (cid:12) is the learning rate in equation-(3), and T is the total training epoch.
If we let (cid:12) = (cid:0) L p T , the convergence rate is O ( 1 p T ) .
Proof skeleton : We provide a simple description of the proof skeleton of Theorem 1 with the following steps.
(1) Since f ( (cid:1) ) is a convex function, we have f ( w t ) (cid:0) f
( w ) (cid:20) ∇ f ( w t )( w t (cid:0) w ) .
(2) With assumption 1 and 2, we have f ( w t ) (cid:0) f
[Equation]
jj
[Equation]
+1 (cid:3)
[Equation]
where w t +1 (cid:3) is the intermediate result of f ( w ) in update time t +1 .
(3) With lemma 1 and deﬁnition 1, by projecting w t +1 (cid:3) to w t +1 , we have f ( w t ) (cid:0) f
( w ) (cid:20) 12 (cid:12) ( jj w t (cid:0) w jj 2 (cid:0)jj w t +1 (cid:0) w jj 2 )+ (cid:12) 2 L 2 .
(4) Summing from t = 1 to T and with deﬁnition 1 and 2, we have ∑ Tt =1 f ( w t ) (cid:0)
Tf ( w ) (cid:20) 12 (cid:12) (cid:0)
+ (cid:12)
L 2 T .
According to lemma 2, we have f ( (cid:22) w T ) (cid:0) f ( w ) (cid:20) (cid:0) 2
cid:12)T + (cid:12) 2 L 2 .
(6) Taking (cid:12) = (cid:0) =
( L p
T ) , we can obtain the convergence rate in the theorem.
The detailed proof of Theorem 1 and explanations are provided in Appendix A.1.
According to Theorem 1, the FeDEC parameter aggregation algorithm is guaranteed to converge, and the convergence rate can be as fast as general stochastic gradient decent which only related to the training epoch T with an associated constants.
The constant is related to the optimization problem parameters such as lipschitz constant L , and diameter of domain (cid:0) .
P ERFORMANCE E VALUATION
In this section, we evaluate the performance of the proposed FeDEC method for federated learning.
5. E XPERIMENTAL S ETUP
Implementation.
We implement the proposed FeDEC parameter aggregation approach and the considered baselines in PyTorch (Paszke et al.
We train the models in a simulated federated learning environment consisting of one server and a set of mobile clients with wireless network connections.
Unless explicitly speciﬁed, the default number of clients is 20, and the learning rate (cid:12) = 0 : 01 .
We conduct experiments on a GPU-equipped personal computer (CPU: Inter Core i78700 3.2GHz, GPU: Nvidia GeForce RTX 2070, Memory: 32GB DDR4 2666MHz, and OS: 64-bit
Ubuntu 16.04).
Models and datasets.
We conduct experiments based on 5 mainstream neural network models:
ResNet18 (He et al.
, LeNet (Lecun et al.
DenseNet121 (Huang et al.
, MobileNetV2 (Sandler et al.
(2018)), and a 4-layer CNN (every CNN layer is followed by a BN layer).
The detailed structure of the CNN models are provided in Appendix A.3.
We use three real world datasets: MNIST (LeCun et al.
, Fashion-MNIST (Xiao et al.
(2017)), and CIFAR-10 (Krizhevsky (2009)).
MNIST is a dataset for hand written digits classiﬁcation with 60000 samples and each example is a 28 (cid:2) 28 greyscale image.
Fashion-MNIST is a dataset intended to replace the original MNIST for benchmarking machine learning algorithms.
CIFAR-10 is a larger dataset with 10 categories.
Each category has 5000 training images andvalidation images of size 32 (cid:2) 32 .
For each dataset, we use 80% of the data for training and amalgamate the remaining data into a global test set.
We form non-IID local datasets as follows.
Assume there are C classes of samples in a dataset.
Each client draw samples form the dataset with probability pr ( x ) = { (cid:17) 2 [0 ; 1] ; if x 2 class j ; N (0 : 5 ; 1) ; otherwise :
It means that the client draw samples from a particular class j with a ﬁxed probability (cid:17) , and from other classes based on standard Gaussian distribution.
The larger (cid:17) is, the more likely the client’s samples concentrate on a particular class, and the more heterogeneous the local datasets are.
5. P ERFORMANCE C OMPARISON
We compare the performance of FeDEC with 5 state-of-the-art methods: FedAvg (McMahan et al.
(2017)), RNN based aggregator (Ji et al.
, FedProx (Li et al.
(2020a)), q-FedSGD
(Li et al.
(2020b)), and FedMA (Wang et al.
The results are analyzed as follows.
[Figure]
[Figure] [Figure]
q-FedSGDRNN
Convergence : In this experiment we study the convergence of all baselines and our algorithm by showing the total communication epochs versus train loss.
Fig.
4 shows the result of ResNet18 on
CIFAR-10.
It is shown that the loss of all algorithms tend to be stable after a number of epoches.
Clearly FeDEC has the lowest loss among all algorithms, which means that FeDEC converges faster that of baselines.
The results of more CNN models on different datasets are shown in Appendix A.4.
Training Efﬁciency :
In this experiment we study the test accuracy versus time during training of a
CNN model with federated learning.
Fig.5 shown the results of training ResNet18 on CIFAR-10.
It is shown that FeDEC reaches 0 : 8 accuracy after 18 minutes, while FedMA, FedProx, and FedAvg take 36 to 63 minutes to reach the same accuracy.
FeDEC approaches 0 : 9 accuracy after 54 minutes, while the accuracy of other algorithms are below 0 : 85 .
The results of more CNN models on different datasets are shown in Appendix A.5.
It suggests that FeDEC trains much faster than the baseline algorithms and it can reach high accuracy in a short time period.
Parameter Bias : In this experiment we study the parameter bias of federated learning algorithms.
Fig.
6 compares the KL-divergence between the means and variances in BN of global models aggregated by different algorithms and the central model.
It is shown that FedAvg, FedProx, and qFedSGD have exceptional high parameter bias, while FeDEC has signiﬁcantly lower KL-divergence compared to the baselines for different CNN models on different datasets.
Global Model Accuracy : In this experiment, we compare the global model accuracy of different federated parameter aggregation algorithms after training to converge.
We repeat the experiment for 20 rounds and show the average results in Table 1.
As shown in the table, the central method yields the highest accuracy.
In comparison of different federated learning methods, FeDEC signiﬁcantly outperforms the other algorithms in global model accuracy.
It performs better than the state-of-the-art method FedMA with 2.87%, 3.17%, 2.58%, and 3.09% accuracy improvement in
ResNet18, DenseNet121, MobileNetV2, and 4-L CNN respectively for CIFAR-10, 1.09% improvement in LeNet for F-MNIST, and 0.33% improvement in LeNet for MNIST accordingly.
FeDEC achieves the highest accuracy among all baselines, and it performs very close to the centralized method, whose accuracy drop is less than 3% in all cases.
[Table]
% 90.31 % DenseNet121@CIFAR-10 93.24% 82.36% - 85.03% 82.43% 88.12% 89.25% 91.29 % MobileNetV2@CIFAR-10 92.51% 83.11% - 80.68% 79.82% 86.59% 87.93% 89.17 % 4-L CNN@CIFAR85.53% 79.33% - 80.02% 77.77% 81.76% 83.11% 84.85% LeNet@F-MNIST 90.42% 87.41% 82.32% 88.33% 86.21% 89.02% 89.52% 90.11% LeNet@MNIST 98.95% 97.32% 97.06% 97.55% 95.88% 98.16% 98.37% 98.49% BiLSTM@Sent 81.47% 72.14% - 71.08% 68.44% 73.81% 77.51% 77.51%
[Figure]
Clients
[Figure] [Figure]
Hyperparameter Analysis : We further analyze the inﬂuence of two hyperparameters in federated learning: the number of clients involved and the heterogeneity of local datasets.
compares the test accuracy of the global model for different number of involved clients.
According to the ﬁgure, the performance of FeDEC is stable.
When the number of mobile clients increases from 5 to 20, the test accuracy slightly decreases from 0.909 to 0.893.
Other baseline algorithms yield signiﬁcant performance drop.
FeDEC achieves the highest test accuracy among all federated learning algorithms in all cases, and it performs very close to the central model.
In the experiment, the heterogeneity of local datasets is represented by (cid:17) , the probability that a client tends to sample from a particular class.
The more (cid:17) approaches to 1, the more heterogeneous the local datasets are.
Fig.
8 shows the test accuracy under different level of heterogeneity.
As (cid:17) increases, the test accuracy of all models decreases.
FeDEC yields the highest test accuracy among all algorithms, and its performance drops much slower than the baselines.
It veriﬁes the effectiveness of the proposed probabilistic-weighted gradient aggregation approach under non-IID conditions.
C ONCLUSION
Gradient aggregation played an important role in federated learning to form a global model.
To address the problem of data and parameter bias in federated learning for non-IID dataset, we proposed a novel probabilistic parameter aggregation method called FeDEC that decoupled gradient parameters and statistical parameters to aggregate them separatively.
The probabilistic weights were optimized with variational inference, and the proposed method was proved to be convergence guaranteed.
Extensive experiments showed that FeDEC signiﬁcantly outperforms the state-of-the-arts on a variety of performance metrics.
A. P ROOF OF C ONVERGENCE G UARANTEE (T HEOREM 1 IN S ECTION 4)
We provide the detailed proof of Theorem 1 in Section 4.
We ﬁrst restate the necessary equations and the theorem.
In section 3, we propose the usage of the following equations for gradient decent update algorithm:
[Equation]
where (cid:12) is the learning rate for parameter update.
And for batch normalization update:
[Equation]
We restate the theorem in section 4 in the following:
Assumption 1 (Unbiased Gradient): We assume that the stochastic gradients g ti is an unbiased estimator of the true gradient ∇ f ( w ti ) , i.e., E [ g ti ] =
∇ f ( w ti ) , where f ( (cid:1) ) is any convex objective function and w ti is its variables.
Assumption 2 (Gradient Convex Set):
We assume that gradient set G is a convex set, where all gradients g 1 ; g 2 ; : : : ; g K are in G , and any g =
∑ Ki =1 (cid:21) i g i ( 8 (cid:21) i > 0 and ∑ Ki =1 (cid:21) i = 1 ) is in G .
Lemma 1 (L-Lipschitz Continuity): For a function f ( (cid:1) ) is Lipschitz continuous if there exists a positive real constant L such that, for all real x 1 and x 2 :
[Equation]
Lemma 2 (Jensen’s Inequality): If f ( w ) is a convex function on W , and E [ f ( w )] and f ( E [ w ]) are ﬁnite, then:
[Equation]
Deﬁnition 1 (Projection Operation): Assume w (cid:3) is an intermediate result of optimization, we deﬁne a project operator ∏ W ( w (cid:3) ) to project w (cid:3) to the domain W , which is computed by:
[Equation]
Deﬁnition 2 (Diameter of Domain):
Given a function f ( w ) , where w 2 W , and W is f ’s domain of deﬁnition.
The diameter of W is denoted by (cid:0) : for every w 1 ; w 2 2 W : jj w 1 (cid:0) w 2 jj (cid:20) (cid:0) .
Theorem 1 (Guaranteed Convergence Rate): If a convex function f ( w ) is L-Lipschitz continuous function, then jj∇ f ( w ) jj (cid:20) L .
Let (cid:0) be the diameter of domain.
Applying equations (3)(4)(5) for gradients aggregation, we have the following convergence rate for the proposed FeDEC algorithm:
[Equation]
(11) where (cid:22) w T is the average result of w for total training epoch T , (cid:12) is the learning rate in equation-(3), and T is the total training epoch.
If we let (cid:12) = (cid:0) L p T , the convergence rate is O ( 1 p T ) .
Proof : To simplify the analysis, we consider ﬁxed learning rate (cid:12) .
The proof includes the following steps:
According to the deﬁnition of convex function,
f ( w t ) (cid:0) f ( w ) (cid:20) ∇ f ( w t )( w t (cid:0) w ) :
(2) We deﬁne G ( w ) =
∇ f T ( w t )( w t (cid:0) w ) , and g t
=
∑ Kk =1 (cid:25) k g tk .
The intermediate result of f ( w ) in update time t + 1 is denoted by w t +1 (cid:3) .
With assumption 1 and assumption 2, we have:
[Equation]
So we have:
[Equation]
(3) We project w t +1 (cid:3) to w t +1 .
With deﬁnition 1 and using non-expandable property of projection operation of convex set, we have:
[Equation]
Due to L-Lipschitz Continuity (Lemma 1)
[Equation]
we have:
[Equation]
So we have:
[Equation]
According to deﬁnition 2, summing up all w from t = 1 to T , we have:
[Equation]
∑
[Equation]
According to Jensen’s Inequality (Lemma 2), we have:
[Equation]
We can get the result:
[Equation]
(6) Taking (cid:12) = (cid:0) =
( L p
T ) , the right part of the above equation becomes
[Equation]
Therefore we can obtain the simpliﬁed expression of the convergence bound
O
( 1 p T ) .
A. E XPLANATION OF U NBIAS P ARAMETER A GGREGATION IN S ECTION 3.2.
We compute the expectation of the aggregated parameters W tmean and W tvar in Section 3.2.2 as follows.
[Equation]
According to the above equations, if the parameters of the local models W t;kmean and W t;kvar are unbias, then the aggregated model parameters are unbias as well.
A. S TRUCTURE OF THE N EURAL N ETWORK M ODELS IN S ECTION
Here we report the detailed model structure used in the experiments.
We use LeNet shown in Table 2 and the 4-layer CNN model shown in Table 3.
We adopt a slim ResNet18 as shown in Table 4, where “Conv2d” is convolution layer, “BatchNorm2d” is batch normalization layer, and “Linear” is fully-connected layer.
We can observe that every convolution layer is followed by a batch normalization (BN) layer.
For all models, we use ReLU layer after every Conv2d layer.
The structure of
DenseNet121 2 and MobileNetV2 3 can be found in GitHub.
For language model, we consider the sentiment analysis task on tweets from Sentiment140 with 2-layer BiLSTM.
The BiLSTM binary classiﬁer containing 256 hidden units with pretrained 100dimentional GloVe embedding.
Each twitter account corresponds to a device
[Table]
[Table] [Table]
[Table]
A. C ONVERGENCE OF F EDERATED L EARNING A LGORITHMS FOR D IFFERENT M ODELS ON D IFFERENT D ATASETS
[Figure]
[Figure]
A. T RAINING E FFICIENCY OF F EDERATED L EARNING A LGORITHMS FOR D IFFERENT M ODELS ON D IFFERENT D ATASETS
[Figure] [Figure]
1 Server
Combine
W t .
9 Client 10 for t = to T do
Receive
W t .
Train local model W t dataset and get local gradients g t .
t
; ^
Stop training until received server model W t .
True & Inferenced Distribution 0.
[Figure]