Title: FEDERATED ADVERSARIAL DOMAIN ADAPTATION

Abstract: Federated learning improves data privacy and efficiency in machine learning performed over networks of distributed devices, such as mobile phones, IoT and wearable devices, etc. Yet models trained with federated learning can still fail to generalize to new devices due to the problem of domain shift. Domain shift occurs when the labeled data collected by source nodes statistically differs from the target node's unlabeled data. In this work, we present a principled approach to the problem of federated domain adaptation, which aims to align the representations learned among the different nodes with the data distribution of the target node. Our approach extends adversarial adaptation techniques to the constraints of the federated setting. In addition, we devise a dynamic attention mechanism and leverage feature disentanglement to enhance knowledge transfer. Empirically, we perform extensive experiments on several image and text classification tasks and show promising results under unsupervised federated domain adaptation setting.

1. INTRODUCTION:

Data generated by networks of mobile and IoT devices poses unique challenges for training machine learning models. Due to the growing storage/computational power of these devices and concerns about data privacy, it is increasingly attractive to keep data and computation locally on the device (Smith et al., 2017) . Federated Learning (FL) (Mohassel & Rindal, 2018; Bonawitz et al., 2017; Mohassel & Zhang, 2017) provides a privacy-preserving mechanism to leverage such decen-tralized data and computation resources to train machine learning models. The main idea behind federated learning is to have each node learn on its own local data and not share either the data or the model parameters.

While federated learning promises better privacy and efficiency, existing methods ignore the fact that the data on each node are collected in a non-i.i.d manner, leading to domain shift between nodes (Quionero-Candela et al., 2009) . For example, one device may take photos mostly indoors, while another mostly outdoors. In this paper, we address the problem of transferring knowledge from the decentralized nodes to a new node with a different data domain, without requiring any additional supervision from the user. We define this novel problem Unsupervised Federated Domain Adaptation (UFDA), as illustrated in Figure 1(a) .

There is a large body of existing work on unsupervised domain adaptation (Long et al., 2015; Ganin & Lempitsky, 2015; Tzeng et al., 2017; Zhu et al., 2017; Gong et al., 2012; Long et al., 2018) , but the federated setting presents several additional challenges. First, the data are stored locally and cannot be shared, which hampers mainstream domain adaptation methods as they need to access both the labeled source and unlabeled target data (Tzeng et al., 2014; Long et al., 2017; Ghifary et al., 2016; Sun & Saenko, 2016; Ganin & Lempitsky, 2015; Tzeng et al., 2017) . Second, the model parameters are trained separately for each node and converge at different speeds, while also offering different contributions to the target node depending on how close the two domains are. Finally, the knowledge learned from source nodes is highly entangled (Bengio et al., 2013) , which can possibly lead to negative transfer (Pan & Yang, 2010) .

In this paper, we propose a solution to the above problems called Federated Adversarial Domain Adaptation (FADA) which aims to tackle domain shift in a federated learning system through adversarial techniques. Our approach preserves data privacy by training one model per source node and updating the target model with the aggregation of source gradients, but does so in a way that reduces domain shift. First, we analyze the federated domain adaptation problem from a theoretical perspective and provide a generalization bound. Inspired by our theoretical results, we propose an efficient adaptation algorithm based on adversarial adaptation and representation disentanglement applied to the federated setting. We also devise a dynamic attention model to cope with the varying convergence rates in the federated learning system. We conduct extensive experiments on real-world datasets, including image recognition and natural language tasks. Compared to baseline methods, we improve adaptation performance on all tasks, demonstrating the effectiveness of our devised model.

2. RELATED WORK:

Unsupervised Domain Adaptation Unsupervised Domain Adaptation (UDA) aims to transfer the knowledge learned from a labeled source domain to an unlabeled target domain. Domain adaptation approaches proposed over the past decade include discrepancy-based methods (Tzeng et al., 2014; Long et al., 2017; Ghifary et al., 2014; Sun & Saenko, 2016; Peng & Saenko, 2018) , reconstructionbased UDA models (Yi et al., 2017; Zhu et al., 2017; Hoffman et al., 2018; Kim et al., 2017) , and adversary-based approaches (Liu & Tuzel, 2016; Tzeng et al., 2017; Liu et al., 2018a; Ganin & Lempitsky, 2015) . For example, Ganin & Lempitsky (2015) propose a gradient reversal layer to perform adversarial training to a domain discriminator, inspired by the idea of adversarial learning. Tzeng et al. (2017) address unsupervised domain adaptation by adapting a deep CNN-based feature extractor/classifier across source and target domains via adversarial training. Ben-David et al. (2010) introduce an H∆H-divergence to evaluate the domain shift and provide a generalization error bound for domain adaptation. These methods assume the data are centralized on one server, limiting their applicability to the distributed learning system. Federated Learning Federated learning (Mohassel & Rindal, 2018; Rivest et al., 1978; Bonawitz et al., 2017; Mohassel & Zhang, 2017 ) is a decentralized learning approach which enables multiple clients to collaboratively learn a machine learning model while keeping the training data and model parameters on local devices. Inspired by Homomorphic Encryption (Rivest et al., 1978) , Gilad-Bachrach et al. (2016) propose CryptoNets to enhance the efficiency of data encryption, achieving higher federated learning performance. Bonawitz et al. (2017) introduce a secure aggregation scheme to update the machine learning models under their federated learning framework. Recently, Mohassel & Zhang (2017) propose SecureML to support privacy-preserving collaborative training in a multiclient federated learning system. However, these methods mainly aim to learn a single global model across the data and have no convergence guarantee, which limits their ability to deal with non-i.i.d. data. To address the non-i.i.d data, Smith et al. (2017) introduce federated multi-task learning, which learns a separate model for each node. Liu et al. (2018b) propose semi-supervised federated transfer learning in a privacy-preserving setting. However, their models involve full or semi-supervision. The work proposed here is, to our best knowledge, the first federated learning framework to consider unsupervised domain adaptation.

Feature Disentanglement Deep neural networks are known to extract features where multiple hidden factors are highly entangled. Learning disentangled representations can help remove irrelevant and domain-specific features and model only the relevant factors of data variation. To this end, recent work (Mathieu et al., 2016; Makhzani et al., 2016; Liu et al., 2018a; Odena et al., 2017) explores the learning of interpretable representations using generative adversarial networks (GANs) (Goodfellow et al., 2014) and variational autoencoders (VAEs) (Kingma & Welling, 2013) . Under the fully supervised setting, (Odena et al., 2017) propose an auxiliary classifier GAN (AC-GAN) to achieve representation disentanglement. (Liu et al., 2018a) introduce a unified feature disentanglement framework to learn domain-invariant features from data across different domains. (Kingma et al., 2014) also extend VAEs into the semi-supervised setting for representation disentanglement. (Lee et al., 2018) propose to disentangle the features into a domain-invariant content space and a domainspecific attributes space, producing diverse outputs without paired training data. Inspired by these works, we propose a method to disentangle the domain-invariant features from domain-specific features, using an adversarial training process. In addition, we propose to minimize the mutual information between the domain-invariant features and domain-specific features to enhance the feature disentanglement.

3. GENERALIZATION BOUND FOR FEDERATED DOMAIN ADAPTATION:

We first define the notation and review a typical theoretical error bound for single-source domain adaptation (Ben-David et al., 2007; Blitzer et al., 2008) devised by Ben-David et al. Then we describe our derived error bound for unsupervised federated domain adaptation. We mainly focus on the high-level interpretation of the error bound here and refer our readers to the appendix (see supplementary material) for proof details.

Notation. Let D S:

1 and D T denote source and target distribution on input space X and a ground-truth labeling function g : X → {0, 1}. A hypothesis is a function h : X → {0, 1} with the error w.r.t the ground-truth labeling function g: S (h, g) := E x∼D S [|h(x) -g(x)|]. We denote the risk and empirical risk of hypothesis h on D S as S (h) and S (h). Similarly, the risk and empirical risk of h on D T are denoted as T (h) and T (h). The H-divergence between two distributions D and D is defined as: d H (D, D ) := 2 sup A∈A H |Pr D (A) -Pr D (A)|, where H is a hypothesis class for input space X , and A H denotes the collection of subsets of X that are the support of some hypothesis in H.

The symmetric difference space H∆H is defined as: H∆H := {h(x) ⊕ h (x))|h, h ∈ H}, (⊕: the XOR operation). We denote the optimal hypothesis that achieves the minimum risk on the source and the target as h * := arg min h∈H S (h) + T (h) and the error of h * as λ := S (h * ) + T (h * ). Blitzer et al. (2007b) prove the following error bound on the target domain.

Theorem 1. Let H be a hypothesis space of V C-dimension d and D S , D T be the empirical distribution induced by samples of size m drawn from D S and D T . Then with probability at least 1 -δ over the choice of samples, for each h ∈ H,

T (h) ≤ S (h) + 1 2 d H∆H ( D S , D T ) + 4 2d log(2m) + log(4/δ) m + λ (1) Let D S ={D Si } N i=1

, and D T = {x t j } nt j=1 be N source domains and the target domain in a UFDA system, where D Si = {(x s j , y s j )} ni j=1 . In federated domain adaptation system, D S is distributed on N nodes and the data are not shareable with each other in the training process. The classical domain adaptation algorithms aim to minimize the target risk T (h) := Pr (x,y)∼D T [h(x) = y]. However, in a UFDA system, one model cannot directly get access to data stored on different nodes for security and privacy reasons. To address this issue, we propose to learn separate models for each distributed source domain h S = {h Si } N i=1 . The target hypothesis h T is the aggregation of the parameters of h S , i.e. h T :=

N i=1 α i h Si , ∀α ∈ R N + , i∈[N ] α i = 1.

We can then derive the following error bound: Theorem 2. (Weighted error bound for federated domain adaptation). Let H be a hypothesis class with VC-dimension d and { D Si } N i=1 , D T be empirical distributions induced by a sample of size m from each source domain and target domain in a federated learning system, respectively. Then, ∀α ∈ R N + , N i=1 α i = 1, with probability at least 1 -δ over the choice of samples, for each h ∈ H,

T (h T ) ≤ S ( i∈[N ] α i h Si ) error on source + i∈[N ] α i 1 2 d H∆H ( D Si , D T ) (D S i ,D T ) divergence +λ i + 4 2d log(2N m) + log(4/δ) N m VC-Dimension Constraint

(2) where λ i is the risk of the optimal hypothesis on the mixture of D Si and T , and S is the mixture of source samples with size N m. d H∆H ( D Si , D T ) denotes the divergence between domain S i and T .

Comparison with Existing Bounds:

The bound in ( 2) is extended from (1) and they are equivalent if only one source domain exists (N = 1). Mansour et al. (2009) provide a generalization bound for multiple-source domain adaptation, assuming that the target domain is a mixture of the N source domains. In contrast, in our error bound (2), the target domain is assumed to be an novel domain, resulting in a bound involving H∆H discrepancy (Ben-David et al., 2010) and the VC-dimensional constraint (Vapnik & Vapnik, 1998) . Blitzer et al. (2007b) propose a generalization bound for semisupervised multi-source domain adaptation, assuming that partial target labels are available. Our generalization bound is devised for unsupervised learning. Zhao et al. (2018) introduce classification and regression error bounds for multi-source domain adaptation. However, these error bounds assume that the multiple source and target domains exactly share the same hypothesis. In contrast, our error bound involves multiple hypotheses.

4. FEDERATED ADVERSARIAL DOMAIN ADAPTATION:

The error bound in Theorem (2) demonstrates the importance of the weight α and the discrepancy d H∆H (D S , D T ) in unsupervised federated domain adaptation. Inspired by this, we propose dynamic attention model to learn the weight α and federated adversarial alignment to minimize the discrepancy between the source and target domains, as shown in Figure 1 . In addition, we leverage representation disentanglement to extract domain-invariant representations to further enhance knowledge transfer.

Dynamic Attention:

In a federated domain adaptation system, the models on different nodes have different convergence rates. In addition, the domain shifts between the source domains and target domain are different, leading to a phenomenon where some nodes may have no contribution or even negative transfer (Pan & Yang, 2010) to the target domain. To address this issue, we propose dynamic attention, which is a mask on the gradients from source domains. The philosophy behind the dynamic attention is to increase the weight of those nodes whose gradients are beneficial to the target domain and limit the weight of those whose gradients are detrimental to the target domain. Specifically, we leverage the gap statistics (Tibshirani et al., 2001) to evaluate how well the target features f t can be clustered with unsupervised clustering algorithms (K-Means). Assuming we have k clusters, the gap statistics are computed as: Federated Adversarial Alignment The performance of machine learning models degrades rapidly with the presence of domain discrepancy (Long et al., 2015) . To address this issue, existing work (Hoffman et al., 2018; Tzeng et al., 2015) proposes to minimize the discrepancy with an adversarial training process. For example, Tzeng et al. (2015) proposes the domain confusion objective, under which the feature extractor is trained with a cross-entropy loss against a uniform distribution. However, these models require access to the source and target data simultaneously, which is prohibitive in UFDA. In the federated setting, we have multiple source domains and the data are locally stored Algorithm 1 Federated Adversarial Domain Adaptation Update

EQUATION

Input: N source domains DS={DS i } N i=1 ; a target domain Dt = {x t j } n t j=1 ; N feature extractors {Θ G 1 , Θ G 2 , ...Θ G N }, N disentanglers {Θ D 1 , Θ D 2 , ...Θ D N }, N classifiers {Θ C 1 , Θ C 2 , ...Θ C N }, N class identifiers {Θ CI 1 , Θ CI 2 , ...Θ CI N }, N mutual information estimators {Θ M 1 , Θ M 2 , ...Θ M N }

Θ G t , Θ C t by aggregated {Θ G 1 , Θ G 2 , ..., Θ G N }, {Θ C 1 , Θ C 2 , ...Θ C N }

respectively with the computed dynamic weight; 17: end while 18: return Θ G t , Θ C t in a privacy-preserving manner, which means we cannot train a single model which has access to the source domain and target domain simultaneously. To address this issue, we propose federated adversarial alignment that divides optimization into two independent steps, a domain-specific local feature extractor and a global discriminator. Specifically, (1) for each domain, we train a local feature extractor, G i for D i and G t for D t , (2) for each (D i , D t ) source-target domain pair, we train an adversarial domain identifier DI to align the distributions in an adversarial manner: we first train DI to identify which domain are the features come from, then we train the generator (G i , G t ) to confuse the DI. Note that D only gets access to the output vectors of G i and G t , without violating the UFDA setting. Given the i-th source domain data X Si , target data X T , the objective for DI i is defined as follows:

L adv DI i Θ DI i (X Si , X T , G i , G t ) = -E x s i ∼X s i log DI i (G i (x si ))] -E x t ∼X t [log(1 -DI i (G t (x t ))) .

(4) In the second step, L adv D remains unchanged, but L adv G is updated with the following objective:

L adv G Θ G i ,Θ G t (X Si , X T , DI i ) = -E x s i ∼X s i [log DI i (G i (x si ))] -E x t ∼X t [log DI i (G t (x t ))]

(5)

Representation Disentanglement We employ adversarial disentanglement to extract the domaininvariant features. The high-level intuition is to disentangle the features extracted by (G i , G t ) into domain-invariant and domain-specific features. As shown in Figure 1 (b), the disentangler D i separates the extracted features into two branches. Specifically, we first train the K-way classifier C i and K-way class identifier CI i to correctly predict the labels with a cross-entropy loss, based on f di and f ds features, respectively. The objective is:

Lcross-entropy Θ G i ,Θ D i ,Θ C i ,Θ CI i = -E (x s i ,y s i )∼ Ds i K k=1 1[k = y s i ]log(Ci(f di )) -E (x s i ,y s i )∼ Ds i K k=1 1[k = y s i ]log(CIi(f ds )) (6)

where

f di = D i (G i (x s i )), f ds = D i (G i (x si

)) denote the domain-invariant and domain-specific features respectively. In the next step, we freeze the class identifier CI i and only train the feature disentangler to confuse the class identifier CI i by generating the domain-specific features f ds , as shown in Figure 1 . This can be achieved by minimizing the negative entropy loss of the predicted In my opinion it is the best American animated film ever released. It has a beautiful story with a ton of laughs, a lot of teachable moments.

My advice is if you need a CD rack that holds a lot of CD's? Save your money and invest in something nicer and more sturdy.

I absolutely love this product. my neighbor has four little yippers and my hepard/chow mix was antogonized on our side of the fence. class distribution. The objective is as follows:

EQUATION

Feature disentanglement facilitates the knowledge transfer by reserving f di and dispelling f ds . To enhance the disentanglement, we minimize the mutual information between domain-invariant features and domain-specific features, following Peng et al. (2019) . Specifically, the mutual information is defined as I(f di ; f ds ) = P×Q log dP PQ dP P ⊗P Q dP PQ , where P PQ is the joint probability distribution of (f di , f ds ), and P P = Q dP PQ , P Q = Q dP PQ are the marginals. Despite being a pivotal measure across different distributions, the mutual information is only tractable for discrete variables, for a limited family of problems where the probability distributions are unknown (Belghazi et al., 2018) . Following Peng et al. (2019) , we adopt the Mutual Information Neural Estimator (MINE) (Belghazi et al., 2018) to estimate the mutual information by leveraging a neural network T θ :

I(P; Q) n = sup θ∈Θ E P (n) PQ [T θ ] -log(E P (n) P ⊗ P (n) Q [e T θ ]

). Practically, MINE can be calculated as I(P; Q) = P n PQ (p, q) T (p, q, θ) -log( P n P (p)P n Q (q)e T (p,q,θ) ). To avoid computing the integrals, we leverage Monte-Carlo integration to calculate the estimation:

EQUATION

where (p, q) are sampled from the joint distribution, q is sampled from the marginal distribution, and T (p, q, θ) is the neural network parameteralized by θ to estimate the mutual information between P and Q, we refer the reader to MINE (Belghazi et al., 2018) for more details. The domain-invariant and domain-specific features are forwarded to a reconstructor with a L2 loss to reconstruct the original features, aming to keep the representation integrity, as shown in Figure 1(b) .

Optimization Our model is trained in an end-to-end fashion. We train federated alignment and representation disentanglement component with Stochastic Gradient Descent (Kiefer et al., 1952) . The federated adversarial alignment loss and representation disentanglement loss are minimized together with the task loss. The detailed training procedure is presented in Algorithm 1.

5. EXPERIMENTS:

We test our model on the following tasks: digit classification (Digit-Five), object recognition (Office-Caltech10 (Gong et al., 2012) , DomainNet (Peng et al., 2018) ) and sentiment analysis (Amazon Review dataset (Blitzer et al., 2007a) ). Figure 2 shows some data samples and Table 9 (see supplementary material) shows the number of data per domain we used in our experiments. We perform our experiments on a 10 Titan-Xp GPU cluster and simulate the federated system on a single machine (as the data communication is not the main focus of this paper). Our model is implemented with PyTorch. We repeat every experiment 10 times on the Digit-Five and Amazon Review datasets, and 5 times on the Office-Caltech10 and DomainNet (Peng et al., 2018) features, f-DAN (Long et al., 2015) features and FADA features in sv,mm,mt,sy→up setting. We use different markers and colors to denote different domains. The data points from target domain have been denoted by red for better visual effect. (Best viewed in color.)

5.1. EXPERIMENTS ON DIGIT RECOGNITION:

Digit-Five This dataset is a collection of five benchmarks for digit recognition, namely MNIST (Le-Cun et al., 1998) , Synthetic Digits (Ganin & Lempitsky, 2015) , MNIST-M (Ganin & Lempitsky, 2015) , SVHN, and USPS. In our experiments, we take turns setting one domain as the target domain and the rest as the distributed source domains, leading to five transfer tasks. The detailed architecture of our model can be found in Table 7 (see supplementary material).

Since many DA models (Saito et al., 2018; French et al., 2018; Hoffman et al., 2018) require access to data from different domains, it is infeasible to directly compare our model to these baselines. Instead, we compare our model to the following popular domain adaptation baselines: Domain Adversarial Neural Network (DANN) (Ganin & Lempitsky, 2015) , Deep Adaptation Network (DAN) (Long et al., 2015) , Automatic DomaIn Alignment Layers (AutoDIAL) (Carlucci et al., 2017) , and Adaptive Batch Normalization (AdaBN) Li et al. (2016) . Specifically, DANN minimizes the domain gap between source domain and target domain with a gradient reversal layer. DAN applies multi-kernel MMD loss (Gretton et al., 2007) to align the source domain with the target domain in Reproducing Kernel Hilbert Space. AutoDIAL introduces domain alignment layer to deep models to match the source and target feature distributions to a reference one. AdaBN applies Batch Normalization layer (Ioffe & Szegedy, 2015) to facilitate the knowledge transfer between the source and target domains. When conducting the baseline experiments, we use the code provided by the authors and modify the original settings to fit federated DA setting (i.e. each domain has its own model), denoted by f -DAN and f -DANN. In addition, to demonstrate the difficulty of UFDA where accessing all source data with a single model is prohibative, we also perform the corresponding multi-source DA experiments (shared source data).

Results and Analysis:

The experimental results are shown in Table 1 . From the results, we can make the following observations. ( 1 To dive deeper into the feature representation of our model versus other baselines, we plot in Figure 3 (a)-3(d) the t-SNE embeddings of the feature representations learned on mm,mt,sv,sy→up task with source-only features, f -DANN features, f -DAN features and FADA features, respectively. We observe that the feature embeddings of our model have smaller intra-class variance and larger inter-class variance than f -DANN and f -DAN, demonstrating that our model is capable of generating the desired feature embedding and can extract domain-invariant features across different domains.

5.2. EXPERIMENTS ON OFFICE-CALTECH10:

Office-Caltech10 (Gong et al., 2012) This dataset contains 10 common categories shared by Office-31 (Saenko et al., 2010) and Caltech-256 datasets (Griffin et al., 2007) . It contains four domains: Caltech (C), which are sampled from Caltech-256 dataset, Amazon (A), which contains images collected from amazon.com, Webcam (W) and DSLR (D), which contains images taken by web camera and DSLR camera under office environment.

We leverage two popular networks as the backbone of feature generator G, i.e. AlexNet (Krizhevsky et al., 2012) and ResNet (He et al., 2016) . Both the networks are pre-trained on ImageNet (Deng et al., 2009) . Other components of our model are randomly initialized with the normal distribution. In the learning process, we set the learning rate of randomly initialized parameters to ten times of the pre-trained parameters as it will take more time for those parameters to converge. Details of our model are listed in 

The experimental results on Office-Caltech10 datasets are shown in Table 2 .

We utilize the same backbones as the baselines and separately show the results. We make the following observations from the results: (1) Our model achieves 86.5% accuracy with an AlexNet backbone and 87.1% accuracy with a ResNet backbone, outperforming the compared baselines.

(2) All the models have similar performance when C,D,W are selected as the target domain, but perform worse when A is selected as the target domain. This phenomenon is probably caused by the large domain gap, as the images in A are collected from amazon.com and contain a white background.

To better analyze the effectiveness of FADA, we perform the following empirical analysis: (1) Adistance Ben-David et al. ( 2010) suggests A-distance as a measure of domain discrepancy. Following Long et al. (2015) , we calculate the approximate A-distance dA = 2 (1 -2 ) for C,D,W→A and A,C,W→D tasks, where is the generalization error of a two-sample classifier (e.g. kernel SVM) trained on the binary problem of distinguishing input samples between the source and target domains.

In Figure 4 (a), we plot for tasks with raw ResNet features, f -DANN features, and FADA features, respectively. We observe that the dA on DADA features are smaller than ResNet features and f -DANN features, demonstrating that FADA features are harder to be distinguished between source and target. The figures show that f -DAN mainly confuses "calculator" vs. "keyboard", "backpack" with "headphones", while FADA is able to distinguish them with disentangled features. Table 5 : The ablation study results show that the dynamic attention module is essential for our model. infographic images with specific object; Painting (pnt), artistic depictions of object in the form of paintings; Quickdraw (qdr), drawings from the worldwide players of game "Quick Draw!"3 ; Real (rel, photos and real world images; and Sketch (skt), sketches of specific objects. This dataset is very large-scale and contains rich and informative vision cues across different domains, providing a good testbed for unsupervised federated domain adaptation. Some sample images can be found in Figure 2 .

5.3. EXPERIMENTS ON DOMAINNET:



Results:

The experimental results on DomainNet are shown in Table 3 . Our model achieves 28.9% and 30.3% accuracy with AlexNet and ResNet backbone, respectively. In both scenarios, our model outperforms the baselines, demonstrating the effectiveness of our model on large-scale dataset. Note that this dataset contains about 0.6 million images, and so even a one-percent performance improvement is not trivial. From the experiment results, we can observe that all the models deliver less desirable performance when infograph and quickdraw are selected as the target domains. This phenomenon is mainly caused by the large domain shift between inf/qdr domain and other domains.

5.4. EXPERIMENTS ON AMAZON REVIEW:

Amazon Review (Blitzer et al., 2007a) This dataset provides a testbed for cross-domain sentimental analysis of text. The task is to identify whether the sentiment of the reviews is positive or negative. The dataset contains reviews from amazon.com users for four popular merchandise categories: Books (B), DVDs (D), Electronics (E), and Kitchen appliances (K). Following Gong et al. (2013) , we utilize 400-dimensional bag-of-words representation and leverage a fully connected deep neural network as the backbone. The detailed architecture of our model can be found in Table 8 (supplementary materials).

The experimental results on Amazon Review dataset are shown in Table 4 . Our model achieves an accuracy of 78.9% and outperforms the compared baselines. We make two major observations from the results: (1) Our model is not only effective on vision tasks but also performs well on linguistic tasks under UFDA learning schema. (2) From the results of model I and II, we can observe the dynamic attention and federated adversarial alignment are beneficial to improve the performance. However, the performance boost from Model II to Model III is limited. This phenomenon shows that the linguistic features are harder to disentangle comparing to visual features.

5.5. ABLATION STUDY:

To demonstrate the effectiveness of dynamic attention, we perform the ablation study analysis. The Table 5 shows the results on "Digit-Five", Office-Caltech10 and Amazon Review benchmark. We observe that the performance drops in most of the experiments when dynamic attention model is not applied. The dynamic attention model is devised to cope with the varying convergence rates in the federated learning system, i.e., different source domains have their own convergence rate. In addition, it will increase the weight of a specific domain when the domain shift between that domain and the target domain is small, and decrease the weight otherwise.

6. CONCLUSION:

In this paper, we first proposed a novel unsupervised federated domain adaptation (UFDA) problem and derived a theoretical generalization bound for UFDA. Inspired by the theoretical results, we proposed a novel model called Federated Adversarial Domain Adaptation (FADA) to transfer the knowledge learned from distributed source domains to an unlabeled target domain with a novel dynamic attention schema. Empirically, we showed that feature disentanglement boosts the performance of FADA in UFDA tasks. An extensive empirical evaluation on UFDA vision and linguistic benchmarks demonstrated the efficacy of FADA against several domain adaptation baselines.

7. NOTATIONS:

We provide the explanations of notations occurred in this paper. 

Notations:



8. MODEL ARCHITECTURE:

We provide the detailed model architecture ( Table 8 : Model architecture for cross-doman sentimental analysis task ("Amazon Review" dataset (Blitzer et al., 2007a) ). For the fully-connected layers (FC), we provide the input and output dimensions. For drop-out layers (Dropout), we provide the probability of an element to be zeroed. (Gong et al., 2012) and DomainNet (Peng et al., 2018) ). For each convolution layer, we list the input dimension, output dimension, kernel size, stride, and padding. For the fully-connected layer, we provide the input and output dimensions. For drop-out layers, we provide the probability of an element to be zeroed. 

Digit-Five:



:

In this literature, the calligraphic D denotes data distribution, and italic D denotes domain discriminator.

http://ai.bu.edu/M3SDA/

https://quickdraw.withgoogle.com/data

Figures and Tables:

Figure 1: (a) We propose an approach for the UFDA setting, where data are not shareable between different domains. In our approach, models are trained separately on each source domain and their gradients are aggregated with dynamic attention mechanism to update the target model. (b) Our FADA model learns to extract domain-invariant features using adversarial domain alignment (red lines) and a feature disentangler (blue lines).

3)where we have clusters C 1 , C 2 , ..., C k , with C r denoting the indices of observations in cluster r, and n r =|C r |. Intuitively, a smaller gap statistics value indicates the feature distribution has smaller intraclass variance. We measure the contribution of each source domain by the gap statistics gain between two consecutive iterations: training step), denoting how much the clusters can be improved before and after the target model is updated with the i-th source model's gradient. The mask on the gradients from source domains is defined as Sof tmax(I gain 1

artwork in comic books. It contains the most extraordinary and finest artwork of Alex Ross.

Figure 2: We demonstrate the effectiveness of FADA on four datasets: (1) "Digit-Five", which includes MNIST (mt), MNIST-M (mm), SVHN (sv), Synthetic (syn), and USPS (up). (2) Office-Caltech10 dataset, which contains Amazon (A), Caltech (C), DSLR (D), and Webcam (W). (3) DomainNet dataset, which includes: clipart (clp), infograph (inf ), painting (pnt), quickdraw (qdr), real (rel), and sktech (skt). (4) Amazon Review dataset, which contains review for Books (B), DVDs (D), Electronics (E), and Kitchen & housewares (K).

Figure3: Feature visualization: t-SNE plot of source-only features, f-DANN(Ganin & Lempitsky, 2015)

Figure 4: (a)A-Distance of ResNet, f -DANN, and FADA features on two different tasks. (b) training errors and dynamic weight on A,C,W→D task. (c)-(d) confusion matrices of f -DAN, and FADA on A,C,D→W task.

To show how the dynamic attention mechanism benefits the training process, we plot the training loss w/ or w/o dynamic weights for A,C,W→D task in Figure 4(b). The figure shows the target model's training error is much smaller when dynamic attention is applied, which is consistent with the quantitative results. In addition, in A,C,W→D setting, the weight of A decreases to the lower bound after first a few epochs and the weight of W increases during the training process, as photos in both D and W are taken in the same environment with different cameras. (3) To better analyze the error mode, we plot the confusion matrices for f -DAN and FADA on A,C,D->W task in Figure 4(c)-4(d).

trained on source domains. Target feature extractor Θ G t , classifier Θ C t . N domain identifiers {Θ DI 1 , Θ DI 2 , ..., Θ DI N } Output: well-trained target feature extractor ΘG t , target classifier ΘC t . DI i , {Θ G i , Θ G t } with Eq. 4 and Eq. 5 respectively to align the domain distribution; G i , Θ D i , Θ C i , Θ CI i with Eq. 6 9:update Θ D i and {Θ G i } with Eq.

Table content: <table><tr><td colspan="2">Model Initialization .</td></tr><tr><td colspan="2">1: while not converged do</td></tr><tr><td>2: 3:</td><td>for i do=1:N Sample mini-batch from from {(x s i , y s i )} ns i=1 and {x t j } n t j=1 ;</td></tr><tr><td>4:</td><td>Compute gradient with cross-entropy classification loss, update Θ G i , Θ C i .</td></tr><tr><td>5:</td><td>Domain Alignment:</td></tr><tr><td colspan="2">6: Update Θ 7: Domain Disentangle:</td></tr><tr><td>8:</td><td>update Θ 7</td></tr><tr><td>10:</td><td>Mutual Information Minimization:</td></tr><tr><td>11: 12:</td><td>Calculate mutual information between the disentangled feature pair (f di , f ds ) with Mi; Update Θ D i , Θ M i by Eq.8;</td></tr><tr><td>13:</td><td>end for</td></tr><tr><td>14:</td><td>Dynamic weight:</td></tr><tr><td>15:</td><td>Calculate dynamic weight by Eq. 3</td></tr><tr><td>16:</td><td/></tr></table>

Modelsmt,sv,sy,up→mm mm,sv,sy,up→mt mt,mm,sy,up→sv mt,mm,sv,up→sy mt,mm,sv,sy→up  Avg Accuracy (%) on "Digit-Five" dataset with UFDA protocol. FADA achieves 73.6%, outperforming other baselines. We incrementally add each component t our model, aiming to study their effectiveness on the final results. (model I: with dynamic attention; model II: I+adversarial alignment; model III: II+representation disentanglement. mt, up, sv, sy, mm are abbreviations for MNIST, USPS, SVHN, Synthetic Digits, MNIST-M.)

Table content: <table><tr><td>Source Only</td><td>63.3±0.7</td><td>90.5±0.8</td><td>88.7±0.8 63.5±0.9</td><td>82.4±0.6 77.7</td></tr><tr><td>DAN</td><td>63.7±0.7</td><td>96.3±0.5</td><td>94.2±0.8 62.4±0.7</td><td>85.4±0.7 80.4</td></tr><tr><td>DANN</td><td>71.3±0.5</td><td>97.6±0.7</td><td>92.3±0.8 63.4±0.7</td><td>85.3±0.8 82.1</td></tr><tr><td>Source Only</td><td>49.6±0.8</td><td>75.4±1.3</td><td>22.7±0.9 44.3±0.7</td><td>75.5±1.4 53.5</td></tr><tr><td>AdaBN</td><td>59.3±0.8</td><td>75.3±0.7</td><td>34.2±0.6 59.7±0.7</td><td>87.1±0.9 61.3</td></tr><tr><td>AutoDIAL</td><td>60.7±1.6</td><td>76.8±0.9</td><td>32.4±0.5 58.7±1.2</td><td>90.3±0.9 65.8</td></tr><tr><td>f -DANN</td><td>59.5±0.6</td><td colspan="2">86.1±1.1 44.3 ±0.6 53.4±0.9</td><td>89.7±0.9 66.6</td></tr><tr><td>f -DAN</td><td colspan="4">57.5 ±0.8 86.4 ±0.7 45.3±0.7 58.4±0.7 90.8 ±1.1 67.7</td></tr><tr><td>FADA+attention (I)</td><td>44.2±0.7</td><td>90.5±0.8</td><td>27.8±0.5 55.6±0.8</td><td>88.3±1.2 61.3</td></tr><tr><td colspan="4">FADA+adversarial (II) 58.2±0.8 92.5± 0.9 48.3±0.6 62.1±0.5</td><td>90.6±1.1 70.3</td></tr><tr><td colspan="4">FADA+disentangle (III) 62.5±0.7 91.4 ±0.7 50.5 ±0.3 71.8±0.5</td><td>91.7±1.0 73.6</td></tr></table>

Accuracy

Table content: <table><tr><td>AlexNet</td><td>80.1±0.4</td><td>86.9±0.3</td><td>82.7±0.5</td><td>85.1±0.3</td><td>83.7</td></tr><tr><td>f -DAN</td><td>82.5±0.5</td><td>87.2±0.4</td><td>85.6±0.4</td><td>86.1±0.3</td><td>85.4</td></tr><tr><td>f -DANN</td><td>83.1±0.4</td><td>86.5±0.5</td><td>84.8±0.5</td><td>86.4±0.5</td><td>85.2</td></tr><tr><td>FADA+attention (I)</td><td>81.2±0.3</td><td>87.1±0.6</td><td>83.5±0.5</td><td>85.9±0.4</td><td>84.4</td></tr><tr><td>FADA+adversarial (II)</td><td>83.1±0.6</td><td>87.8±0.4</td><td>85.4±0.4</td><td>86.8±0.5</td><td>85.8</td></tr><tr><td>FADA+disentangle (III)</td><td>84.3±0.6</td><td>88.4±0.5</td><td>86.1±0.4</td><td>87.3±0.5</td><td>86.5</td></tr><tr><td>ResNet101</td><td>81.9±0.5</td><td>87.9±0.3</td><td>85.7±0.5</td><td>86.9±0.4</td><td>85.6</td></tr><tr><td>AdaBN</td><td>82.2±0.4</td><td>88.2±0.6</td><td>85.9±0.7</td><td>87.4±0.8</td><td>85.7</td></tr><tr><td>AutoDIAL</td><td>83.3±0.6</td><td>87.7±0.8</td><td>85.6±0.7</td><td>87.1±0.6</td><td>85.9</td></tr><tr><td>f -DAN</td><td>82.7±0.3</td><td>88.1±0.5</td><td>86.5±0.3</td><td>86.5±0.3</td><td>85.9</td></tr><tr><td>f -DANN</td><td>83.5±0.4</td><td>88.5±0.3</td><td>85.9±0.5</td><td>87.1±0.4</td><td>86.3</td></tr><tr><td>FADA+attention (I)</td><td>82.1±0.5</td><td>87.5±0.3</td><td>85.8±0.4</td><td>87.3±0.5</td><td>85.7</td></tr><tr><td>FADA+adversarial (II)</td><td>83.2±0.4</td><td>88.4±0.3</td><td>86.4±0.5</td><td>87.8±0.4</td><td>86.5</td></tr><tr><td>FADA+disentangle (III)</td><td>84.2±0.5</td><td>88.7±0.5</td><td>87.1±0.6</td><td>88.1±0.4</td><td>87.1</td></tr></table>

supplementary material).

Table content: <table><tr><td>Models</td><td>inf,pnt,qdr, rel,skt→clp</td><td>clp,pnt,qdr, rel,skt→inf</td><td>clp,inf,qdr, rel,skt→pnt</td><td>clp,inf,pnt, rel,skt→qdr</td><td>clp,inf,pnt, qdr,skt→rel</td><td>clp,inf,pnt, qdr,rel→skt Avg</td></tr><tr><td>AlexNet</td><td colspan="6">39.2±0.7 12.7±0.4 32.7±0.4 5.9±0.7 40.3±0.5 22.7±0.6 25.6</td></tr><tr><td>f -DAN</td><td colspan="6">41.6±0.6 13.7±0.5 36.3±0.5 6.5±0.5 43.5±0.8 22.9±0.5 27.4</td></tr><tr><td>f -DANN</td><td colspan="6">42.6±0.8 14.1±0.7 35.2±0.3 6.2±0.7 42.9±0.5 22.7±0.7 27.2</td></tr><tr><td colspan="7">FADA+disentangle (III) 44.9±0.7 15.9±0.6 36.3±0.8 8.6±0.8 44.5±0.6 23.2±0.8 28.9</td></tr><tr><td>ResNet101</td><td colspan="6">41.6 ±0.6 14.5±0.7 35.7±0.7 8.4±0.7 43.5±0.7 23.3±0.7 27.7</td></tr><tr><td>f -DAN</td><td colspan="6">43.5±0.7 14.1±0.6 37.6±0.7 8.3±0.6 44.5±0.5 25.1±0.5 28.9</td></tr><tr><td>f -DANN</td><td colspan="6">43.1±0.8 15.2±0.9 35.7±0.4 8.2±0.6 45.2±0.7 27.1±0.6 29.1</td></tr><tr><td colspan="7">FADA+disentangle (III) 45.3±0.7 16.3±0.8 38.9 ±0.7 7.9±0.4 46.7±0.4 26.8±0.4 30.3</td></tr></table>

Accuracy (%) on the DomainNet dataset(Peng et al., 2018)  dataset under UFDA protocol. The upper table shows the results based on AlexNet(Krizhevsky et al., 2012) backbone and the table below are the results based on ResNet(He et al., 2016) backbone.

Table content: <table><tr><td>Method</td><td colspan="5">D,E,K → B B,E,K → D B,D,K → E B,D,E → K Average</td></tr><tr><td>Source Only</td><td>74.4±0.3</td><td>79.2±0.4</td><td>73.5 ±0.2</td><td>71.4±0.1</td><td>74.6</td></tr><tr><td>f -DANN</td><td>75.2±0.3</td><td>82.7±0.2</td><td>76.5±0.3</td><td>72.8±0.4</td><td>76.8</td></tr><tr><td>AdaBN</td><td>76.7±0.3</td><td>80.9±0.3</td><td>75.7±0.2</td><td>74.6±0.3</td><td>76.9</td></tr><tr><td>AutoDIAL</td><td>76.3±0.4</td><td>81.3±0.5</td><td>74.8±0.4</td><td>75.6±0.2</td><td>77.1</td></tr><tr><td>f -DAN</td><td>75.6±0.2</td><td>81.6±0.3</td><td>77.9±0.1</td><td>73.2±0.2</td><td>77.6</td></tr><tr><td>FADA+attention (I)</td><td>74.8±0.2</td><td>78.9±0.2</td><td>74.5±0.3</td><td>72.5±0.2</td><td>75.2</td></tr><tr><td>FADA+adversarial (II)</td><td>79.7±0.2</td><td>81.1±0.1</td><td>77.3±0.2</td><td>76.4±0.2</td><td>78.6</td></tr><tr><td>FADA+disentangle (III)</td><td>78.1±0.2</td><td>82.7±0.1</td><td>77.4±0.2</td><td>77.5±0.3</td><td>78.9</td></tr></table>

Accuracy (%) on "Amazon Review" dataset with unsupervised federated domain adaptation protocol.

Table content: <table/>

DomainNet 2 This dataset contains approximately 0.6 million images distributed among 345 categories. It comprises of six domains: Clipart (clp), a collection of clipart images; Infograph (inf), FADA w/o. attention 60.1 91.2 49.2 69.1 90.2 71.9 83.3 85.7 86.2 88.3 85.8 77.2 82.8 77.2 76.3 78.3 FADA w. attention 62.5 91.4 50.5 71.8 91.7 73.6 84.2 88.7 87.1 88.1 87.1 78.1 82.7 77.4 77.5 78.9

Table content: <table><tr><td>target</td><td>mm</td><td>mt</td><td>sv</td><td>sy</td><td>up Avg A C D W Avg B</td><td>D</td><td>E</td><td>K Avg</td></tr></table>

Name Details DI domain identifier align the domain pair (G i ,G t ) D disentangler disentangle the feature to f di and feature f ds . M mutual information estimator estimate the mutual information between f ds and f di Notations occurred in the paper.

Table content: <table><tr><td>C</td><td>classifier</td><td>predict the labels for input features</td></tr><tr><td>CI</td><td>class identify</td><td>extract domain-specific features.</td></tr><tr><td>G i</td><td>feature generator</td><td>extract features for D Si</td></tr><tr><td>G t</td><td>feature generator</td><td>extract features for D t</td></tr></table>

Table7 and Table 9) for each component in our model: Generator, Disentangler, Domain Classifier, Classifier and MINE. Model architecture for digit recognition task ("Digit-Five" dataset). For each convolution layer, we list the input dimension, output dimension, kernel size, stride, and padding. For the fullyconnected layer, we provide the input and output dimensions. For drop-out layers, we provide the probability of an element to be zeroed.

Table content: <table><tr><td colspan="2">layer configuration</td></tr><tr><td/><td>Feature Generator</td></tr><tr><td>1</td><td>Conv2D (3, 64, 5, 1, 2), BN, ReLU, MaxPool</td></tr><tr><td>2</td><td>Conv2D (64, 64, 5, 1, 2), BN, ReLU, MaxPool</td></tr><tr><td>3</td><td>Conv2D (64, 128, 5, 1, 2), BN, ReLU</td></tr><tr><td/><td>Disentangler</td></tr><tr><td>1</td><td>FC (8192, 3072), BN, ReLU</td></tr><tr><td>2</td><td>DropOut (0.5), FC (3072, 2048), BN, ReLU</td></tr><tr><td/><td>Domain Identifier</td></tr><tr><td>1</td><td>FC (2048, 256), LeakyReLU</td></tr><tr><td>2</td><td>FC (256, 2), LeakyReLU</td></tr><tr><td/><td>Class Identifier</td></tr><tr><td>1</td><td>FC (2048, 10), BN, Softmax</td></tr><tr><td/><td>Reconstructor</td></tr><tr><td>1</td><td>FC (4096, 8192)</td></tr><tr><td/><td>Mutual Information Estimator</td></tr><tr><td colspan="2">fc1_x FC (2048, 512), LeakyReLU</td></tr><tr><td colspan="2">fc1_y FC (2048, 512), LeakyReLU</td></tr><tr><td>2</td><td>FC (512,1)</td></tr></table>

Model architecture for image recognition task (Office-Caltech10

Table content: <table><tr><td colspan="2">layer configuration</td></tr><tr><td/><td>Feature Generator: ResNet101 or AlexNet</td></tr><tr><td/><td>Disentangler</td></tr><tr><td>1</td><td>Dropout(0.5), FC (2048, 2048), BN, ReLU</td></tr><tr><td>2</td><td>Dropout(0.5), FC (2048, 2048), BN, ReLU</td></tr><tr><td/><td>Domain Identifier</td></tr><tr><td>1</td><td>FC (2048, 256), LeakyReLU</td></tr><tr><td>2</td><td>FC (256, 2), LeakyReLU</td></tr><tr><td/><td>Class Identifier</td></tr><tr><td>1</td><td>FC (2048, 10), BN, Softmax</td></tr><tr><td/><td>Reconstructor</td></tr><tr><td>1</td><td>FC (4096, 2048)</td></tr><tr><td/><td>Mutual Information Estimator</td></tr><tr><td colspan="2">fc1_x FC (2048, 512), LeakyReLU</td></tr><tr><td colspan="2">fc1_y FC (2048, 512), LeakyReLU</td></tr><tr><td>2</td><td>FC (512,1)</td></tr></table>

Detailed number of samples we used in our experiments.

Table content: <table><tr><td>Splits</td><td colspan="2">mnist mnist_m</td><td>svhn</td><td>syn</td><td>usps</td><td/><td>Total</td></tr><tr><td>Train</td><td>25,000</td><td>25,000</td><td>25,000</td><td>25,000</td><td>7,348</td><td/><td>107,348</td></tr><tr><td>Test</td><td>9,000</td><td>9,000</td><td>9,000</td><td>9,000</td><td>1,860</td><td/><td>37,860</td></tr><tr><td/><td/><td/><td colspan="2">Office-Caltech10</td><td/><td/><td/></tr><tr><td>Splits</td><td/><td colspan="2">Amazon Caltech</td><td>Dslr</td><td>Webcam</td><td/><td>Total</td></tr><tr><td>Total</td><td/><td>958</td><td>1,123</td><td>157</td><td>295</td><td/><td>2,533</td></tr><tr><td/><td/><td/><td colspan="2">DomainNet</td><td/><td/><td/></tr><tr><td>Splits</td><td>clp</td><td>inf</td><td>pnt</td><td>qdr</td><td>rel</td><td>skt</td><td>Total</td></tr><tr><td>Train</td><td>34,019</td><td>37,087</td><td>52,867</td><td>120,750</td><td colspan="3">122,563 49,115 416,401</td></tr><tr><td>Test</td><td>14,818</td><td>16,114</td><td>22,892</td><td>51,750</td><td>52,764</td><td colspan="2">21,271 179,609</td></tr><tr><td/><td/><td/><td colspan="2">Amazon Review</td><td/><td/><td/></tr><tr><td>Splits</td><td/><td>Books</td><td>DVDs</td><td colspan="2">Electronics Kitchen</td><td/><td>Total</td></tr><tr><td>Positive</td><td/><td>1,000</td><td>1,000</td><td>1,000</td><td>1,000</td><td/><td>4,000</td></tr><tr><td>Negative</td><td/><td>1,000</td><td>1,000</td><td>1,000</td><td>1,000</td><td/><td>4,000</td></tr></table>

Peer review (iclr2020):
The authors present a novel algorithm for dealing with domain adaptation in the setting of federated learning (classification, specifically). That is, they tackle the issue of learning a model on a new domain when access to the data points used in training the source models is not possible due to privacy constraints. The approach uses the gradients of the source models, reweighed to account for the differing shifts between the different sources and the target domain, to fit the model on the target domain. The authors motivate their approach by providing a novel bound on the generalization error of transfer learning when the hypothesis function used on the target domain is a convex combination of hypotheses fitted on multiple source domains. This bound shows that the weighted sum of divergences in the symmetric difference hypothesis space controls the generalization error, so the authors aim at deriving feature representations and using aggregation weights that ensure this weighted sum is small. The authors use a novel dynamic attention model to get the aggregation weights: they cluster the features in the target domain, and measure how much the intra-cluster variation decreases when information from a given source domain is incorporated. The aggregation weights for the model updates on the target domain are then weighed using a softmax transform of these contribution weights. The motivation up through and including section 3 is clear, the theoretical results are presented clearly, but the model details in section 4 are unclear: - In the dynamic attention mechanism, how does one a priori choose the number of clusters in computing the gap statistics, and what is the impact? - the notation in the federated adversarial alignment section is unclear: what *exactly* are the model coefficients Theta that are being updated? - the statement *optimize following objective* is made several times. this is ambiguous, and should be corrected to *miminize* following objective. - the representation disentanglement process is intricate, and only vaguely addressed. how does one fit the neural net and use (8)? where is the l2 reconstruction loss balanced with the mutual information? the vagueness of this section means Algorithm 1 is not well-specified. The experiments are reasonable, and compare to baseline domain adaptation methods. The problem considered is of interest, and the approach is novel and interesting. However, the algorithm is not described in sufficient detail. After reading the paper, and spending considerable time rereading section 4, I still do not understand how Algorithm 1 is implemented in practice. For that reason I lean towards reject. I will update my score if the authors clarify the details of Algorithm 1. Comments: - the symmetric difference hypothesis space is incorrectly called the HdeltaH divergence in section 3