free-riders in federated learning: attacks and defenses · protect privacy since all data stay...

13
Free-riders in Federated Learning: Attacks and Defenses Jierui Lin, Min Du, and Jian Liu University of California, Berkeley Abstract—Federated learning is a recently proposed paradigm that enables multiple clients to collaboratively train a joint model. It allows clients to train models locally, and leverages the parameter server to generate a global model by aggregating the locally submitted gradient updates at each round. Although the incentive model for federated learning has not been fully developed, it is supposed that participants are able to get rewards or the privilege to use the final global model, as a compensation for taking efforts to train the model. Therefore, a client who does not have any local data has the incentive to construct local gradient updates in order to deceive for rewards. In this paper, we are the first to propose the notion of free rider attacks, to explore possible ways that an attacker may construct gradient updates, without any local training data. Furthermore, we explore possible defenses that could detect the proposed attacks, and propose a new high dimensional detection method called STD- DAGMM, which particularly works well for anomaly detection of model parameters. We extend the attacks and defenses to consider more free riders as well as differential privacy, which sheds light on and calls for future research in this field. Keywords—anomaly detection, federated learning, free-rider de- tection, machine learning security. I. I NTRODUCTION F EDERATED learning [1], [2], [3] has been proposed to facilitate a joint model training leveraging data from multiple clients, where the training process is coordinated by a parameter server. In the whole process, clients’ data stay local, and only model parameters are communicated among clients through the parameter server. A typical training iteration works as follows. First, the parameter server sends the newest global model to each client. Then, each client locally updates the model using local data and reports updated gradients to the parameter server. Finally, the server performs model aggregation on all submitted local updates to form a new global model, which has better performance than models trained using any single client’s data. Compared with an alternative approach which simply col- lects all data from the clients and trains a model on those data, federated learning is able to save the communication overhead by only transmitting model parameters, as well as protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely adopted for model training utilizing data from multiple users and/or organizations. Federated learning has many practical applications, such as next-word prediction in a virtual keyboard for smartphones [4], J. Lin, M. Du and J. Liu are with the Department of Electrical Engineering and Computer Science, University of California, Berkeley, CA, 94704, USA e-mail: jerrylin0928, [email protected], [email protected]. prediction of customers’ usage of IoT devices [5] and classi- fication of hospitalizations for cardiac events [6], to achieve a well-trained model. Although the profit model [7] for federated learning has not been fully developed, one would assume that a client who contributes data to the model training process could either get money or the privilege to use the final trained model as a reward. However, a question raised by this is: how could one tell whether the model updates uploaded by a client are actually trained using local data, or artificially constructed weights which adds no value to the model? Free-riders are generally referred as some individuals who benefit from resources, public goods, or services of a commu- nal nature, but do not pay for them [8]. The free-riders problem has been extensively studied in peer-to-peer systems [9], [10], [11]. The aim of this paper is to set out the research of free- riders in federated learning. In a federated learning setting where each contributing client could get a reward, there may exist clients that pretend to be contributing to trick rewards. We refer such clients as free-riders, and the procedure of generating fake weights to report to the parameter server as free-rider attacks. There could be two main incentives for free riders to submit fake updates. For one, a client may not have the required data, or is concerned about data privacy, so that local data are not available for model training. For another, a client may want to save local CPU cycles or other computing resources. Note that in the first case, where local data are not available but a client is willing to consume computing resources, the client may try to submit gradients trained with another dataset in order to evade detection. However, the cen- tral server could easily catch such a free rider by verifying the model accuracy on a holdout validation dataset. Thus, in both cases, free riders will have to fake their weight submissions, through clever manipulations of the information provided by the central server. With that, we explore a set of free-rider attacks and propose a powerful defense mechanism - STD- DAGMM, that is able to detect most free riders and prevent them from getting the final model and monetary rewards. We leave it as an open question to explore more sophisticated attacks and defences. We start from a simple attack where the free-rider simply uses randomly generated values as the gradient updates. We empirically show that this attack can evade a popular detection approach, i.e., Autoencoder [12], [13], but be detected by a recently proposed high-dimensional anomaly detection method - DAGMM [14]. Then, we propose a new attack named delta weights attack, which generates gradient updates by subtract- ing the two global models received in previous two rounds. We arXiv:1911.12560v1 [cs.LG] 28 Nov 2019

Upload: others

Post on 25-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

Free-riders in Federated Learning: Attacks andDefenses

Jierui Lin, Min Du, and Jian LiuUniversity of California, Berkeley

Abstract—Federated learning is a recently proposed paradigm thatenables multiple clients to collaboratively train a joint model. Itallows clients to train models locally, and leverages the parameterserver to generate a global model by aggregating the locally submittedgradient updates at each round. Although the incentive model forfederated learning has not been fully developed, it is supposed thatparticipants are able to get rewards or the privilege to use the finalglobal model, as a compensation for taking efforts to train the model.Therefore, a client who does not have any local data has the incentiveto construct local gradient updates in order to deceive for rewards.In this paper, we are the first to propose the notion of free riderattacks, to explore possible ways that an attacker may constructgradient updates, without any local training data. Furthermore, weexplore possible defenses that could detect the proposed attacks,and propose a new high dimensional detection method called STD-DAGMM, which particularly works well for anomaly detection ofmodel parameters. We extend the attacks and defenses to considermore free riders as well as differential privacy, which sheds light onand calls for future research in this field.

Keywords—anomaly detection, federated learning, free-rider de-tection, machine learning security.

I. INTRODUCTION

FEDERATED learning [1], [2], [3] has been proposedto facilitate a joint model training leveraging data from

multiple clients, where the training process is coordinatedby a parameter server. In the whole process, clients’ datastay local, and only model parameters are communicatedamong clients through the parameter server. A typical trainingiteration works as follows. First, the parameter server sendsthe newest global model to each client. Then, each clientlocally updates the model using local data and reports updatedgradients to the parameter server. Finally, the server performsmodel aggregation on all submitted local updates to form anew global model, which has better performance than modelstrained using any single client’s data.

Compared with an alternative approach which simply col-lects all data from the clients and trains a model on thosedata, federated learning is able to save the communicationoverhead by only transmitting model parameters, as well asprotect privacy since all data stay local. As a result, federatedlearning has attracted much attention and is being widelyadopted for model training utilizing data from multiple usersand/or organizations.

Federated learning has many practical applications, such asnext-word prediction in a virtual keyboard for smartphones [4],

J. Lin, M. Du and J. Liu are with the Department of Electrical Engineeringand Computer Science, University of California, Berkeley, CA, 94704, USAe-mail: jerrylin0928, [email protected], [email protected].

prediction of customers’ usage of IoT devices [5] and classi-fication of hospitalizations for cardiac events [6], to achieve awell-trained model. Although the profit model [7] for federatedlearning has not been fully developed, one would assume thata client who contributes data to the model training processcould either get money or the privilege to use the final trainedmodel as a reward. However, a question raised by this is: howcould one tell whether the model updates uploaded by a clientare actually trained using local data, or artificially constructedweights which adds no value to the model?

Free-riders are generally referred as some individuals whobenefit from resources, public goods, or services of a commu-nal nature, but do not pay for them [8]. The free-riders problemhas been extensively studied in peer-to-peer systems [9], [10],[11]. The aim of this paper is to set out the research of free-riders in federated learning. In a federated learning settingwhere each contributing client could get a reward, there mayexist clients that pretend to be contributing to trick rewards.We refer such clients as free-riders, and the procedure ofgenerating fake weights to report to the parameter server asfree-rider attacks. There could be two main incentives for freeriders to submit fake updates. For one, a client may not havethe required data, or is concerned about data privacy, so thatlocal data are not available for model training. For another, aclient may want to save local CPU cycles or other computingresources. Note that in the first case, where local data arenot available but a client is willing to consume computingresources, the client may try to submit gradients trained withanother dataset in order to evade detection. However, the cen-tral server could easily catch such a free rider by verifying themodel accuracy on a holdout validation dataset. Thus, in bothcases, free riders will have to fake their weight submissions,through clever manipulations of the information provided bythe central server. With that, we explore a set of free-riderattacks and propose a powerful defense mechanism - STD-DAGMM, that is able to detect most free riders and preventthem from getting the final model and monetary rewards. Weleave it as an open question to explore more sophisticatedattacks and defences.

We start from a simple attack where the free-rider simplyuses randomly generated values as the gradient updates. Weempirically show that this attack can evade a popular detectionapproach, i.e., Autoencoder [12], [13], but be detected by arecently proposed high-dimensional anomaly detection method- DAGMM [14]. Then, we propose a new attack named deltaweights attack, which generates gradient updates by subtract-ing the two global models received in previous two rounds. We

arX

iv:1

911.

1256

0v1

[cs

.LG

] 2

8 N

ov 2

019

Page 2: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

show that such an attack is able to evade DAGMM detection.To defend against such attacks, we propose a STD-DAGMM,which incorporates the standard deviation metric of a localgradient update matrix with DAGMM. We extensively evaluateSTD-DAGMM under stronger attacks and with varying real-world settings. We believe our findings could be inspiring forthe research in federated learning, and initiates a new field offree rider detection in such an environment. Our contributionsare summarized as follows.

1) As far as we know, we are the first to explore free-rider attacks in federated learning, and propose possibledefenses against such attacks.

2) We explore the best attack a free rider may exploit,and propose a novel high-dimensional anomaly detectionapproach, STD-DAGMM, that is particularly useful forfree rider detection. The proposed method is potentiallyuseful for other model weights anomaly detection aswell.

3) We extend our findings under more real world settings,such as in the face of differential privacy. We observethat differential privacy in federated learning couldpotentially mitigate the effectiveness of the proposedattacks and make them more easily to be detected.

II. PRELIMINARY

A. Federated learning

In a typical federated learning setting, a central parameterserver coordinates a network of nodes, e.g. smartphones,tablets and laptops, to train a global model utilizing data fromall the participants. Suppose there are n clients C1, C2, ...,Cn collaboratively training a global model M in the setting offederated learning. In the j-th round, each client Ci receivesthe newest global model Mj from the parameter server, andproduces local gradient Gi,j by training the model using itslocal data; the parameter server aggregates each Gi,j to be anew global model, using [1]

Mj+1 =Mj − η · 1n

n∑i=1

Gi,j (1)

where η is a global learning rate applied by the parameterserver, to control learning speed etc. In a simple case, η = 1,where for each round, a new global model is generated bysimply subtracting the average of all local gradient updatesfrom the previous global model.

B. DAGMM

DAGMM [14], short for Deep Autoencoding GaussianMixture Model, uses a deep Autoencoder to generate a low-dimensional representation, as well as calculate the reconstruc-tion error for each input data point. It further concatenates thelow-dimensional embedding with the distances between inputand reconstructed output by Autoencoder, including Euclideandistance and Cosine distance. The concatenated vector is fedinto a Gaussian mixture model (GMM), which adopts anestimation network and trains the parameters to make the inputfit the Gaussian mixture model. DAGMM jointly optimizes the

parameters for deep Autoencoder and the Gaussian mixturemodel in an end-to-end fashion, with the goal of minimizingAutoencoder input-output error and fitting the GMM modelin the same time. According to [14], the end-to-end trainingis beneficial to density estimation, since we can have morefreedom to adjust the dimension of encoded vector to favorthe subsequent density estimation tasks. To perform anomalydetection, DAGMM takes mini batches of high dimensionalvectors as an inputs, trains to optimize the model parameters,and finally outputs an energy value for each vector. The vectorshaving energy values higher than the majority are consideredas suspicious.

III. PROBLEM SETTING

For federated learning, we adopt the notions and symbolspresented in Section II-A. In the j-th round, a client Ci

receives a global model Mj , and submits a gradient updateGi,j .

a) Free-riders.: We define a free-rider as a client (sayCi) who fakes Gi,j and pretends it to be generated throughlocal data training. Ci may not have access to local datathat could be used to train the model. Rather, Ci simplygenerates Gi,j using the available knowledge (e.g., globalmodel architecture, matrix values of each received globalmodel), with a goal of fooling the parameter server, in orderto enjoy the benefits of participating in global model training.We use Cf

i to denote that a client Ci is a free rider.b) Assumptions.: We restrain our problem as: if a client

is a free-rider, it will be a free rider in all rounds, ratherthan being free-riders in some rounds while not in others. Theintuition is that if a client has no local data, it cannot train areal model in any round. Also, free riders are independent thatthey can’t collude to evade detection. We further assume thatthe parameter server does not keep a history of local clientsupdates. With this, to detect if a client is a free rider in roundj, one can only use the updates available at round i, e.g., [C1,j ,C2,j , C3,j , ...], without having access to the history.

c) Detection goals.: In this problem, there are multipleseries of local gradient updates, e.g., [G1,1, G1,2, ..., G1,t],[G2,1, G2,2, ..., G2,t], ..., [Gn,1, Gn,2, ..., Gn,t], and a seriesof global models [M1, M2, ..., Mt]. The goal of free-riderdetection is to detect gradient series [Gi,1, Gi,2, ..., Gi,t],where all gradients Gi,j are faked instead of being updatedthrough local data.

IV. ATTACK I: RANDOM WEIGHTS

In this section, we present a basic attack that a naive attackermay exploit, and a possible detection mechanism for thisattack.

A. Attack specification

For the federated learning process, in the j-th round, a free-rider client Cf

i receives the newest global model Mj . Thegradient update Gi,j to submit should have the same dimen-sion with global model Mj , otherwise would be rejected bythe parameter server immediately. A straightforward methodto construct Gi,j , is to simply copy Mj as Gi,j , and replace

Page 3: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

each value in Gi,j with 0, which however, would be trivial todetect. A better way is to replace each value in Gi,j with arandomly generated value, which we detail below.

a) Random weights attack.: For this attack, a free riderwill attempt to construct a gradient update matrix that hasthe same dimension with the received global model, throughrandomly sampling each value from a uniform distributionwithin range [−R,R]. The attacker may have previous modeltraining experience such that R is close to mimic other normalclients’ updates. For this attack, the attacker may only vary oneparameter, which is listed as below.

Random weights range R. This parameter decides themaximum and minimum range that a free rider may drawa random value from. Since an attacker may have previousmodel training experience, we may assume this range couldbe arbitrarily close to the real case.

B. Defense strategy

Our defense strategy in this section would also focus onexisting anomaly detection methods that a parameter servermay explore. Firstly, we show that this naively generated attackis possible to evade probably the most popular deep learn-ing based outlier detection approach - Autoencoder anomalydetection. Secondly, we show that a recent work dedicatedfor high-dimensional anomaly detection called DAGMM, aspresented in Section II-B, is able to detect such attacks.

a) Autoencoder detection.: Autoencoder [12], [13] is adeep neural network model architecture that has been widelyadopted for outlier detection [15], [16]. It contains an encoderwhich aims to reduce the input data dimension, and a decoderwhich attempts to reconstruct the input data. Given a datasample, the learning objective is to minimize the error betweenan input and its corresponding output. Since the dimensionalityreduction inevitably brings information loss, an Autoencodermodel which is trained to minimize the average loss of theentire training data, is trained to preserve the most commoninformation. As a result, outliers would have larger input-output error compared with others, since they may containpatterns that are not learned by Autoencoder. Therefore, wecould do outlier detection by measuring the reconstructionerror for each data sample. To use Autoencoder for free riderdetection, we first concatenate all rows of a client updatematrix (e.g., having dimension m × n) to be a single vector(e.g., having dimension 1 × mn). Then, all clients’ updatevectors are fed into Autoencoder in mini-batches, to train theAutoencoder with a learning objective to minimize the averagereconstruction error for each mini-batch.

b) DAGMM detection.: As introduced in Section II-B,DAGMM is a recently proposed anomaly detection methodthat is particularly useful for high-dimensional data. Notethat deep learning model weight matrices could easily containmillions of parameters. For a simple 2-layer fully connectednetwork we use for MNIST digit classification, the parametersize is close to 0.2 million. Thus, we believe DAGMM couldbe a more suitable model for our purpose due to the highdimensional nature of weight matrices. To use DAGMM forfree rider detection, we do the same thing for each client

updates as for Autoencoder - concatenate all rows in a weightmatrix to construct one single vector, and then feed all clientupdate vectors into the DAGMM model in mini-batches.

... ...

Compression Net Estimation Net

Fig. 1: DAGMM model architecture

C. Experimental validation

Without loss of generality, we assume there are 100 clientsin total, and only 1 free rider among all clients. Extensionon more free riders will be presented in Section VII-A. Inthis set of experiments, we use MNIST dataset [17], andexplore two cases in terms of whether each client has similardata distribution. Note that the clients having similar data areexpected to have similar gradient updates as well. In this case,the free rider could be easier to detect since the randomlyconstructed weight matrix is different from the majority. Onthe other hand, if each client may have different data withothers, a free-rider could be harder to detect, since all otherclients may have different gradient updates after training onlocal data.

We explore both cases in terms of different R for the randomselection range [−R,R]. Also, note that the performance of thedetection method is highly dependent on the training period,i.e., a free rider is easier to be detected when the modelis (close to) converged, than at the beginning of a trainingperiod. Although early detection is preferred, we also showthe detection performance when model is close to converged,as an additional reference.

1) Each client has similar local data distribution.: Tomimic the case where each client has similar local datadistribution with others, we randomly distribute the MNISTdataset to each client. Therefore, we can assume that eachclient possesses all 10 classes in MNIST, and different clientshave similar local datasets. As explained in Section IV-A,an attacker may have previous training knowledge to chooserange R, to make the constructed weights close to otherclients’ gradient updates.

a) Random weights range R = 10−4.: We first considera case where R is not properly selected. In this experiment,for the gradient updates Gi,j submitted by Cf

i , each valueis randomly sampled from a uniform distribution within range[−10−4, 10−4]. Figure 2a shows the standard deviation (STD)of each client’s local gradient updates, with the increase ofrounds in federated learning. The thicker, black line indicatesthe STD of the free rider, while lighter lines having variousother colors indicate all other 99 clients’ STD statistics. We

Page 4: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

pick two rounds for free rider detection: round 5 whichrepresents the beginning of federated learning process, andround 80 which represents the case when the model is almostconverged, which are indicated in Figure 2a as two verticaldashed lines.

0 5 20 40 60 80 100Round

0.2

0.4

0.6

0.8

Valid

atio

n Ac

cura

cy

free rider

0.0000

0.0002

0.0004

0.0006

0.0008

0.0010

0.0012

0.0014

0.0016

STD

(a) Standard deviation (STD) of the updates submitted by each client,with the change of training process

0.2 0.4 0.6 0.8Autoencoder MSE 1e 6

0.0

2.5

5.0

7.5

10.0

12.5

15.0

Num

ber o

f Clie

nt(s

)

free rider

(b) Round 5

1 2 3 4 5Autoencoder MSE 1e 7

0

2

4

6

8

10

Num

ber o

f Clie

nt(s

)

free rider

(c) Round 80

(d) Autoencoder - not detected

5 10 15 20 25DAGMM Energy

0

5

10

15

20

25

30

Num

ber o

f Clie

nt(s

)

free rider

(e) Round 5

5.0 7.5 10.0 12.5 15.0 17.5DAGMM Energy

0.0

2.5

5.0

7.5

10.0

12.5

15.0

Num

ber o

f Clie

nt(s

)

free rider

(f) Round 80

(g) DAGMM - detected

Fig. 2: Similar local data distribution, randomly sampledupdates from [−10−4, 10−4]

Figure 2d shows the free rider detection result using Au-toencoder. Presumably, Autoencoder should be able to learnsome important features from the similar weights submittedby benign clients and thus, produce a higher reconstructionerror for the free rider. However, surprisingly, as in Figure 2d,Autoencoder has the smallest error for the free rider amongall clients, and thus fails to detect such attack. Based on thestatistics in Figure 2a, our assumption is that the free riderupdate has much smaller standard deviation compared withother clients’ updates, which could be easier to memorize forAutoencoder, producing a small reconstruction error.

On the other hand, DAGMM is able to detect such attack,as shown in Figure 2g. Besides the reason that DAGMM

considers the reduced dimensional embeddings, we think thatthe Consine distance DAGMM takes into account also helpsto identify free riders, since its input-output angle could bedifferent from those of normal clients. After DAGMM, thefree rider has the highest energy value, and a wide rangeof thresholds suffice to separate the free rider from all otherclients.

b) Random weights range R = 10−3.: In this part, weexplore the case where range R is carefully selected such thatthe STD statistics for the free rider is similar to that of allother clients. In this experiment, for the gradient updates Gi,j

submitted by Cfi , each value is randomly sampled from a

uniform distribution within range [−10−3, 10−3]. The STDstatistics for all clients with the increase of learning rounds areshown in Figure 3a. Note that the STD of the free rider andother clients are basically inseparable after round 10. However,our experimental results (in Figure 3d) suggest that DAGMMis still able to detect the free rider, both at the beginningtraining period (round 5), and when close to converge (round80).

0 5 20 40 60 80 100Round

0.2

0.4

0.6

0.8

Valid

atio

n Ac

cura

cy

free rider

0.0004

0.0006

0.0008

0.0010

0.0012

0.0014

0.0016

STD

(a) Standard deviation (STD) of the updates submitted by each client,with the change of training process

4 6 8 10 12 14DAGMM Energy

0

2

4

6

8

10

12

Num

ber o

f Clie

nt(s

)

free rider

(b) Round 5

5 10 15 20DAGMM Energy

0.0

2.5

5.0

7.5

10.0

12.5

Num

ber o

f Clie

nt(s

)

free rider

(c) Round 80

(d) DAGMM - detected

Fig. 3: Similar local data distribution, randomly sampledupdates from [−10−3, 10−3]

2) Each client has different local data distribution.: Tosimulate the case where each client may have different localdata with others, we first sort the MNIST dataset based onthe labels each image has (i.e., from class 0 to class 9), andthen sequentially distribute the sorted dataset to all clients.As a result, a majority number of clients only have one classof MNIST data images locally (e.g., only have images withnumber 9), and the rest have up to two classes. In this case,

Page 5: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

the free rider could be harder to detect by analyzing submittedgradient updates, because all other clients’ updates are alsodifferent with each other. As previous section has indicatedthat R = 10−3 generates a random update matrix that hassimilar STD with other clients, in this section we only showthe results in this case.

a) Random weights range R = 10−3.: The STD statis-tics of each client’s updates are presented in Figure 4a. Notehere the model accuracy increases slower, and the STD foreach client’s gradient update is also bigger, which are all dueto the different local data distribution on each client.

We demonstrate that DAGMM is still able to successfullydetect such attacks, as shown in Figure 4d.

0 5 20 40 60 80 100Round

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Valid

atio

n Ac

cura

cy

free rider0.001

0.002

0.003

0.004

0.005

STD

(a) Standard deviation (STD) of the updates submitted by each client,with the change of training process

6 8 10 12DAGMM Energy

0

5

10

15

Num

ber o

f Clie

nt(s

)

free rider

(b) Round 5

8 10 12 14 16DAGMM Energy

0.0

2.5

5.0

7.5

10.0

12.5

15.0

Num

ber o

f Clie

nt(s

)

free rider

(c) Round 80

(d) DAGMM - detected

Fig. 4: Different local data distribution, randomly sampledupdates from [−10−3, 10−3]

V. ATTACK II: DELTA WEIGHTS

A. Attack specification

As presented in Section II-A, in the j-th round of federatedlearning, a client Ci receives the global model Mj and submitsa local gradient update Gi,j . With a received global model ateach round, a free rider is able to construct more sophisticatedfake gradient updates, than merely generating a random updatematrix that has the same dimension with the global model. Inthis section, we consider a sophisticated attacker, which gen-erates the fake gradient updates by subtracting two previouslyreceived global model. We call such an attack as delta weightsattack.

a) Delta weights attack.: Suppose a free rider receivesglobal model Mj−1 at round j − 1 and Mj at round j. Inthe delta weights attack, the free rider Cf

i constructs gradientupdates Gf

i,j by

Gfi,j =Mj−1 −Mj = η · 1

n

n∑x=1

Gx,j−1 (ref.Equation 1)

(2)This suggests that the fake gradient update Gf

i,j constructed ata round j, is essentially the average gradient update submittedby all clients at previous round j − 1, times a scaling factorη.

Note that for machine learning training, except for the firstfew epochs, the parameter change at each round is very small.As a result, the constructed fake gradients could be verysimilar to the ones submitted by other clients, and could mostlikely evade any detection mechanism that uses a validationdataset to detect free riders by checking if utility drop happens.

B. Defense strategyFor this attack, the effectiveness of the defense strategy

could be affected by global learning rate η. In the typical case,when η = 1, the fake gradient update generated by the freerider is simply the average of all other clients’ updates inprevious rounds. When η is small, free rider’s fake updateswould be much smaller compared with other clients’ updates.Interestingly, we find that DAGMM works well when η isclose to 1, but fails to detect the free rider when η is small.Another observation is that, when η is small, the STD statisticsof the fake gradients is also much smaller than other clients’updates. The detailed results will be presented in the followingexperiment section. Based on the two observations, we proposea general free-rider detection approach that combines bothSTD and DAGMM, aiming to provide a general free riderdetection mechanism that works under different learning ratesη. We refer this method as STD-DAGMM detection.

a) STD-DAGMM detection.: In Section II-B, we havedemonstrated that for DAGMM, the input vector of theestimation net concatenates both the reduced dimensionalembedding vector in Autoencoder, and the distance metrics(e.g., Euclidean and Cosine distances) between Autoencoderinput and output. To add STD metric into DAGMM network,we could append this metric into the input vector of estimationnet. We refer this new approach as STD-DAGMM, as shown inFigure 5. Specifically, given a gradient update matrix, we firstconcatenate all rows in the matrix to create a one-dimensionalvector as described in Section IV-B, and then feed it into theAutoencoder (compression network) of STD-DAGMM. Wethen calculate the standard deviation (STD) zstd of this one-dimensional input vector, as well as the Euclidean and Cosinedistance metrics as discussed in Section IV-B, and further stackthe 3 metrics to create a vector zr of size 3. Finally, this vectorzr is concatenated with the low-dimensional representation zclearned by Autoencoder (compression network). The outputconcatenated vector z is fed into the estimation network formultivariate Gaussian estimation.

The learning objective for STD-DAGMM is the same asDAGMM, which is to simultaneously minimize Autoencoder

Page 6: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

... ...

Compression Net Estimation Net

Fig. 5: STD-DAGMM model architecture

reconstruction error to better preserve the important feature ofinput samples, and maximize the likelihood of observing inputsamples.

We find that STD-DAGMM is extremely effective towardsfree rider detection, even for very sophisticated attacks whichshow no clear separation boundary between basic statisticsof fake and true gradient updates, as will be presented inSection VI.

C. Experimental validation

As in previous section, for this set of experiments, weconsider a total of 100 clients and only 1 free rider. Rememberthat this attack is simply constructed by subtracting twoprevious global models. If there are multiple attackers doingsuch attack, these free riders will be trivial to detect as theyall submit the same update matrix.

Similar to Section IV-C, we adopt MNIST dataset and a2-layer fully connected deep neural network, and present ourresults under two cases, in terms of whether each client hassimilar local data distribution.

1) Each client has similar local data distribution.: In thissection, we demonstrate how previously proposed detectionmechanism may fail, and show the effectiveness of our pro-posed STD-DAGMM method under various learning rates η.

We find that when the global learning rate η is small(less than 0.3), DAGMM fails to detect the free rider at thebeginning of the training period (e.g., round 5). This couldhappen because: 1) with a low global learning rate η, thegradient update a free rider constructs is also degraded by η,which is closer to 0 and easier for the network to memorize;and 2) compared with Figure 2a, the weight submitted by freeriders and benign clients have similar directions, which makesthe Consine distance metric in DAGMM not work. However,we observe that when DAGMM fails, the STD of the freerider gradient updates is much smaller than those of otherclients, due to the scaling factor η. This inspires us to add theSTD metric into DAGMM network, referred as STD-DAGMMdetection approach. The detection result of this method isshown in Figure 6g. The free rider has an energy value muchlarger than other clients, and thus could be easily detected bya wide range of thresholds.

Based on the statistics in Figure 6a, one may think that theSTD metric itself could be a suitable indicator for free riderdetection. However, we show that it is not enough. Specifically,

0 5 20 40 60 80 100Round

0.2

0.4

0.6

0.8

Valid

atio

n Ac

cura

cy

free rider

0.000000.000250.000500.000750.001000.001250.00150

STD

(a) Standard deviation (STD) of the updates submitted by each client,with the change of training process

4 6 8 10 12 14DAGMM Energy

0

2

4

6

8

10

12

Num

ber o

f Clie

nt(s

)

free rider

(b) Round 5

10 20 30 40DAGMM Energy

0

10

20

30

40

Num

ber o

f Clie

nt(s

)

free rider

(c) Round 80

(d) DAGMM - not detected

2.5 5.0 7.5 10.0 12.5 15.0STD-DAGMM Energy

0.0

2.5

5.0

7.5

10.0

12.5

Num

ber o

f Clie

nt(s

)

free rider

(e) Round 5

5 10 15 20 25STD-DAGMM Energy

0

5

10

15

20

25

Num

ber o

f Clie

nt(s

)

free rider

(f) Round 80

(g) STD-DAGMM - detected

Fig. 6: Similar local data distribution, delta weights attack withη = 0.3

we demonstrate the results when η = 1 in Figure 7. Notein Figure 7a, before round 10, the STD curve of free riderfake updates mostly overlaps with other clients. Hence, usingSTD metric is not able to separate the free rider from others.However, DAGMM is effective in this case with its abilityto capture high-dimensional patterns, as shown in Figure 7d.Since the proposed STD-DAGMM method combines STD andDAGMM, it also suffices to detect the free rider in this case, asin Figure 7g. Hence, we believe the proposed STD-DAGMMmethod is a general technique that is able to detect the freerider utilizing delta weights attack, under different learningrates η.

To further validate the generality of our proposed STD-DAGMM approach, we further show its effectiveness undermultiple other learning rates, i.e., η = 0.7 as shown in Fig-ure 8, and η = 0.9 as in Figure 9. Both results demonstrate thatSTD-DAGMM is a general approach for free rider detectionwith delta weights generation under different global learning

Page 7: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

0 5 20 40 60 80 100Round

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Valid

atio

n Ac

cura

cy

free rider

0.0000

0.0002

0.0004

0.0006

0.0008

0.0010

0.0012

0.0014

0.0016

STD

(a) Standard deviation (STD) of the updates submitted by each client,with the change of training process

5.0 7.5 10.0 12.5 15.0 17.5 20.0DAGMM Energy

0

5

10

15

20

Num

ber o

f Clie

nt(s

)

free rider

(b) Round 5

5 10 15 20 25DAGMM Energy

0

5

10

15

20

25

Num

ber o

f Clie

nt(s

)

free rider

(c) Round 80

(d) DAGMM - detected

5 10 15 20STD-DAGMM Energy

0

5

10

15

20

Num

ber o

f Clie

nt(s

)

free rider

(e) Round 5

5 10 15 20 25STD-DAGMM Energy

0

5

10

15

Num

ber o

f Clie

nt(s

)

free rider

(f) Round 80

(g) STD-DAGMM - detected

Fig. 7: Similar local data distribution, delta weights attack withη = 1

rates η.2) Each client has different local data distribution.: In this

section, we distribute MNIST dataset into each local client,such that each client only has 1 or 2 classes, using themethod described in Section IV-C2. Without loss of generality,we show the statistics and detection results when η = 1,as in Figure 10. Note that the STD statistics in Figure 10ashow that the free rider fake updates in this case have lowerstandard deviation compared with other clients. We thinkthat is because all other clients only have a specific set ofparameters to update, thus the submitted gradient vector issparse and has larger STD, while the free rider, by averagingall others’ updates, reduces the STD. Figure 10d indicates thatour proposed STD-DAGMM method is also effective.

3) STD-DAGMM for random weights attack detection:Finally, we apply STD-DAGMM method on previously eval-uated random weights attack generation. The results in Fig-ure 11 show that STD-DAGMM is able to detect the random

0 5 20 40 60 80 100Round

0.2

0.4

0.6

0.8

Valid

atio

n Ac

cura

cy

free rider0.00025

0.00050

0.00075

0.00100

0.00125

0.00150

STD

(a) Standard deviation (STD) of the updates submitted by each client,with the change of training process

2.5 5.0 7.5 10.0 12.5 15.0STD-DAGMM Energy

0.0

2.5

5.0

7.5

10.0

12.5

15.0

Num

ber o

f Clie

nt(s

)

free rider

(b) Round 5

10 20 30STD-DAGMM Energy

0

5

10

15

20

25

30

Num

ber o

f Clie

nt(s

)

free rider

(c) Round 80

(d) STD-DAGMM - detected

Fig. 8: Similar local data distribution, delta weights attack withη = 0.7

0 5 20 40 60 80 100Round

0.2

0.4

0.6

0.8

Valid

atio

n Ac

cura

cy

free rider

0.0000

0.0002

0.0004

0.0006

0.0008

0.0010

0.0012

0.0014

0.0016

STD

(a) Standard deviation (STD) of the updates submitted by each client,with the change of training process

5 10 15 20STD-DAGMM Energy

0

5

10

15

20

Num

ber o

f Clie

nt(s

)

free rider

(b) Round 5

5 10 15 20 25STD-DAGMM Energy

0

5

10

15

20

25

Num

ber o

f Clie

nt(s

)

free rider

(c) Round 80

(d) STD-DAGMM - detected

Fig. 9: Similar local data distribution, delta weights attack withη = 0.9

Page 8: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

0 5 20 40 60 80 100Round

0.2

0.4

0.6

0.8

Valid

atio

n Ac

cura

cy

free rider

0.000

0.001

0.002

0.003

0.004

STD

(a) Standard deviation (STD) of the updates submitted by each client,with the change of training process

5 10 15 20STD-DAGMM Energy

0

5

10

15

Num

ber o

f Clie

nt(s

)

free rider

(b) Round 5

5 10 15 20STD-DAGMM Energy

0

5

10

15

Num

ber o

f Clie

nt(s

)

free rider

(c) Round 80

(d) STD-DAGMM - detected

Fig. 10: Different local data distribution, delta weights attackwith η = 1

weights attack evaluated in Section IV-C no matter whetherclients have similar local data or not, which further demon-strates its generality in free-rider attack detection.

VI. ATTACK III: ADVANCED DELTA WEIGHTS

A. Attack specification

In this section, we further explore a more advanced attack afree rider may exploit, which is to add Gaussian noise onto thefake update matrix generated by delta weights attack presentedin Section V. A free rider may benefit from the Gaussian noiseaddition in the following two ways. First, we have mentionedin Section V-C that if multiple free riders all take the deltaweights generation approach, the detection would be trivialsince all such free riders have exactly the same weights. Asa result, a smart attacker may attempt to avoid this by addingrandom Gaussian noise onto its generated delta weights.Second, note that in previous section, we have demonstratedthat having lower STD than others is one important reasonleading to the detection of the free rider. Therefore, a free ridermay try to avoid detection by adding Gaussian noise with zeromean and a certain STD, such that the resulted gradient updatematrix has similar STD with other clients.

a) Advanced delta weights attack.: Following deltaweights generation in Section V, the advanced delta weightsattack takes a further step by adding Gaussian noise havingmean 0 and standard deviation σ to the delta weights. Specif-

5 10 15 20 25 30STD-DAGMM Energy

0

5

10

15

20

25

Num

ber o

f Clie

nt(s

)

free rider

(a) Round 5

5 10 15 20 25 30STD-DAGMM Energy

0

5

10

15

20

Num

ber o

f Clie

nt(s

)

free rider

(b) Round 80

(c) STD-DAGMM - detected attack in Figure 2

5 10 15 20 25STD-DAGMM Energy

0

5

10

15

Num

ber o

f Clie

nt(s

)

free rider

(d) Round 5

10 20 30STD-DAGMM Energy

0

5

10

15

20

25

Num

ber o

f Clie

nt(s

)

free rider

(e) Round 80

(f) STD-DAGMM - detected attack in Figure 3

10 15 20 25 30STD-DAGMM Energy

0

10

20

30Nu

mbe

r of C

lient

(s)

free rider

(g) Round 5

10 20 30 40 50STD-DAGMM Energy

0

5

10

15

20

25

30

Num

ber o

f Clie

nt(s

)

free rider

(h) Round 80

(i) STD-DAGMM - detected attack in Figure 4

Fig. 11: Similar local data distribution, random weights attack

ically, a fake gradient update is generated by

Gfi,j = η · 1

n

n∑x=1

Gx,j−1 +N(0, σ) (ref.Equation 2) (3)

B. Defense strategy

We find that our proposed STD-DAGMM approach contin-uously works well for this kind of attack.

C. Experimental validation

Intuitively, the effectiveness of the free rider detectionmethod would be affected by the choice of σ a free ridermay choose. Although it’s hard to guess the standard deviationof other normal clients’ gradient updates at each round, weassume that a strong attacker has previous knowledge of thetraining process so that he can submit weights with STDsimilar to benign clients’ weights in most of the rounds. In ourexperiments, we tried different standard deviation for Gaussiannoise, and find that σ = 10−3 is among the best choices forthe free rider. Specifically, as shown in Figure 12a, adding aGaussian noise N(0, 10−3) to the delta weights of two previousglobal models will result in a fake gradient update havingsimilar STD with other clients. Moreover, we show that thisattack indeed makes the free rider harder to be detected, as

Page 9: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

in Figure 12d. For DAGMM method, the energy value ofthe free rider is completely hidden among normal clients,for both round 5 and round 80. Nevertheless, our proposedSTD-DAGMM method is still effective in detecting this typeof advanced delta attack, as shown in Figure 12g, where theenergy value for free rider is the biggest, and a wide range ofthreshold values suffice to separate the free rider from otherclients.

0 5 20 40 60 80 100Round

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Valid

atio

n Ac

cura

cy

free rider

0.0002

0.0004

0.0006

0.0008

0.0010

0.0012

0.0014

0.0016

STD

(a) Standard deviation (STD) of the updates submitted by each client,with the change of training process

0 5 10 15 20DAGMM Energy

0

10

20

30

40

50

60

Num

ber o

f Clie

nt(s

)

free rider

(b) Round 5

5 10 15 20DAGMM Energy

0

10

20

30

40

50

60

Num

ber o

f Clie

nt(s

)

free rider

(c) Round 80

(d) DAGMM - not detected

5 10 15 20STD-DAGMM Energy

0.0

2.5

5.0

7.5

10.0

12.5

15.0

Num

ber o

f Clie

nt(s

)

free rider

(e) Round 5

5 10 15 20STD-DAGMM Energy

0

2

4

6

8

10

12

Num

ber o

f Clie

nt(s

)

free rider

(f) Round 80

(g) STD-DAGMM - detected

Fig. 12: Similar local data distribution, advanced delta weightsattach with σ = 10−3

VII. EXTENSION

In this section, we present some real-world settings anddiscuss how our proposed defense strategy would work undereach setting. In reality, many factors may affect the proposedattack and defense mechanisms. For example, the number offree riders in the federated learning participants is unknownto the parameter server. It would be interesting to explorehow STD-DAGMM method would work with more freeriders present. Recently, many privacy enhancing techniques

have been proposed [18], [19], [20], in order to address theincreasing privacy concern in federated learning and machinelearning models in general [21], [22], [23]. These methodssuch as differential privacy, which works by applying randomGaussian noise to the model parameters, would influence theeffectiveness of the proposed attack, and hence the detectionmechanism as well.

A. More free ridersThis section explores the effectiveness of our proposed

defense methods, in particular, STD-DAGMM, in the face ofmore free riders.

Without loss of generality, we first consider a total of 20 freeriders out of 100 clients, each of which explores the strongestattack presented earlier - advanced delta weights attack. Inparticular, each free rider first calculates a delta weights bysubtracting the global models in two previous rounds, andadds that with a Gaussian random noise N(0, σ) to make itsstandard deviation look similar to other normal clients. Forthe MNIST dataset we explore, we find that σ = 10−3 isamong the best choices in Section VI-C, which we adopthere. As shown in Figure 13a, the black lines are the 20free riders while the colored lines represent the benign clients.The higher variation in STD of free riders across the trainingrounds are due to the random noise sampled from a Gaussiandistribution. We present the detection results for DAGMM andSTD-DAGMM in Figure 13d and Figure 13g respectively. Weuse yellow bars to represent the histogram for free riders andblue bars for other normal clients. For the bins of energyvalues that are duplicated in the figures, we stack free riders’counts above normal ones. As in the figures, there is no singlethreshold that works to separate free riders and normal clientsentirely, either for DAGMM or STD-DAGMM. However, wecan observe that for STD-DAGMM, more free riders havelarger energy values, compared with the ones for DAGMM. Tocompare the performance more clearly, we compute the AUCscore, which is the area under the curve that plots the truepositive rate change with the false positive rate, with respectto different thresholds to separate abnormal/normal samples.The higher AUC score is, the clearer the separation is, andthe better the detection method. As the numbers shown undereach figure in Figure 13d and Figure 13g, STD-DAGMMworks better than DAGMM for both round 5 (beginning of thetraining iteration) and round 80 (end of the training iteration.).

In reality, the defense mechanism wouldn’t know if thereare free riders or how many free riders there are in thesystem. Therefore, we further conduct an experiment to testthe effectiveness of STD-GAGMM with varying ratios of freeriders. The AUC scores for DAGMM and STD-DAGMM withincreasing number of free riders are as shown in Figure 14.As one would imagine, as the ratio of free riders in thesystem becomes larger, it becomes more difficult for thedefense mechanism to detect the free riders, validated by thedecreasing curves in Figure 14. Nevertheless, STD-DAGMMoutperforms DAGMM regardless of free rider ratios.

We note that there is still room for improvement in order todetect all free riders without too many false positives, whichwe leave as our future work.

Page 10: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

0 5 20 40 60 80 100Round

0.2

0.4

0.6

0.8

Valid

atio

n Ac

cura

cy

0.00000

0.00025

0.00050

0.00075

0.00100

0.00125

0.00150

0.00175

STD

(a) Standard deviation (STD) of the updates submitted by each clientat different rounds

6 8 10 12 14DAGMM Energy

0

2

4

6

8

10

Num

ber o

f Clie

nt(s

) benign clientsfree riders

(b) Round 5 (AUC=0.8856)

10 15 20 25DAGMM Energy

0.0

2.5

5.0

7.5

10.0

12.5

15.0

Num

ber o

f Clie

nt(s

) benign clientsfree riders

(c) Round 80 (AUC=0.8487)

(d) DAGMM

5 10 15 20 25 30STD-DAGMM Energy

0

5

10

15

Num

ber o

f Clie

nt(s

) benign clientsfree riders

(e) Round 5 (AUC=0.9644)

5 10 15 20 25STD-DAGMM Energy

0

5

10

15

Num

ber o

f Clie

nt(s

) benign clientsfree riders

(f) Round 80 (AUC=0.9088)

(g) STD-DAGMM

Fig. 13: 20 free riders, similar local data distribution, advanceddelta weights attack with σ = 10−3

B. With differential privacy

The concept of differential privacy (DP) was proposed in[19] and later extended for deep learning in [24] and federatedlearning in [18]. In this section, we consider the proposedDP usage in federated learning setting [18], where each clientclips its local gradient updates with a clipping bound, and theparameter server adds DP noise to the aggregated model, toform the new global model. Although the clipping mechanismeach client applies could potentially render local updates notthat different with other clients, we find that for federatedlearning, another mechanism called privacy amplification in-fluences the defense mechanism the most, and could in factfavor the detection.

The idea of privacy amplification is: in each round, insteadof all clients participating in the training process, each clientchooses whether to join with a ratio q. Remember that the goalof differential privacy is to hide the participance of each local

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9Ratio of Free Riders

0.2

0.4

0.6

0.8

1.0

AUC

Scor

e

DAGMMSTD-DAGMM

(a) Round 5

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9Ratio of Free Riders

0.2

0.4

0.6

0.8

AUC

Scor

e

DAGMMSTD-DAGMM

(b) Round 80

Fig. 14: AUC scores of different detection methods withvarying ratios of free riders, 100 clients in total, similar localdata distribution, advanced delta weights attack with σ = 10−3

client. If some adversary has to guess if a client joins a roundof training, the probability he guesses it right degrades by qunder privacy amplification, which helps privacy. With this, afree rider will only join the model training every 1/q rounds,and receive the global model when it’s his turn. If a free riderwere to launch delta weights attack in this case, he could onlysubtract two previously received global model weights, andpossibly divide that by the number 1/q, to approximate otherclients’ updates. In this case, the constructed free rider updateby delta weights attack is more different than other clients’normal submissions, compared with the case where the deltaweights are calculated by subtracting two adjacent previousrounds’ global models. Thus the delta weights attack is easierto detect.

For this experiment, we assume there are 20 free riders andthey randomly join a training round with other clients. Fordetection, we deliberately skip the first several rounds to makesure that free riders have accumulated enough knowledge(two global models) to generate a delta weight update. Weperform the detection at round 20, 40, 60, and 80 respectively,Figure 15a shows that the STD of free riders (marked as

Page 11: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

crosses) are much higher than that of normal clients (markedas dots), and thus should be easier to be detected. Since freeriders’ updates are an aggregation of small gradient updatesduring q rounds, it should be larger than benign clients’gradient updates in magnitude and standard deviation as well.As shown in Figure 15d and 15g, both DAGMM and STD-DAGMM are able to detect all free riders.

0 10 20 30 40 50 60 70 80 90 100Client ID

0.0

0.2

0.4

0.6

0.8

1.0

STD

round 20round 40round 60round 80

(a) Standard deviation (STD) of the updates submitted by each clientat different rounds

4.5 4.0 3.5 3.0 2.5 2.0DAGMM Energy

0

1

2

3

4

5

Num

ber o

f Clie

nt(s

) benign clientsfree riders

(b) Round 40

8 7 6 5 4 3DAGMM Energy

0

2

4

6

Num

ber o

f Clie

nt(s

) benign clientsfree riders

(c) Round 80

(d) DAGMM - detected

3.5 3.0 2.5 2.0 1.5STD-DAGMM Energy

0

1

2

3

4

5

Num

ber o

f Clie

nt(s

) benign clientsfree riders

(e) Round 40

7 6 5 4 3 2STD-DAGMM Energy

0

1

2

3

4

5

6

Num

ber o

f Clie

nt(s

) benign clientsfree riders

(f) Round 80

(g) STD-DAGMM - detected

Fig. 15: With differential privacy, similar local data distribu-tion, delta weights attack, 20 free riders

VIII. LIMITATION

Currently, MNIST dataset and a two-layer fully-connectedmodel are used in all of our experiments. Although our attackand detection methods do not depend on the actual trainingdata and model architecture, we admit that there are a largevariety of datasets and models that may be used under theframework of federated learning. We leave it as future workto exploit the performance of different attack and defensemethods on other datasets and models, e.g., advanced language

models on natural language datasets. Moreover, recent papershave proposed new paradigms for federated learning, forexample, secure aggregation, which may affect the attackand defense strategies proposed here. For example, in secureaggregation where the central parameter server cannot see theupdated matrices of the clients in plain texts, free rider attackdetection could be challenging. More research work could bedone targeting different federated learning solutions.

IX. RELATED WORK

Since proposed in [1], federated learning has attracted manyresearch to make it more practical and more robust in realworld usages. Some of the schemes proposed for federatedlearning could potentially affect a free rider’s weights genera-tion strategy, or the effectiveness of the detection mechanism.

There have been many previous work proposed to enhancefederated learning, e.g., to make it more communicationefficient [25], [26], or privacy-preserving [18], [27]. Thecommunication cost in federated learning could be reducedby reducing the size of updates, in ways such as cutting downdecimal digits in each value of the model update [25], [26].This mechanism could potentially cause free riders easier todeceive since there are fewer digits to manipulate. To addressthe privacy concerns [28], [29], client-level differential privacy[18] is proposed to prevent leaking local clients’ privatedata from global model parameters, and a secure aggregationmechanism is proposed for federated learning in [27]. Forexample, if secure aggregation [27] is applied, where theparameter server is not supposed to view locally submittedmodel parameters, advances in cryptographic fields might berequired to address the free rider attack problem.

Although the concept of free rider attack has not beenexplored in previous work, there have been related workon other attacks and defenses targeting federated learningdomain. For starters, [30] proposes a method to defend againstpoisoning attacks in federated learning, through clustering thelocal clients’ updates and treating the majority as normal.This detection does not work for the delta weights attack inour setting because the attacker submitted updates are similarto those of normal clients. Another type of backdoor attackis proposed in [31], where the attacker submits constructedlarge weights to overwrite the global model’s parameter, suchthat it predicts a certain label for some images with specialpatterns. They find that client-level DP [32] could degradethe effectiveness of such attack. Also, we note that ourSTD-DAGMM method is potentially effective since an attackconstructed this way would have much larger STD than othernormal clients. Poisoning attacks for federated learning arefurther explored in [33], where the adversarial objective isto cause the model to mis-classify chosen inputs with highconfidence. While no defense mechanisms are presented inthe paper, and it will be interesting to explore whether ourSTD-DAGMM method could defend against the proposedattacks. [34] explores sybil-based label-flipping and backdoorpoisoning attacks in federated learning, and proposes to usecosine similarity as a detection metric to adjust the weight foreach client update. However, such defense wouldn’t work for

Page 12: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

our delta weights attack, since free riders’ gradient updateswould not show a big difference with other clients in terms ofangles in weight updates.

X. CONCLUSION

In this paper, we present a potential problem in federatedlearning, that a client having no local data may constructa local gradient update, in order for rewards. We studydifferent attacks an attacker may take, and possible detectionmechanisms against such attacks. In particular, we propose anovel detection scheme: STD-DAGMM, that is effective indetecting most of the free riders in most explored settings.Further, we find that differential privacy, particularly theprivacy amplification mechanism in federated learning, favorsthe detection of free riders. For future work, the proposedSTD-DAGMM method shows its effectiveness in anomalydetection for model weights, so studying its effectiveness indetecting other attacks for federated learning, e.g., poisoningattacks, is one interesting direction to pursue. Finally, we notethat there are much more to investigate in the field of freerider attacks and defenses, especially with constantly proposedfederated learning enhancing strategies. We believe our initialexploration may shed light on future work in this area.

REFERENCES

[1] H. B. McMahan, E. Moore, D. Ramage, and B. A. y Arcas,“Federated learning of deep networks using model averaging,” CoRR,vol. abs/1602.05629, 2016. [Online]. Available: http://arxiv.org/abs/1602.05629

[2] J. Konecny, H. B. McMahan, D. Ramage, and P. Richtarik,“Federated optimization: Distributed machine learning for on-deviceintelligence,” CoRR, vol. abs/1610.02527, 2016. [Online]. Available:http://arxiv.org/abs/1610.02527

[3] R. Shokri and V. Shmatikov, “Privacy-preserving deep learning,” in2015 53rd Annual Allerton Conference on Communication, Control, andComputing (Allerton), Sep. 2015, pp. 909–910.

[4] A. Hard, K. Rao, R. Mathews, F. Beaufays, S. Augenstein, H. Eichner,C. Kiddon, and D. Ramage, “Federated learning for mobile keyboardprediction,” CoRR, vol. abs/1811.03604, 2018. [Online]. Available:http://arxiv.org/abs/1811.03604

[5] Y. Zhao, J. Zhao, L. Jiang, R. Tan, and D. Niyato, “Mobile Edge Com-puting, Blockchain and Reputation-based Crowdsourcing IoT FederatedLearning: A Secure, Decentralized and Privacy-preserving System,”arXiv e-prints, p. arXiv:1906.10893, Jun 2019.

[6] T. Brisimi, R. Chen, T. Mela, A. Olshevsky, I. Paschalidis, and W. Shi,“Federated learning of predictive models from federated electronichealth records,” International Journal of Medical Informatics, vol. 112,01 2018.

[7] J.-S. Weng, J. Weng, M. Li, Y. Zhang, and W. Luo, “Deepchain:Auditable and privacy-preserving deep learning with blockchain-basedincentive,” IACR Cryptology ePrint Archive, vol. 2018, p. 679, 2018.

[8] W. J. Baumol, Welfare Economics and the Theory of the State. Boston,MA: Springer US, 2004, pp. 937–940.

[9] T. Locher, P. Moore, S. Schmid, and R. Wattenhofer, “Free ridingin bittorrent is cheap,” in 5th Workshop on Hot Topics in Networks(HotNets), 2006. [Online]. Available: http://eprints.cs.univie.ac.at/5696/

[10] M. Feldman and J. Chuang, “Overcoming free-riding behavior inpeer-to-peer systems,” SIGecom Exch., vol. 5, no. 4, pp. 41–50, Jul.2005. [Online]. Available: http://doi.acm.org/10.1145/1120717.1120723

[11] M. Feldman, C. Papadimitriou, J. Chuang, and I. Stoica, “Free-ridingand whitewashing in peer-to-peer systems,” IEEE Journal on SelectedAreas in Communications, vol. 24, no. 5, pp. 1010–1019, May 2006.

[12] Y. Le Cun, “Learning process in an asymmetric threshold network,” inDisordered Systems and Biological Organization, E. Bienenstock, F. F.Soulie, and G. Weisbuch, Eds. Berlin, Heidelberg: Springer BerlinHeidelberg, 1986, pp. 233–240.

[13] H. Bourlard and Y. Kamp, “Auto-association by multilayer perceptronsand singular value decomposition,” Biological Cybernetics, vol. 59,no. 4, pp. 291–294, Sep 1988. [Online]. Available: https://doi.org/10.1007/BF00332918

[14] B. Zong, Q. Song, M. R. Min, W. Cheng, C. Lumezanu,D. Cho, and H. Chen, “Deep autoencoding gaussian mixture modelfor unsupervised anomaly detection,” in International Conferenceon Learning Representations, 2018. [Online]. Available: https://openreview.net/forum?id=BJJLHbb0-

[15] M. Sakurada and T. Yairi, “Anomaly detection using autoencoders withnonlinear dimensionality reduction,” in Proceedings of the MLSDA2014 2Nd Workshop on Machine Learning for Sensory Data Analysis,ser. MLSDA’14. New York, NY, USA: ACM, 2014, pp. 4:4–4:11.[Online]. Available: http://doi.acm.org/10.1145/2689746.2689747

[16] A. Borghesi, A. Bartolini, M. Lombardi, M. Milano, and L. Benini,“Anomaly detection using autoencoders in high performance computingsystems,” CoRR, vol. abs/1811.05269, 2018. [Online]. Available:http://arxiv.org/abs/1811.05269

[17] L. Deng, “The mnist database of handwritten digit images for machinelearning research [best of the web],” IEEE Signal Processing Magazine,vol. 29, no. 6, pp. 141–142, 2012.

[18] R. C. Geyer, T. Klein, and M. Nabi, “Differentially private federatedlearning: A client level perspective,” CoRR, vol. abs/1712.07557, 2017.[Online]. Available: http://arxiv.org/abs/1712.07557

[19] C. Dwork, “Differential privacy,” in 33rd International Colloquium onAutomata, Languages and Programming, part II (ICALP 2006), ser.Lecture Notes in Computer Science, vol. 4052. Springer Verlag, July2006, pp. 1–12. [Online]. Available: https://www.microsoft.com/en-us/research/publication/differential-privacy/

[20] K. Bonawitz, V. Ivanov, B. Kreuter, A. Marcedone, H. B. McMahan,S. Patel, D. Ramage, A. Segal, and K. Seth, “Practical secure aggregationfor federated learning on user-held data,” CoRR, vol. abs/1611.04482,2016. [Online]. Available: http://arxiv.org/abs/1611.04482

[21] H. Bae, J. Jang, D. Jung, H. Jang, H. Ha, and S. Yoon, “Security andprivacy issues in deep learning,” CoRR, vol. abs/1807.11655, 2018.[Online]. Available: http://arxiv.org/abs/1807.11655

[22] N. Papernot, P. D. McDaniel, A. Sinha, and M. P. Wellman, “Towardsthe science of security and privacy in machine learning,” CoRR, vol.abs/1611.03814, 2016. [Online]. Available: http://arxiv.org/abs/1611.03814

[23] C. Fung, J. Koerner, S. Grant, and I. Beschastnikh, “Dancingin the dark: Private multi-party machine learning in an untrustedsetting,” CoRR, vol. abs/1811.09712, 2018. [Online]. Available:http://arxiv.org/abs/1811.09712

[24] M. Abadi, A. Chu, I. Goodfellow, B. McMahan, I. Mironov, K. Talwar,and L. Zhang, “Deep learning with differential privacy,” in 23rd ACMConference on Computer and Communications Security (ACM CCS),2016, pp. 308–318. [Online]. Available: https://arxiv.org/abs/1607.00133

[25] J. Konecny, H. B. McMahan, F. X. Yu, P. Richtarik, A. T.Suresh, and D. Bacon, “Federated learning: Strategies for improvingcommunication efficiency,” CoRR, vol. abs/1610.05492, 2016. [Online].Available: http://arxiv.org/abs/1610.05492

[26] Y. Chen, X. Sun, and Y. Jin, “Communication-efficient federated deeplearning with asynchronous model update and temporally weightedaggregation,” arXiv preprint arXiv:1903.07424, 2019.

[27] K. Bonawitz, V. Ivanov, B. Kreuter, A. Marcedone, H. B. McMahan,S. Patel, D. Ramage, A. Segal, and K. Seth, “Practical secure aggregationfor privacy-preserving machine learning,” in Proceedings of the 2017ACM SIGSAC Conference on Computer and Communications Security,ser. CCS ’17. New York, NY, USA: ACM, 2017, pp. 1175–1191.[Online]. Available: http://doi.acm.org/10.1145/3133956.3133982

[28] B. Hitaj, G. Ateniese, and F. Perez-Cruz, “Deep models under theGAN: information leakage from collaborative deep learning,” CoRR,vol. abs/1702.07464, 2017. [Online]. Available: http://arxiv.org/abs/1702.07464

[29] Z. Wang, M. Song, Z. Zhang, Y. Song, Q. Wang, and H. Qi,“Beyond inferring class representatives: User-level privacy leakagefrom federated learning,” CoRR, vol. abs/1812.00535, 2018. [Online].Available: http://arxiv.org/abs/1812.00535

[30] S. Shen, S. Tople, and P. Saxena, “Auror: Defending against poisoningattacks in collaborative deep learning systems,” in Proceedings ofthe 32Nd Annual Conference on Computer Security Applications, ser.ACSAC ’16. New York, NY, USA: ACM, 2016, pp. 508–519.[Online]. Available: http://doi.acm.org/10.1145/2991079.2991125

[31] E. Bagdasaryan, A. Veit, Y. Hua, D. Estrin, and V. Shmatikov, “Howto backdoor federated learning,” CoRR, vol. abs/1807.00459, 2018.[Online]. Available: http://arxiv.org/abs/1807.00459

Page 13: Free-riders in Federated Learning: Attacks and Defenses · protect privacy since all data stay local. As a result, federated learning has attracted much attention and is being widely

[32] H. B. McMahan, D. Ramage, K. Talwar, and L. Zhang, “Learningdifferentially private language models without losing accuracy,” CoRR,vol. abs/1710.06963, 2017. [Online]. Available: http://arxiv.org/abs/1710.06963

[33] A. N. Bhagoji, S. Chakraborty, P. Mittal, and S. B. Calo,“Analyzing federated learning through an adversarial lens,” CoRR, vol.abs/1811.12470, 2018. [Online]. Available: http://arxiv.org/abs/1811.12470

[34] C. Fung, C. J. M. Yoon, and I. Beschastnikh, “Mitigating sybilsin federated learning poisoning,” CoRR, vol. abs/1808.04866, 2018.[Online]. Available: http://arxiv.org/abs/1808.04866

Jierui Lin is a fourth-year undergraduate studyingComputer Science and Applied Mathematics at UCBerkeley. His research interests include computervision, robotics and machine learning security.

Min Du received the PhD degree from the School ofComputing, University of Utah in 2018, as well asthe bachelors degree and the master’s degree fromBeihang University. She is currently a Postdoctoralscholar in EECS department, UC Berkeley. Herresearch interests include big data analytics andmachine learning security.

Jian Liu has been a postdoctoral researcher sinceJuly 2018, at Department of Electrical Engineeringand Computer Sciences , UC Berkeley, working withProf. Dawn Song. Before joining UC Berkeley, hewas a PhD candidate since the fall of 2014, at theSecure Systems Group, Department of ComputerScience, Aalto University, working with Prof. N.Asokan. His research is on Applied Cryptographyand Blockchains. He is interested in building real-world systems that are provably secure, easy to useand inexpensive to deploy.