D ISENTANGLED CYCLIC RECONSTRUCTION FOR DOMAIN ADAPTATION
Anonymous authors
Paper under double-blind review
A BSTRACT
The domain adaptation problem involves learning a unique classiﬁcation or regression model capable of performing on both a source and a target domain.
Although the labels for the source data are available during training, the labels in the target domain are unknown.
An effective way to tackle this problem lies in extracting insightful features invariant to the source and target domains.
In this work, we propose splitting the information for each domain into a task-related representation and its complimentary context representation.
We propose an original method to disentangle these two representations in the single-domain supervised case.
We then adapt this method to the unsupervised domain adaptation problem.
In particular, our method allows disentanglement in the target domain, despite the absence of training labels.
This enables the isolation of task-speciﬁc information from both domains and a projection into a common representation.
The task-speciﬁc representation allows efﬁcient transfer of knowledge acquired from the source domain to the target domain.
We validate the proposed method on several classical domain adaptation benchmarks and illustrate the beneﬁts of disentanglement for domain adaptation.
I NTRODUCTION
The wide adoption of Deep Neural Networks in practical supervised learning applications is hindered by their sensitivity to the training data distribution.
This problem, known as domain shift , can drastically weaken, in real-life operating conditions, the performance of a model that seemed perfectly efﬁcient in simulation.
Learning a model with the goal of making it robust to a speciﬁc domain shift is called domain adaptation (DA).
Often, the data available to achieve DA consist of a labeled training set from a source domain and an unlabeled sample set from a target domain.
This yields the problem of unsupervised domain adaptation (UDA).
In this work, we take an information disentanglement perspective on UDA.
We argue that a key to efﬁcient UDA lies in separating the necessary information to complete the network’s task (classiﬁcation or regression), from a task-orthogonal information which we call context or style .
Disentanglement in the target domain seems however a difﬁcult endeavor since the available data is unlabeled.
Our contribution is two-fold.
We propose a formal deﬁnition of the disentanglement problem for
UDA which, to the best of our knowledge, is new.
Then we design a new learning method, called
DiCyR (Disentangled Cyclic Reconstruction), which relies on cyclic reconstruction of inputs in order to achieve efﬁcient disentanglement, including in the target domain.
We derive DiCyR both in the supervised learning and in the UDA cases.
This paper is organized as follows.
Section 2 presents the required background on supervised learning and UDA, and proposes a deﬁnition of disentanglement for UDA.
Section 3 reviews recent work in the literature that allow for a critical look at our contribution and put it in perspective.
Sectionintroduces DiCyR, ﬁrst for the single-domain supervised learning case and then for the UDA problem.
Finally, Section 5 empirically evaluates DiCyR against state-of-the-art methods and discusses its strengths, weaknesses and variants.
Section 6 summarizes and concludes this paper.
P ROBLEM DEFINITION
In this section, we introduce the notations and background upon which we build the contributions of Section 4.
Let X be an input space of descriptors and Y an output space of labels.
A supervised learning problem is deﬁned by a distribution p s ( x, y ) over elements of X × Y .
In what follows, p s will be called the source distribution.
One wishes to estimate a mapping ˆ f that minimizes a loss function of the form E ( x,y ) ∼ p s (cid:104) l ( ˆ f ( x ) , y ) (cid:105) .
The optimal estimator is denoted f and one often writes the distribution P ( y | x ) as y ∼ f ( x ) + η , where η captures the deviations between y and f ( x ) .
Hence, one tries to learn f .
In practice, the loss can only be approximated using a ﬁnite set of samples { ( x i , y i ) } ni =1 all independently drawn from p s and ˆ f is a parametric function (such as a deep neural network) of the form y
= ˆ f ( x ; θ ) .
Domain adaptation (DA) consists in considering a target distribution p t over X ×Y that differs from p s , and the transfer of knowledge from learning in the source domain ( p s ) to the target domain ( p t ).
Speciﬁcally, unsupervised DA exploits the knowledge of a labelled training set { ( x si , y si ) } ni =1 sampled according to p s , and an unlabelled data set { ( x ti ) } mi =1 sampled according to p t .
For instance, the source domain data could be a set of labelled photographs of faces, and the target domain data, a set of unlabelled face photographs, taken with a different camera under different exposure conditions.
The problem consists in minimizing the target loss E ( x,y ) ∼ p t (cid:104) l ( ˆ f ( x ) , y ) (cid:105) .
We suppose that a necessary condition to beneﬁt from the knowledge available in the source domain and transfer it to the target domain is the existence of a common information manifold between domains, where an input’s projection is sufﬁcient to predict the labels.
We call this useful information task-speciﬁc or task-related .
The complimentary information should be called task-orthogonal ; it is composed of information that is present in the input but is not relevant to the task at hand.
For the sake of naming simplicity, we will call this information style .
However we insist that this should not be confused with the classical notion of style.
Let Π τ : X → T and Π σ : X → S denote two projection operators, where T and S denote respectively the latent task-related information space and the latent style-related information space.
Let Π be the joint projection Π( x ) =
(Π τ ( x ) , Π σ ( x )) .
Conversely, we shall note ¯Π : T × S → X a reconstruction operator.
And ﬁnally, c : T → Y will denote the labeling operator which only uses information from T .
We consider that the information of the elements of X is correctly disentangled by Π
= (Π τ , Π σ ) if one can ﬁnd ¯Π and c such that:
C1:
c ◦ Π τ minimizes the loss (and thus ﬁts f on the appropriate domain), C2: ¯Π ◦ Π ﬁts the identity operator id X , C3:
With X, T, S the random variables in X , T , S , the mutual information
I ( T, S | X ) = 0 , C4: There is no function g : T → X such that g ◦ Π τ = id X ,
Condition C1 imposes that the projection into T retains enough information to correctly label samples.
Condition C2 imposes that all the information necessary for the reconstruction is preserved by the separation performed by Π .
Condition C3 states that no information is present in both T and
S .
Condition C4 impose that the information contained in T alone is insufﬁcient to reconstruct an input, and thus the information of S is necessary.
Note that the symmetrical condition is unnecessary, since the combination of C1 and C3 already guarantees that S cannot contain the task-related information.
Overall, solving this disentanglement problem for DA implies ﬁnding a quadruplet (cid:104) Π τ , Π σ , ¯Π , c (cid:105) that meets the conditions above.
In particular, note that conditions C3 and C4 open a perspective to a formulation of disentanglement in the general case.
R ELATED WORK
Disentanglement between the domain-invariant, task-related information and the domain-speciﬁc, task-orthogonal, style information is a desirable property to have for DA.
In the next paragraphs, we cover important work in representation disentanglement, domain adaptation and their interplay.
Before deep learning became popular, Tenenbaum & Freeman (2000) presented a method using bi-linear models able to separate style from content.
More recently, methods based on generative models have demonstrated the ability to disentangle factors of variations from elements of a single domain (Rifai et al., 2012; Mathieu et al., 2016;
Chen et al., 2016; Higgins et al., 2017; Sanchez et al., 2019).
In a cross-domain setting, Gonzalez-Garcia et al.
(2018) use pairs of images with the same labels from different domains to separate representations into a shared information common to both domains and a domain-exclusive information.
We note that these approaches do not explicitly aim at respecting all conditions listed in Section 2.
Additionally, most require labeled datasets (and in some cases even paired datasets) and thus do not address the unsupervised DA problem.
One approach to UDA consists in aligning the source and target distributions statistics, a topic closely related to batch normalization (Ioffe & Szegedy, 2015).
Sun et al.
(2017) minimize the distance between the covariance matrices of the features extracted from the source and target domains.
Assuming the domain-speciﬁc information is contained inside the batch normalization layers, Li et al.
(2017) align the batch statistics by adopting a speciﬁc normalization for each domain.
Cariucci et al.
(2017) aim to align source and target feature distributions to a reference one and introduce domain alignment layers to automatically learn the degree of feature alignment needed at different levels of the network.
Similarly, Roy et al.
(2019) replace batch normalization layers with domain alignment layers implementing a so-called feature whitening.
A major asset of these methods is the possibility to be used jointly with other DA methods (including the one we propose in Section 4).
These methods jointly learn a common representation for elements from both domains.
Conversely, Liang et al.
(2020) freeze the representations learned in the source domain before training a target-speciﬁc encoder to align the representations of the target elements by maximizing the mutual information between intermediate feature representations and outputs of the classiﬁer.
Ensemble methods have also been applied to UDA (Laine & Aila, 2017; Tarvainen & Valpola, 2017).
French et al.
(2018) combine stochastic data augmentation with self-ensembling to minimize the prediction differences between a student and a teacher network in the target domain.
Another approach involves learning domain-invariant features, that do not allow to discriminate whether a sample belongs to the source or target domain, while still permitting accurate labeling in the source domain.
This approach relies on the assumption that such features allow efﬁcient labeling in the target domain.
Ghifary et al.
(2016) build a two-headed network sharing common layers; one head performs classiﬁcation in the source domain, while the second is a decoder that performs reconstruction for target domain elements.
Ganin et al.
(2016) propose the DANN method and introduce Gradient Reversal Layers to connect a domain discriminator and a feature extractor.
These layers invert the gradient sign during back-propagation so that the feature extractor is trained to fool the domain discriminator.
Shen et al.
(2018) modify DANN and replace the domain discriminator by a network that approximates the Wasserstein distance between domains.
Tzeng et al.
(2017) optimize, in an adversarial setting, a generator and a discriminator with an inverted label loss.
Other methods focus on explicitly disentangling an information shared between domains (analogous to the domain-invariant features above) from a domain-speciﬁc information.
Inspired by Chen et al.
(2016), Liu et al.
(2018b) isolate a latent factor, representing the domain information, from the rest of an encoding, by maximizing the mutual information between generated images and this latent factor.
Some domain information may still be present in the remaining part of the encoding and thus may not comply with conditions C3 and C4.
Liu et al.
(2018a) combine an encoder, an image generator, a domain discriminator, and a fake images discriminator to produce cross-domain images.
The encoder is trained jointly with the domain discriminator to produce domain-invariant representations.
Li et al.
(2020) disentangle a latent representation into a global code and a local code.
The global code captures category information via an encoder with a prior, and the local code is transferable across domains, which captures the style-related information via an implicit decoder.
Bousmalis et al.
(2016) also produce domain-invariant features by training a shared encoder to fool a domain discriminator.
They train two domain-private encoders with a difference loss that encourages orthogonality between the shared and the private representations (similarly to condition
C3).
Cao et al.
; Cai et al.
; Peng et al.
(2019) combine a domain discriminator with an adversarial classiﬁer to separate the information shared between domains from the domain-speciﬁc information.
All these methods build a shared representation that prevents discriminating between source and target domains, while retaining enough information to correctly label samples from the source domain.
However, because they rely on an adversarial classiﬁer that requires labeled data, they do not guarantee that the complimentary, domain-speciﬁc information for samples in the target domain does not contain information that overlaps with the shared representation.
In other words, they only enforce C3 in the source domain.
They rely on the assumption that the disentanglement will still hold when applied on target domain elements, which might not be true.
Another identiﬁed weakness in methods that achieve a domain-invariant feature space is that their representations might not allow for accurate labeling in the target domain.
Indeed, feature alignment does not necessarily imply a correct mapping between domains.
To illustrate this point, consider a binary classiﬁcation problem (classes c 1 and c 2 ) and two domains ( d 1 and d 2 ).
Let ( c 1 , d 1 ) denote samples of class c 1 in d 1 .
It is possible to construct an encoding that projects ( c 1 , d 1 ) and ( c 2 , d 2 ) to the same feature values.
The same holds for ( c 1 , d 2 ) and ( c 2 , d 1 ) for different feature values.
This encoding allows discriminating between classes in d 1 .
It also fools a domain discriminator since it does not allow predicting the original domain of a projected element.
However, applying the classiﬁcation function learned on d 1 to the projected d 2 elements leads to catastrophic predictions.
Transforming a sample from one domain to the other, while retaining its label information can be accomplished by image-to-image translation methods.
Hoffman et al.
(2018) extend CycleGAN’s cycle consistency (Zhu et al., 2017) with a semantic consistency to translate from source to target domains.
The translated images from the source domain to the target domain are then used to train a classiﬁer on the target domain using the source labels.
Similarly, Russo et al.
(2018) train two conditional GANs (Mirza & Osindero, 2014) to learn bi-directional image mappings constrained by a class consistency loss and use a source domain classiﬁer to produce pseudo-labels on source-like transformed target samples.
By relaxing CycleGAN’s cycle consistency constraint and integrating the discriminator in the training phase, Hosseini-Asl et al.
(2019) address the DA problem in the speciﬁc setting where the number of target samples is limited.
Takahashi et al.
(2020) use a CycleGAN to generate cross-domain pseudo-pairs and train two domain-speciﬁc encoders to align features extracted from each pseudo-pair in the feature space.
A major asset of the method is to address the class-unbalanced UDA problem by oversampling with the learned data augmentation.
Yang et al.
(2019) use separate encoders to produce domain-invariant and domain-speciﬁc features in both domains.
They jointly train these encoders with two generators to produce cross-domain elements able to fool domain-speciﬁc discriminators.
Using a cyclic loss on features, they force the information contained in the representation to be preserved during the generation of cross-domain elements.
However, the cyclic loss on features does not prevent the information sharing between features expressed in C3.
More importantly it does not prevent the domain-speciﬁc features to be constant.
A major drawback of these methods lies in the instability during training that might be caused by min-max optimization problem induced by the adversarial training of generators and discriminators.
In the next section, we introduce a method that does not rely on a domain discriminator and an adversarial label predictor, but directly minimizes the information sharing between representations.
This allows to guarantee that there is no information redundancy between the task-related and the task-orthogonal style information in both the source and the target domains.
Along the way, it provides an efﬁcient mechanism to disentangle the task-related information from the style information in the single domain case.
Our method combines information disentanglement, intra-domain and cross-domain cyclic consistency to enforce a more principled mapping between each domain.
D ISENTANGLEMENT WITH G RADIENT R EVERSAL L AYERS AND CYCLIC RECONSTRUCTION
First, we propose an original method to disentangle the task-related information from the style information for a single domain in a supervised learning setting.
In a second step, we propose an adaptation of this method to learn these disentangled representations in both domains for UDA.
This disentanglement allows, in turn, to efﬁciently predict labels in the target domain.
4. T ASK - STYLE DISENTANGLEMENT IN THE SUPERVISED CASE
Our approach consists in estimating jointly Π , ¯Π and c as a deep feed-forward neural network.
We shall note θ Π , θ ¯Π , and θ c the parameters of the respective sub-parts of the network.
Π ◦ ¯Π takes the form of an auto-encoder, while Π ◦ c is a task-related (classiﬁcation or regression) network.
Figure 1a summarizes the global architecture which we detail in the following paragraphs.
x Π σ τ ¯Π c
b y ¯ x
GRL r σ b σ
GRL r τ b τ (a) Supervised learning x s Π σ s τ s ¯Π s ¯Π t
c
b
y ˆ x s x st
GRL r σ b σ
GRL r τ σ t b τ (b) Unsupervised domain adaptation
Conditions C1 and C2 are expressed through the deﬁnition of a task-speciﬁc loss L task ( e.g. crossentropy for classiﬁcation, L2 loss for regression) and a reconstruction loss L reco .
Therefore, the update of θ Π should follow −∇ θ Π ( L task + L reco ) , the update of θ ¯Π relies on −∇ θ ¯Π L reco , and that of θ c uses −∇ θ c L task .
In order to achieve condition C3, we exploit Gradient Reversal Layers (Ganin et al., 2016, GRL).
We train two side networks r τ : S → T and r σ : T → S whose purpose is to attempt to predict
T given S , and S given T respectively.
For a given x , let us write ( τ, σ )
=
Π( x ) , (cid:98) τ
= r τ ( σ ) , and (cid:98) σ = r σ ( τ ) .
We train r τ and r σ to minimize the losses L r τ = (cid:107) τ − (cid:98) τ (cid:107) 2 and L r σ = (cid:107) σ − (cid:98) σ (cid:107) 2 .
Let
L info =
L r τ + L r
σ denote the combination of these losses.
We connect these two sub-networks to the whole architecture using GRLs.
GRLs behave as the identity function during the forward pass and invert the gradient sign during the backward pass, hence pushing the parameters to maximize the output loss.
During training, this architecture constrains Π to produce features in T and S with the least information shared between them.
Consequently, the update of θ Π follows + ∇ θ
[Table]
L info .
This constraint efﬁciently avoids information redundancy between T and S .
However, it does not avoid all the information being pushed into T .
Preventing this undesirable behavior is the purpose of condition C4.
To that end, we use a cyclic reconstruction scheme.
Consider two elements x and x (cid:48) from X , and their associated ( τ, σ ) =
Π( x ) and ( τ (cid:48) , σ (cid:48) )
=
Π( x (cid:48) ) .
Let ˜ x
= ¯Π( τ, σ (cid:48) ) be the reconstruction of τ that uses the style σ (cid:48) of x (cid:48) .
A correct allotment of the information between T and S requires that the task and style information be preserved in (˜ τ, ˜ σ )
=
Π(˜ x ) .
So, we wish to have ˜ τ as close as possible to τ , or, alternatively, to have c (˜ τ ) as close as possible to c ( τ ) .
Similarly, we wish to have ˜ σ as close as possible to σ (cid:48) .
To enforce C4 and avoid the degenerate case where the encoder predicts a constant style for all samples, we force ˜ σ to lie sufﬁciently far from σ to avoid style confusion.
We achieve this with a triplet loss (Schroff et al., 2015) using ˜ σ as the anchor, σ (cid:48) and σ as, respectively, the positive and negative inputs, and a margin m .
Thus C4 results in minimizing the cyclic reconstruction loss L cyclic =
(cid:107) ˜ τ − τ (cid:107) 2 + max {(cid:107) ˜ σ − σ (cid:48)
(cid:107) 2 − (cid:107) ˜ σ − σ (cid:107) 2 + m, 0 } .
Overall, the gradient-based update procedure of the network parameters boils down to:
[Equation]
τ − α ∇ θ rτ
L r τ , θ r σ ← θ r σ − α ∇ θ rσ L r σ .
We call this method DiCyR for Disentangled Cyclic Reconstruction.
4. T ASK - STYLE DISENTANGLEMENT IN THE UNSUPERVISED DOMAIN ADAPTATION CASE
We propose a variation of DiCyR for UDA, where we replace the decoder ¯Π by two domain-speciﬁc decoders, ¯Π s and ¯Π t .
We shall compensate for the lack of labeled data in the target domain by computing cross-domain cyclic reconstructions.
Let ( x s , y s ) be a sample from the source domain and x t be a sample from the target domain.
Let us denote ( τ s , σ s )
=
Π( x s ) and ( τ t , σ t ) =
Π( x t ) , the corresponding projections in the latent task and style-related information spaces.
Then one can deﬁne, as in the previous section, L task as the taskspeciﬁc loss on the source domain, and L reco s and L reco t as the reconstruction losses in the source
[Figure]
and target domains respectively.
As previously, we constrain the task-related representation and the style representation not to share information using two networks r τ and r σ , connected to the main architecture by GRL layers (Figure 1b), allowing the deﬁnition of the L r τ , L r σ and L info losses.
Lastly, we exploit cyclic reconstructions in both domains to correctly disentangle the information and hence deﬁne the same L cyclic loss as above.
This disentanglement in the target domain separates the global information in two but does not guarantee that what is being pushed into τ is really the task-related information.
This can only be enforced by cross-domain knowledge (since no correct labels are available in the target domain).
Thus, ﬁnally, we would like to allow projections from one domain into the other while retaining the task-related information, hence allowing domain adaption.
Using the notations above, we construct x ts = ¯Π t ( τ s , σ t ) , the reconstruction of x s ’s task-related information, in the style of x t .
This creates an artiﬁcial sample in the target domain, whose label is y s .
Then, with ( τ ts , σ ts ) =
Π( x ts ) , one wishes to have τ ts match closely τ s (or, alternatively, c ( τ ts ) match closely y s ) in order to prevent the loss of task information during the cross-domain projection and thus to constrain the task representations to be domain-invariant.
Symmetrically, one can construct the artiﬁcial sample x st = ¯Π s ( τ t , σ s ) and enforce that τ st closely matches τ t .
Note that the label of x st is unknown and yet it is still possible to enforce the disentanglement by cyclic reconstruction.
Overall, these terms boil down to a cross-domain cyclic reconstruction loss for UDA
L domain cyclic = (cid:107) τ s − τ ts (cid:107)
+ (cid:107) τ t − τ st (cid:107) 2 .
Finally, the network parameters are updated according to:
[Equation]
( L task + L reco s + L reco t − L info + L cyclic + L domain cyclic ) , θ ¯Π s ← θ ¯Π s − α ∇ θ ¯Π s ( L reco s + L cyclic ) , θ ¯Π t ← θ ¯Π t − α ∇ θ ¯Π t ( L reco t + L cyclic ) , θ c ← θ c − α ∇ θ c L task , θ r τ ← θ r τ − α ∇ θ rτ
L r τ , θ r σ ← θ r σ − α ∇ θ rσ L r σ .
E XPERIMENTAL RESULTS AND DISCUSSION
We ﬁrst evaluate DiCyR’s ability to disentangle the task-related information from the style information in the supervised context.
Then we demonstrate DiCyR’s efﬁciency on UDA.
5. S UPERVISED DISENTANGLEMENT
We evaluate the disentanglement performance of DiCyR by following the protocol introduced by
Mathieu et al.
Since we do not use generative models, we only focus on their two ﬁrst items: swapping and retrieval .
We evaluate DiCyR on the SVHN (Netzer et al., 2011), and 3D Shapes (Burgess & Kim, 2018) disentanglement benchmarks.
The task is predicting the central digit in the image for the SVHN dataset, and the shape of the object in the scene for the 3D Shapes dataset.
Swapping involves swapping styles between samples and visually assessing the realism of the generated image.
It combines the task-related information
τ i of a sample x i with the style σ j of another sample x j .
We use the decoder to produce an output ˜ x ij .
Figure 2 shows randomly generated outputs on the two datasets.
DiCyR produces visually realistic artiﬁcial images with the desired styles.
Query
Neighbors
Query
Neighbors
[Figure]
representation
Query
Neighbors
Query
Neighbors
[Figure]
[Table]
Retrieval concerns ﬁnding, in the dataset, the nearest neighbors in the embedding space for an image query.
We carry out this search for nearest neighbors using the Euclidean distance on both the task-related and the style representations.
A good indicator of the effectiveness of the information disentanglement would be to observe neighbors with the same labels as the query when computing distances on the task-related information space, and neighbors with similar style when using the style information.
Figure 3 demonstrate that the neighbors found when using the task-related information are samples with the same label as the query’s label and that the neighbors found using the style representation share many characteristics with the query but not necessarily the same labels.
We ran a quantitative evaluation of disentanglement by training a neural network classiﬁer with a single hidden layer of 32 units to predict labels, using either the task-related information alone, or the style information alone.
If the information is correctly separated, we expect the classiﬁer trained with task-related information only to get similar performance to a classiﬁer trained with full information.
Conversely, the classiﬁer trained with the style information only should reach similar performance to a random guess (10% accuracy on SVHN, 25% on 3D Shapes).
Table 1 reports the obtained testing accuracies.
It appears that the task-related representation contains enough information to correctly predict labels.
We also observe that full disentanglement is closely but not perfectly achieved as the classiﬁer trained only with style information behaves slightly better that random choice.
To quantify how much style information is being unduly encoded in the task-related representation, we ran a similar experiment to predict the ﬁve other style variation factors in 3D Shapes (ﬂoor hue, wall hue, object hue, scale and orientation).
The trained classiﬁer reaches accuracies that are very close to a random guess, thus validating the disentanglement quality.
5. U NSUPERVISED DOMAIN ADAPTATION PROBLEM
We evaluate DiCyR by performing domain adaptation between the MNIST (LeCun et al., 1998),
SVHN, and USPS (Hull, 1994) datasets, and between the Syn-Signs (Ganin & Lempitsky, 2015) and the GTSRB (Stallkamp et al., 2011) datasets.
Following common practice in the literature, we trained our network on ﬁve different settings: MNIST → USPS, USPS → MNIST, SVHN → MNIST,
MNIST → SVHN, and Syn-Signs → GTSRB.
We measure the classiﬁcation performance in the target domain and compare it with state-of-the-art methods (Table 2).
We also compare with a baseline classiﬁer that is only trained on the source domain data.
Values reported in Table 2 are quoted from their original papers 2 .
Our method, without extensive hyperparameter tuning, appears to be on par with the best state-of-the-art methods.
DiCyR also outperforms others disentangle- ment and image-to-image methods.
Speciﬁcally, DiCyR is only slightly outmatched by DWT and
SEDA on the MNIST ↔ USPS and by SEDA and SHOT in the SVHN → MNIST benchmarks.
The
MNIST → SVHN case is a particularly challenging benchmark since MNIST images are greyscale and the adaptation to SVHN requires adapting to color images.
SEDA makes extensive use of data augmentation to tackle this challenge and is thus the only method displaying convincing results.
This hints to a possible enhancement of DiCyR in order to improve its performance.
Finally, by introducing a new variation on batch normalization, DWT’s contribution is orthogonal to ours and both could be combined.
We emphasize that beyond these enhancements, a major advantage of DiCyR lies in the ability to disentangle the information in the target domain without direct supervision.
DiCyR uses GRLs to ensure that no information is shared between T and S .
Similarly to most methods in Table 2, GRLs induce an adversarial optimization problem which is known to yield instability and variance in the resolution performance.
In our case, this induces several distinct modes in the distribution of accuracies.
It is interesting to note that the majority mode (that of the median) on SVHN → MNIST matches the best known performance.
For this reason, we report both the mean and the median on this speciﬁc experiment.
One might object that condition C3 was expressed in terms of mutual information.
Thus, DiCyR only indirectly implements this condition using GRLs.
An alternative could be to use an estimator of the mutual information, such as proposed by Belghazi et al.
(2018), to directly minimize it (and thus avoid the adversarial setting altogether).
Such an approach was explored in the work of Sanchez et al.
(2019) to disentangle representations between pairs of images, and would constitute a promising perspective of research for DA.
[Table]
DANN
[Table]
As in Section 5.1, we evaluate qualitatively the effectiveness of disentanglement, especially in the target domain, and produce visualizations of cross-domain style and task swapping.
Here, we combine one domain’s task information with the other domain’s styles to reconstruct the images of
Figures 4a, 4b, 4d
[Table]
and 4e.
The most important ﬁnding is that the style information was correctly disentangled from the task-related information in the target domain without the use of any label.
Speciﬁcally, the rows in these ﬁgures show that the class information is preserved when a new style is applied, while the columns illustrate the efﬁcient style transfer allowed by disentanglement.
A desirable property of the task-related encoding is its domain invariance.
To evaluate this aspect, we built a t-SNE representation (Hinton & Roweis, 2003) of the task-related features, in order to verify their alignment between domains.
Figures 4c and 4f demonstrate this property.
The previous experiments illustrated the use of DiCyR in the context of image classiﬁcation.
The method is, however, quite generic and can be applied in many more contexts.
Figure 5 reports the improvement due to applying DiCyR for domain adaptation between the GTA5 (Richter et al., 2016) and the Cityscapes (Cordts et al., 2016) segmentation problems (detailed results in Appendix G).
[Figure] [Figure]
Finally, directly computing the distances on the task-related features in L domain cyclic often leads to unstable results.
As hinted in Section 4, using instead a task oriented loss L domain cyclic = (cid:107) c ( τ s ) − y (cid:107)
+ (cid:107) c
( τ t ) − c ( τ st ) (cid:107) 2 stabilizes training and improves the target domain accuracy.
Training c with cross-domain projections from the source domain and the corresponding labels improves its generalization to the target domain and forces the encoder to produce task-related features common to both domains.
To illustrate this property, consider the following example.
In one domain, the digit “7” is written with a middle bar, while in the other it has none.
This domain-speciﬁc middle bar feature should not be expressed in T ; it should be considered as a task-orthogonal style feature.
Thus using c ’s predictions within the domain cyclic loss, instead of distances in T , prevents the encoder from representing the domain-speciﬁc features in T and encourages their embedding in S .
C ONCLUSION
In this work, we introduced a new disentanglement method, called DiCyR, to separate task-related and task-orthogonal style information into different representations in the context of unsupervised domain adaptation.
This method also provides a simple and efﬁcient way to obtain disentangled representations for supervised learning problems.
Its main features are its overall simplicity, the use of intra-domain and cross-domain cyclic reconstruction, and information separation through Gradient Reversal Layers.
The design of this method stems from a formal deﬁnition of disentanglement for domain adaptation which, to the best of our knowledge, is new.
The empirical evaluation shows that DiCyR performs as well as state-of-the-art methods, while offering the additional beneﬁt of disentanglement, including in the target domains where no label information is available.
A C ROSS - DOMAIN DISENTANGLEMENT VISUALIZATIONS
We report extra cross-domain visualizations similar to those of Section 5.2 in Figures 6 and 7.
[Figure]
[Figure]
B N ETWORK ARCHITECTURE AND TRAINING HYPER - PARAMETERS
The paragraphs below detail the network architctures used in the experiments of Section 5.
It should be noted that neither these architectures, nor the associated hyper-parameters have been extensively and ﬁnely tuned to their respective tasks, as the goal of this contribution was to provide a generic, robust method.
Thus it is likely that performance gains can still be obtained on this front.
B. S INGLE DOMAIN SUPERVISED DISENTANGLEMENT EXPERIMENTS
This section describes the network architecture and the hyper-parameters used in the experiments of Section 5.1.
The encoder Π is composed of shared layers (layers 1 to 6 in the table below), followed by the speciﬁc task-related and style encodings.
Those ﬁnal layers are denoted Π τ and Π σ in the tables below.
For the sake of implementation simplicity, we chose to project samples from the source domain and samples from the target domain into two separate style embeddings (one for each domain).
Thus Π σ is actually duplicated in two heads Π σ,s and Π σ,t with the same structure and output space.
We used the exact same network architectures for both the 3D shapes and SVHN datasets, the only difference being the dimension of the embeddings T and S .
In all experiments, we applied a coefﬁcient β reco = 5 to L reco and β cyclic = 0 .
1 to L cyclic in the global loss.
We also use a β info on L info ; this coefﬁcient increases linearly from 10 − 2 to 10 over the ﬁrst 10 epochs and remains at 10 afterwards (see Section C for a discussion on this coefﬁcient).
Convergence was reached within 50 epochs.
We used Adam (Kingma & Ba, 2015) as an optimizer with a learning rate lr = 5 · 10 − 4 for the ﬁrst 30 epochs and lr = 5 · 10 − 5 for the last 20 epochs.
The following tables summarize the architectures of all sub-networks.
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table] [Table] [Table] [Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
Gradient Reversal Layer Dense nb neurons=100, activation=ReLU Dense
nb neurons=
[Table]
, activation=
[Table]
Dense nb
[Table]
=
[Table]
, activation=
Linear
B. U NSUPERVISED DOMAIN ADAPTATION EXPERIMENTS
This section describes the network architecture and the hyper-parameters used in the experiments of Section 5.2.
The encoder Π is composed of shared layers (layers 1 to 9 in the tables below), followed by the speciﬁc task-related and style encodings.
Those ﬁnal layers are denoted Π τ and Π σ in the tables below.
For the sake of implementation simplicity, we chose to project samples from the source domain and samples from the target domain into two separate style embeddings (one for each domain).
Thus Π σ is actually duplicated in two heads Π σ,s and Π σ,t with the same structure and output space.
In all experiments, in the global loss, we applied a coefﬁcient β cyclic = 0 .
1 to
L cyclic and β domain cyclic to L domain cyclic , with β domain cyclic increasing linearly from 0 toduring the 10 ﬁrst epochs and remaining at 10 afterwards (see Section C for a discussion on this coefﬁcient).
Convergence was reached within 50 epochs (generally within 30 epochs).
We used
Adam (Kingma & Ba, 2015) as an optimizer with a learning rate lr = 5 · 10 − 4 for the ﬁrst 30 epochs and lr = 5 · 10 − 5 for the last 20 epochs.
The following tables summarize the architectures of all sub-networks.
[Table]
Conv2D ﬁlters=32, kernel= 5 × 5 , stride=1, padding=2, activation=
Linear
Instance Normalization
Max Pooling ﬁlters= 2 × 2 , stride=
Conv2D ﬁlters=32 for SVHN → MNIST 64 for MNIST → SVHN kernel= 5 × 5 , stride=1, padding=2, activation=
Linear
Instance Normalization
[Table]
Normalization
[Table]
Pooling ﬁlters= 2 × 2 , stride=
Conv2D ﬁlters=32 for SVHN → MNIST 128 for MNIST → SVHN kernel= 3 × 3 , stride=1, padding=1, activation=
Linear
Instance Normalization
[Table]
nb neurons=1024, activation=ReLU
[Table]
nb neurons=75 for SVHN
→ MNIST activation=ReLU nb neurons=200 for MNIST → SVHN, activation=ReLU
[Table]
nb neurons=75 for SVHN
→ MNIST activation=ReLU nb neurons=200 for MNIST → SVHN, activation=ReLU
Architecture of ¯Π s and ¯Π t , SVHN ↔ MNIST case
[Table]
nb neurons=1024, activation=ReLU
[Table]
nb neurons=64, activation=ReLU
Conv2D ﬁlters=32 for SVHN → MNIST 64 for MNIST → SVHN kernel= 3 × 3 ,
stride=1, padding=1, activation=ReLU
Upsample scale factor=
Conv2D ﬁlters=32, kernel= 5 × 5 , stride=1, padding=2, activation=ReLU
Upsample scale factor=
Conv2D ﬁlters=3, kernel= 5 × 5 , stride=1, padding=2, activation=
Sigmoid
Architecture
[Table] [Table]
p=0.
[Table] [Table]
Dense nb neurons=1024, activation=
ReLU Π
[Table]
nb neurons=75, activation=ReLU
[Table]
nb neurons=75, activation=ReLU
Architecture of ¯Π s and ¯Π t , Syn-Signs ↔ GTSRB case
Layer
Type
Parameters
Conv2D ﬁlters=64, kernel= 4 × 4 ,
stride=1, padding=1, activation=ReLU
Upsample scale factor=
Conv2D ﬁlters=32, kernel= 3 × 3 , stride=1, padding=2, activation=ReLU
Upsample scale factor=
Conv2D ﬁlters=32, kernel= 3 × 3 , stride=1, padding=2, activation=ReLU
Upsample scale factor=
Conv2D ﬁlters=1, kernel= 3 × 3 , stride=1, padding=2, activation=
Sigmoid
Architecture of c
Syn-Signs ↔ GTSRB
Layer
Type
Parameters
Dropout p=0.
[Table]
Dense nb neurons=10, activation=Softmax
Architecture of r τ and r σ , Syn-Signs ↔ GTSRB case
Layer
Type
Parameters
Gradient Reversal Layer
Dense nb neurons=100, activation=ReLU
Dense nb neurons=150, activation=
Linear
For the GTA5 → Cityscapes experiment, we based our network’s architecture on the one proposed by (Romera et al., 2017).
[Table]
C D ISCUSSION ON THE β info AND β domain cyclic COEFFICIENTS SCHEDULE
Although the schedule on β info (single domain case) and β domain cyclic (domain adaptation case) is not absolutely necessary, we found out it helped the overall convergence.
These coefﬁcients gradually increase the weight of the information disentanglement objective and the cross-domain reconstruction objective.
This assigns more importance to learning a good predictor c ◦ Π during early stages.
From this perspective, gradually increasing β info can be seen as gradually removing task-useless information from T and transferring it to S .
Similarly, increasing β domain cyclic corresponds to letting the network discover disentangled representations before aligning them across domains.
As previously mentioned, our goal in this study was to provide a robust disentanglement method that permits domain adaptation.
Therefore, no complete hyper-parameter study and tuning was performed and these ﬁndings are thus reported as such and might be incomplete.
Reﬁning the understanding of the inﬂuence of the different β coefﬁcients is closer to the problem of meta-learning and is beyond the scope of this paper.
D I NFLUENCE OF BATCH NORMALIZATION AND DROPOUT ON D I C Y R
Batch normalization (Ioffe & Szegedy, 2015) is an efﬁcient way to reduce the discrepancy between the source and target distributions statistics.
We noticed that, for the speciﬁc SVHN → MNIST setting, using instance normalization (Ulyanov et al., 2016) slightly improves the target domain accuracy.
Normalizing across chanels, the instance normalization layers helps the networks to be agnostic to the image contrast which is particularly strong in MNIST.
We also noticed that using a large dropout in the sub-network c , and small embedding dimensions for Π ’s ouputs improves both the disentanglement quality and the target domain accuracy.
We conjecture that the information bottleneck induced forces the task-related representation to be as concise as possible and thus encourages disentanglement.
E C OMPLIMENTARY INFORMATION RELATED TO THE M ACHINE L EARNING R EPRODUCIBILITY C HECKLIST
All the experiments from section 5 were run on a Google Cloud Platform n1-standard-8 virtual machine (8 virtual cores, 30Go RAM, Nvidia P100 GPU) except the experiment on GTA5 →
Cityscapes for which two Nvidia P100 GPU were used.
The code corresponding to the experiments, a list of dependencies, and pre-trained models are available at https://github.com/
AnonymousDiCyR/DiCyR Details about each experiments are reported on Table 3.
[Table]
To account for GPU memory limits
[Table]
the gradients were accumulated over 5 batches of size
[Table]
F D ISTRIBUTION OF RESULTS
In Figure 8 we report the distribution of testing accuracies for the SVHN → MNIST benchmark of
Section 5.2.
Most of the accuracies are distributed within three modes with low variance, centered respectively around 89%, 94% and 98%, the latter being also the median and the majority mode.
This sheds a more detailed light on the results reported in Section 5.2.
As discussed therein, we conjecture these modes stem from the local equilibria of the adversarial optimization problem induced by the GRLs in DiCyR.
Thus we expect that avoiding this problem altogether in the formulation of
DiCyR could improve these resulting distributions.
G D OMAIN ADAPTATION FOR THE GTA5 → C ITYSCAPES SEGMENTATION TASK
Here we report on the application of DiCyR for the segmentation task in GTA5 (Richter et al., 2016) and Cityscapes (Cordts et al., 2016).
GTA5 is the source domain, where the ground truth of image segments is provided, and the goal is to reach efﬁcient segmentation on the Cityscapes dataset.
Figure 5 provided a ﬁrst visual illustration of the beneﬁts provided by DiCyR. Figure 9 provides yet other such examples.
Column 9a presents the testing image from the Cityscapes dataset, column 9b shows the application on the testing image of a classiﬁer trained only on the GTA5 images, column 9c shows the segmentation obtained by DiCyR, which can be compared to the ground truth (column 9d).
[Figure]
Table 4 reports the Intersection over Union criterion (the Jaccard index) for each object class in the
Cityscapes images.
We compare the seminal approach of Hoffman et al.
(2016) coined “FCNs in the wild”, which served as a baseline for CyCADA (Hoffman et al., 2018), and the application of
DiCyR. These results are preliminary 3 and did not beneﬁt from any hyperparameter or architecture tuning.
The purpose of this table is to report the out-of-the-box performance of DiCyR and validate the rationale behind performing disentanglement, on a challenging, large scale problem.
r
[Table]
a d s i d e
[Table]
a l k
[Table]
il d i
[Table]
a ll f e n ce po l e t r a f ﬁ c li gh t t r a f ﬁ c s i gn v e g e t a ti on t e rr a i n s ky p e r s on r i d e r
[Table]
r t r u c k bu s t r a i n m o t
o r c
y
c l e b i c y c
l e m I o U
[Table]