Differentially Private Federated Learning: A Client Level Perspective

1 INTRODUCTION . Lately , the topic of security in machine learning is enjoying increased interest . This can be largely attributed to the success of big data in conjunction with deep learning and the urge for creating and processing ever larger data sets for data mining . However , with the emergence of more and more machine learning services becoming part of our daily lives , making use of our data , special measures must be taken to protect privacy . Unfortunately , anonymization alone often is not sufficient Narayanan & Shmatikov ( 2008 ) ; Backstrom et al . ( 2007 ) and standard machine learning approaches largely disregard privacy aspects and are susceptible to a variety of adversarial attacks Melis et al . ( 2018 ) . In this regard , machine learning can be analyzed to recover private information about the participating user or employed data as well Oh et al . ( 2018 ) ; Shokri et al . ( 2017 ) ; Dang et al . ( 2017 ) ; Fredrikson et al . ( 2015 ) . Carlini et al . ( 2018 ) propose a measure for to assess the memorization of privacy related data . All the aspects of privacy-preserving machine learning are aggravated when further restrictions apply such as a limited number of participating clients or restricted communication bandwidth such as mobile devices Google ( 2017 ) . In order to alleviate the need of explicitly sharing data for training machine learning models , decentralized approaches have been proposed , sometimes referred to as collaborative Shokri & Shmatikov ( 2015 ) or federated learning McMahan et al . ( 2017 ) . In federated learning McMahan et al . ( 2017 ) a model is learned by multiple clients in decentralized fashion . Learning is shifted to the clients and only learned parameters are centralized by a trusted curator . This curator then distributes an aggregated model back to the clients . However , this alone is not sufficent to preserve privacy . In Orekondy et al . ( 2018 ) it is shown that clients be identified in a federated learning setting by the model updates alone , necessitating further steps . Clients not revealing their data is an advance in privacy protection . However , when a model is learned in conventional way , its parameters reveal information about the data that was used during training . In order to solve this issue , the concept of differential privacy ( dp ) Dwork ( 2006 ) for learning algorithms was proposed by Abadi et al . ( 2016 ) . The aim is to ensure a learned model does not reveal whether a certain data point was used during training . We propose an algorithm that incorporates a dp-preserving mechanism into federated learning . However , opposed to Abadi et al . ( 2016 ) we do not aim at protecting w.r.t . a single data point only . Rather , we want to ensure that a learned model does not reveal whether a client participated during decentralized training . This implies a client ’ s whole data set is protected against differential attacks from other clients . Our main contributions : First , we show that a client ’ s participation can be hidden while model performance is kept high in federated learning . We demonstrate that our proposed algorithm can achieve client level differential privacy at a minor loss in model performance . An independent study McMahan et al . ( 2018 ) , published at the same time , proposed a similar procedure for client level-dp . Experimental setups however differ and McMahan et al . ( 2018 ) also includes elementlevel privacy measures . Second , we propose to dynamically adapt the dp-preserving mechanism during decentralized training . Empirical studies suggest that model performance is increased that way . This stands in contrast to latest advances in centralized training with differential privacy , were such adaptation was not beneficial . We can link this discrepancy to the fact that , compared to centralized learning , gradients in federated learning exhibit different sensibilities to noise and batch size throughout the course of training . 2 BACKGROUND . 2.1 FEDERATED LEARNING . In federated learning McMahan et al . ( 2017 ) , communication between curator and clients might be limited ( e.g . mobile phones ) and/or vulnerable to interception . The challenge of federated optimization is to learn a model with minimal information overhead between clients and curator . In addition , clients ’ data might be non-IID , unbalanced and massively distributed . The algorithm ’ federated averaging ’ recently proposed by McMahan et al . ( 2017 ) , tackles these challenges . During multiple rounds of communication between curator and clients , a central model is trained . At each communication round , the curator distributes the current central model to a fraction of clients . The clients then perform local optimization . To minimize communication , clients might take several steps of mini-batch gradient descent during a single communication round . Next , the optimized models are sent back to the curator , who aggregates them ( e.g . averaging ) to allocate a new central model . Depending on the performance of the new central model , training is either stopped or a new communication round starts . In federated learning , clients never share data , only model parameters . 2.2 LEARNING WITH DIFFERENTIAL PRIVACY . A lot of research has been conducted in protecting differential privacy on data level when a model is learned in a centralized manner . This can be done by incorporating a dp-preserving randomized mechanism ( e.g . the Gaussian mechanism ) into the learning process . We use the same definition for differential privacy in randomized mechanisms as Abadi et al . ( 2016 ) : A randomized mechanism M : D → R , with domain D and range R satisfies ( , δ ) -differential privacy , if for any two adjacent inputs d , d′ ∈ D and for any subset of outputs S ⊆ R it holds that P [ M ( d ) ∈ S ] ≤ e Pr [ M ( d′ ) ∈ S ] + δ . In this definition , δ accounts for the probability that plain -differential privacy is broken . The Gaussian mechanism ( GM ) approximates a real valued function f : D → R with a differentially private mechanism . Specifically , a GM adds Gaussian noise calibrated to the functions data set sensitivity Sf . This sensitivity is defined as the maximum of the absolute distance ‖f ( d ) − f ( d′ ) ‖2 , where d′ and d are two adjacent inputs . A GM is then defined as M ( d ) = f ( d ) +N ( 0 , σ2S2f ) . In the following we assume that σ and are fixed and evaluate an inquiry to the GM about a single approximation of f ( d ) . We can then bound the probability that -dp is broken according to : δ ≤ 54exp ( − ( σ ) 2/2 ) ( Theorem 3.22 in Dwork & Roth ( 2014 ) ) . It should be noted that δ is accumulative and grows if the consecutive inquiries to the GM . Therefore , to protect privacy , an accountant keeps track of δ . Once a certain threshold for δ is reached , the GM shall not answer any new inquires . Recently , Abadi et al . ( 2016 ) proposed a differentially private stochastic gradient descent algorithm ( dp-SGD ) . dp-SGD works similar to mini-batch gradient descent but the gradient averaging step is approximated by a GM . In addition , the mini-batches are allocated through random sampling of the data . For being fixed , a privacy accountant keeps track of δ and stops training once a threshold is reached . Intuitively , this means training is stopped once the probability that the learned model reveals whether a certain data point is part of the training set exceeds a certain threshold . 2.3 CLIENT-SIDED DIFFERENTIAL PRIVACY IN FEDERATED OPTIMIZATION . We propose to incorporate a randomized mechanism into federated learning . However , opposed to Abadi et al . ( 2016 ) we do not aim at protecting a single data point ’ s contribution in learning a model . Instead , we aim at protecting a whole client ’ s data set . That is , we want to ensure that a learned model does not reveal whether a client participated during decentralized training while maintaining high model performance . 3 PROPOSED METHOD . In the framework of federated optimization McMahan et al . ( 2017 ) , the central curator averages client models ( i.e . weight matrices ) after each communication round . In our proposed algorithm , we will alter and approximate this averaging with a randomized mechanism . This is done to hide a single client ’ s contribution within the aggregation and thus within the entire decentralized learning procedure . The randomized mechanism we use to approximate the average consists of : • Random sub-sampling ( step 1 in Fig . 1 ) : Let K be the total number of clients . In each communication round a random subset Zt of size mt ≤ K is sampled . The curator then distributes the central model wt to only these clients . The central model is optimized by the clients ’ on their data . The clients in Zt now hold distinct local models { wk } mtk=0 . The difference between the optimized local model and the central model will be referred to as client k ’ s update ∆wk = wk − wt . The updates are sent back to the central curator at the end of each communication round . • Distorting ( step 3 and 4 in Fig . 1 ) : A Gaussian mechanism is used to distort the sum of all updates . This requires knowledge about the set ’ s sensitivity with respect to the summing operation . We can enforce a certain sensitivity by using scaled versions instead of the true updates : 4w̄k = 4wk/max ( 1 , ‖4w k‖2 S ) . Scaling ensures that the second norm is limited ∀k , ‖4w̄k‖2 < S. The sensitivity of the scaled updates with respect to the summing operation is thus upper bounded by S. The GM now adds noise ( scaled to sensitivity S ) to the sum of all scaled updates . Dividing the GM ’ s output by mt yields an approximation to the true average of all client ’ s updates , while preventing leakage of crucial information about an individual . A new central model wt+1 is allocated by adding this approximation to the current central model wt . wt+1 = wt + 1 mt ( Sum of updates clipped at S︷ ︸︸ ︷mt∑ k=0 4wk/max ( 1 , ‖4w k‖2 S ) + Noise scaled to S︷ ︸︸ ︷ N ( 0 , σ2S2 ) ︸ ︷︷ ︸ Gaussian mechanism approximating sum of updates ) When factorizing 1/mt into the Gaussian mechanism , we notice that the average ’ s distortion is governed by the noise variance S2σ2/m . However , this distortion should not exceed a certain limit . Otherwise too much information from the sub-sampled average is destroyed by the added noise and there will not be any learning progress . GM and random sub-sampling are both randomized mechanisms . ( Indeed , Abadi et al . ( 2016 ) used exactly this kind of average approximation in dp-SGD . However , there it is used for gradient averaging , hiding a single data point ’ s gradient at every iteration ) . Thus , σ and m also define the privacy loss incurred when the randomized mechanism provides an average approximation . In order to keep track of this privacy loss , we make use of the moments accountant as proposed by Abadi et al . Abadi et al . ( 2016 ) . This accounting method provides much tighter bounds on the incurred privacy loss than the standard composition theorem ( 3.14 in Dwork & Roth ( 2014 ) ) . Each time the curator allocates a new model , the accountant evaluates δ given , σ and m. Training shall be stopped once δ reaches a certain threshold , i.e . the likelihood , that a clients contribution is revealed gets too high . The choice of a threshold for δ depends on the total amount of clients K. To ascertain that privacy for many is not preserved at the expense of revealing total information about a few , we have to ensure that δ 1K , refer to Dwork & Roth ( 2014 ) chapter 2.3 for more details . Choosing S : When clipping the contributions , there is a trade-off . On the one hand , S should be chosen small such that the noise variance stays small . On the other hand , one wants to maintain as much of the original contributions as possible . Following a procedure proposed by Abadi et al . ( 2016 ) , in each communication round we calculate the median norm of all unclipped contributions and use this as the clipping bound S = median { 4wk } k∈Zt . We do not use a randomized mechanism for computing the median , which , strictly speaking , is a violation of privacy . However , the information leakage through the median is small ( Future work will contain such a privacy measure ) . Choosing σ and m : for fixed S , the ratio r = σ2/m governs distortion and privacy loss . It follows that the higher σ and the lower m , the higher the privacy loss . The privacy accountant tells us that for fixed r = σ2/m , i.e . for the same level of distortion , privacy loss is smaller for σ and m both being small . An upper bound on the distortion rate r and a lower bound on the number of sub-sampled clients m̄ would thus lead to a choice of σ . A lower bound on m is , however , hard to estimate . That is , because data in federated settings is non-IID and contributions from clients might be very distinct . We therefore define the between clients variance Vc as a measure of similarity between clients ’ updates . Definition . Let4wi , j define the ( i , j ) -th parameter in an update of the form4w ∈ Rq×p , at some communication round t. For the sake of clarity , we will drop specific indexing of communication rounds for now . The variance of parameter ( i , j ) throughout all K clients is defined as , VAR [ 4wi , j ] = 1 K K∑ k=0 ( 4wki , j − µi , j ) 2 , where µi , j = 1K ∑K k=14wki , j . We then define Vc as the sum over all parameter variances in the update matrix as , Vc = 1 q × p q∑ i=0 p∑ j=0 VAR [ 4wi , j ] . Further , the Update scale Us is defined as , Us = 1 q × p q∑ i=0 p∑ j=0 µ2i , j . Algorithm 1 Client-side differentially private federated optimization . K is the number of participating clients ; B is the local mini-batch size , E the number of local epochs , η is the learning rate , { σ } Tt=0 is the set of variances for the GM . { mt } Tt=0 determines the number of participating clients at each communication round . defines the dp we aim for . Q is the threshold for δ , the probability that -dp is broken . T is the number of communication rounds after which δ surpasses Q . B is a set holding client ’ s data sliced into batches of size B 1 : procedure SERVER EXECUTION 2 : Initialize : w0 , Accountant ( , K ) . initialize weights and the priv . accountant 3 : for each round t = 1 , 2 , ... do 4 : δ ← Accountant ( mt , σt ) . Accountant returns priv . loss for current round 5 : if δ > Q then return wt . If privacy budget is spent , return current model 6 : Zt ← random set of mt clients . randomly allocate a set of mt out of K clients 7 : for each client k ∈ Zt in parallel do 8 : 4wkt+1 , ζk ← ClientUpdate ( k , wt ) . client k ’ s update and the update ’ s norm 9 : S = median { ζk } k∈Zt . median of norms of clients ’ update 10 : wt+1 ← wt + 1m ( ∑K k=14wkt+1/max ( 1 , ζ k S ) +N ( 0 , S2 · σ2 ) ) . Update central model 11 : function CLIENTUPDATE ( k , wt ) 12 : w ← wt 13 : for each local Epoch i = 1 , 2 , ... E do 14 : for batch b ∈ B do 15 : w ← w − η∇L ( w ; b ) . mini batch gradient descent 16 : 4wt+1 = w − wt . clients local model update 17 : ζ = ‖4wt+1‖2 . norm of update 18 : return4wt+1 , ζ . return clipped update and norm of update

Summary: The main claim the authors make is that providing privacy in learning should go beyond just privacy for individual records to providing privacy for data contributors which could be an entire hospital. Adding privacy by design to the machine learning pipe-line is an important topic. Unfortunately, the presentation of this paper makes it hard to follow.