Class Distribution Alignment for Adversarial Domain Adaptation

Most existing unsupervised domain adaptation methods mainly focused on aligning the marginal distributions of samples between the source and target domains. This setting does not sufficiently consider the class distribution information between the two domains, which could adversely affect the reduction of domain gap. To address this issue, we propose a novel approach called Conditional ADversarial Image Translation (CADIT) to explicitly align the class distributions given samples between the two domains. It integrates a discriminative structure-preserving loss and a joint adversarial generation loss. The former effectively prevents undesired label-flipping during the whole process of image translation, while the latter maintains the joint distribution alignment of images and labels. Furthermore, our approach enforces the classification consistence of target domain images before and after adaptation to aid the classifier training in both domains. Extensive experiments were conducted on multiple benchmark datasets including Digits, Faces, Scenes and Office31, showing that our approach achieved superior classification in the target domain when compared to the state-of-the-art methods. Also, both qualitative and quantitative results well supported our motivation that aligning the class distributions can indeed improve domain adaptation.


I. INTRODUCTION
The excellent performance of deep learning crucially depends on the availability of a large amount of labeled data. However, this requirement cannot be well met in many real scenarios, and the absence of labels in a target domain makes classification difficult. Leveraging labeled data from auxiliary source domains has been shown as a promising way to improve this situation. Nevertheless, the inevitable discrepancy of data distributions between the source and target domains poses new challenges. This has made unsupervised domain adaptation (UDA) an active research topic in artificial intelligence in the recent years.
Previous deep domain adaptation methods [1], [2], [3] learn transferable feature representation across different domains. It embeds domain adaptation modules into several high layers of a CNN network to narrow the distribution gap. Recently, inspired by the powerful generative adversarial network (GAN) [4], a few adversarial domain adaptation methods have been Considering both of them, our method will be able to better align the class distributions given samples (i.e., P (y|x) and Q(y|x)), and thus helps to improve classification in the target domain.
developed [5], [6], [7]. They leveraged an adversarial setting to learn a domain discriminator (to distinguish from which domain a latent feature representation was derived) and domaininvariant feature generator(s) (to confuse the discriminator). However, these methods usually transform features rather than images, which prevent them from producing interpretable and visualizable transformation that is often highly desirable in practical applications. This paper follows a special yet important setting in adversarial domain adaption: adversarial image translation between different domains, which leverages GAN to generate sourcelike or target-like images for domain adaptation. This approach can effectively deal with the changes in appearance or texture between domains, i.e., style transfer. Several methods along this line [8], [9], [10], [11], [12] have been proposed in the recent years, well demonstrating their efficacy. Usually, these methods take a fundamental assumption that when the images from different domains conform a same marginal distribution after domain adaptation, their joint distribution with labels can be expected to be aligned at the same time. Nevertheless, this assumption could be too strong to hold in many crossdomain scenarios. Once this happens, these methods will suffer from ONLY aligning the marginal distributions and deliver less satisfactory classification in the target domain. This case is illustrated in the top of the light yellow box in Fig. 1 to better present the potential issue. As shown, if only aligning the marginal distributions, some target samples could still be misclassified because the class-specific samples between the
To address the above issue, we explicitly propose to align the class probability distributions given samples between the source and target domains 1 , instead of merely aligning the marginal distributions. This is because the class distribution crucially determines the classification result of a target sample. Also, it was proved by the Theorem 1 in the literature [15] that the expected target error is upper-bounded by three terms: 1) source error, 2) domain divergence, and 3) the difference in labeling functions across domains. The difference of labeling function can be significantly affected by the difference of the class distributions between the two domains, thus we do our best to align the class distributions to reduce the target error. Note that according to the Bayes' rule, when both marginal distribution P (x) and joint distribution P (x, y) are aligned, the class distribution P (y|x) shall also be aligned. Therefore, we propose a novel Conditional ADversarial Image Translation approach (CADIT) to simultaneously align (1) the marginal distributions and (2) the joint distributions between the two domains (see Fig. 1). Only aligning one of them will not ensure the desired alignment of the class distributions. Table I lists the main difference of existing domain adaptation methods from our method. It is worth noting that a few methods [3], [6] have attempted to approximately align the joint distributions. However, due to the unavailability of target sample labels, effectively aligning the joint distributions still remains an open issue (see the Remark for detailed differences).
Specifically, to align the marginal distributions, we adopt the widely-used CycleGAN [16] as a base network of adversarial image translation. Nevertheless, we found that CycleGAN, as an unsupervised image translation method, does not necessarily maintain the class labels of samples during translation, which is however important in our method. To deal with this issue, we put forward a discriminative structure-preserving (DSP) loss to prevent the undesired flips of class labels. Also, to align the joint distributions, we develop a novel joint adversarial generation (JAG) loss in both domains to jointly distinguish the authenticity/fakeness of the samples and their labels in an adversarial way. Since the labels of target samples are not available, we obtain their pseudo-labels and utilize the entropy-based prediction confidence to handle the uncertainty of these pseudo-labels. The target samples with more reliable pseudo-labels are allowed to contribute more to the joint distribution alignment. Besides, we incorporate a classifier into each discriminator in both domains to simultaneously perform the image generation and classification. Considering that the two classifiers could be affected by the image generation and thus produce inconsistent classification predictions for a same target sample, we impose a classification consistence constraint (CLC) loss on their predictions between the two domains to address this issue. By integrating the above components, we produce a more efficient and more interpretable unsupervised domain adaptation approach. In sum, the main contributions of this paper include: • We propose a novel adversarial domain adaptation approach, CADIT, to explicitly strive to align the class distributions between the two domains. • To realize the proposed approach, we designed and effectively integrated three novel losses: DSP loss, JAG loss and CLC loss to impose the key requirements. • Both qualitative and quantitative experimental results on multiple benchmark datasets (i.e., Digits, Faces, Scenes and Office31) validate the effectiveness and advantage of the proposed CADIT with respect to the state-of-the-art methods.

II. RELATED WORK
Recently, unsupervised domain adaptation has aroused a great interest of researchers. Existing methods can be roughly classified into two categories as follows.
Deep Domain Adaptation Methods. This category of methods [2], [3], [17] employed deep networks to learn the domain-invariant representation, which is transferable between different domains. Long et al. [1] introduced multiple domain adaptation modules into the high layers of deep convolutional network to match the mean embeddings of distributions according to a maximum mean discrepancy criterion. Afterwards, they [3] proposed a joint maximum mean discrepancy criterion to align the distributions of multiple domain-specific fully connected layers. In [18], an unified deep domain adaptation framework with domain alignment layers was proposed to match the feature distributions between different domains.
Adversarial Domain Adaptation Methods. This category of methods applied GANs to reduce the domain gap. There are several methods [19], [5], [20] that developed the domain-invariant feature generators and a domain discriminator to distinguish their authenticity/fakeness. Tzeng et al. [5] proposed a generalized framework to combine adversarial learning, discriminative feature learning and untied weight sharing. CDAN [6] built a multilinear map of the high-level feature representation and classification prediction between the source and target domains to adapt the map between them. To learn domain-invariant and semantic representations, a graph convolutional adversarial network [21] was built to jointly perform the alignment of data structure, domain and class centroid.

Ct
Real/Fake pseudo-labels Source Labels

Generator from source-to-target
Generator from target-to-source Besides, several other methods [9], [13], [12] conducted adversarial image translation for domain adaptation by generating the source-like or target-like images from real images. Coupled GAN (CoGAN) [22] trained a coupled generative model to learn the joint data distributions of the two domains. UNIT [23] extended CoGAN to learn image translation by integrating variational autoencoder and GAN. ADGAN [9] simultaneously performed image translation and learned the shared feature embedding, by imposing the source and target distributions to be close in a latent space. SBADA [10] employed the structure of CycleGAN for image translation and proposed target self-labeling and class consistence between source domain images and their circle generation results.
Remark. Note that, our method belongs to adversarial image translation for domain adaptation that has a compelling visualization and interpretation of generation results. For the above existing methods (see Table I), these methods ADGAN [9], DupGAN [13], SBADA [10], ACAL [14] only aligned the marginal distributions of samples between the two domains and this, as we have argued, may not be sufficient for reducing domain gap. On the other hand, the two methods [3], [6] attempted to approximately align the joint distributions by aligning the high-level feature representation and the prediction between two domains. However, such an alignment could be affected by the incorrect predictions of target samples, which is effectively mitigated in our method by considering the prediction uncertainty. Also, these two methods did not consider the alignment of the marginal distributions and this will not help to pursue the class distribution alignment. They will be experimentally compared with our method (see Table  ??). Very recently, several works have began to concern the class-level alignment in domain adaption from different aspects [21], [7], [20], [24]. This supports the timeliness and significance of our work from another perspective. At the same time, we highlight that having key differences from our work, these methods are not designed for cross-domain image translation, and do not explicitly strive to align the class distributions as our method either.

III. OUR APPROACH
Formally, given a source domain (without known labels), x s and x t represent the images in the source and target domains, respectively, and y s represents the label of the source domain. In the target domain, the label y t is not available. The sample x s (or x t ) obeys the marginal distribution P (x s ) (or Q(x t )). Its joint distribution with labels and class distribution are denoted as P (x s , y s ) and P (y s |x s ) (or Q(x t , y t ) and Q(y t |x t )), respectively. Due to the discrepancy of the distributions between the two domains, the classifier trained on the source domain cannot be directly applied to the target domain. Thus, the task of UDA is to reduce the domain discrepancy to improve the generalization of the classifier on target samples. To achieve this, existing methods usually align either marginal or joint distributions by various strategies. Differently, we propose to align both of them in order to make the corresponding class distributions well matched, and this is implemented by conducting GAN-based image translation between the two domains.
Specifically, we design two GANs (G t , D t ) and (G s , D s ) to generate a target-like sample G t (x s ) from the source sample x s and a source-like sample G s (x t ) from the target sample x t . For simplified notation, G t (x s ) and G s (x t ) are abbreviated aŝ x st andx ts , respectively. Then, the image translation between the two domains is realized by: align to Q(x t ) (in the target domain), and Q(x ts ) (translated from the target domain) align to P (x s ) (in the source domain), as well as ensuringx st to be well associated with its own source label y s ; (2) (joint distribution alignment) making the joint distribution P (x st , y s ) (translated from the source domain) align to the joint distribution Q(x t , y t ) (in the target domain), and Q(x ts , y t ) (translated from the target domain) align to P (x s , y s ) (in the source domain).
By enforcing the two alignments in steps (1) and (2), we can expect the corresponding class distributions P (y s |x st ) and Q(y t |x t ) (or Q(y t |x ts ) and P (y s |x s )) to be better matched after image translation. In turn, this will make the classifier trained by the labeled samples (translated from the source domain) more applicable to classify the unlabeled target samples.
The framework diagram of our method is depicted in Fig. 2 with three following parts: (1) a discriminative cycle-consistent GAN with two generators and two discriminators to align the marginal distributions between the two domains after image translation, (2) a joint adversarial generation (JAG) loss in each discriminator to align the joint distributions of samples and their labels between the two domains, and (3) a discriminative structure-preserving (DSP) loss and a classification consistence (CLC) loss to prevent label flipping and enhance the classification performance. They are detailed as follows.

A. Discriminative Cycle-consistent GAN
To align the marginal distributions, we adopt widely-used CycleGAN [16] as a base network to realize our method, due to its success on image-to-image translation. CycleGAN is used to build the two generators G t and G s to learn two source-to-target and target-to-source mapping respectively: G t : x s → x t and G s : x t → x s , where a target-like imagex st (or a source-like imagex ts ) is generated to adapt to real images x t (or x s ). To reduce the feasible region of mapping functions, a cycle-consistent loss is used to make Meanwhile, against G s and G t , the two discriminators D s and D t are designed to distinguish the authenticity or fakeness of images in both the domains, respectively. Moreover, to simultaneously perform the image translation and classification, we additionally design two classifiers C s and C t based on their discriminators. Accordingly, the adversarial generation loss in the target domain can be written as: where L ce (·) represents the cross-entropy loss to train the classifier C t in the target domain by using the samplesx st translated from source-to-target. Likewise, in the source domain, the classifier C s is trained by the real source samples x s . Also, the adversarial generation loss in the source domain can be written as: Also, as in CycleGAN, the cycle-consistent loss is calculated as: DSP Loss. Since CycleGAN is originally designed for unsupervised image translation, it does not guarantee to maintain the label of images during image translation, which is however important for our alignment. As a result, an imagex st (translated from source-to-target) could be misaligned with its source domain label y s . To prevent the label flipping (ensuring the label consistence before and after image translation), we propose a discriminative structure-preserving (DSP) loss to make the generated images (from source-to-target) preserve their discriminative class structure in the source domain: where d(x i st ,x j st ) represents the distance between any two generated imagesx i st andx j st (from source-to-target), calculated by Euclidean distance of their features. W ij is the weight between them (1 for the same class, -1 for different classes), according to their source domain labels. In this way, the generated images are encouraged to be similar when they belong to a same class and dissimilar otherwise. Thus, a generated image is subject to other generated images during image translation, so its label is difficult to be flipped, which has also been validated in the experiments (see Fig. 5 and Tables VII-VIII).
CLC Loss. As shown above, during domain adaptation, the two classifiers C t and C s are used to predict the labels of target sample x t and its generated samplex ts (from target-to-source), respectively. Since the two classifiers could be affected by the image translation and thus produce inconsistent classification predictions, we impose a classification consistence constraint (CLC) loss on their predictions to aid the classifier training as: Obviously, the CLC loss is also useful to prevent the label flipping during image transaltion. Note that since the predictions of source samples in the two classifiers are constrained by their labels in Eqs.(1)(2), their consistence constraint is safely omitted.

B. Joint Adversarial Generation
To align the joint distributions, based on CycleGAN, we develop two novel joint discriminators J t and J s in the two domains to jointly distinguish the authenticity/fakeness of samples and labels.
JAG Loss. Note that the true label y t of target sample x t is not available during training, so we adopt the classification prediction C t (x t ) as its pseudo-label. However, the pseudolabels may be incorrect that could affect the alignment of the joint distributions. To alleviate the impact of false pseudolabeled samples, we expect to set higher confidence weight for more reliable pseudo-labels that are encouraged to contribute more to the joint distribution alignment. Inspired by entropy minimization to handle the uncertainty, we design an entropybased confidence weight γ(x t ) = 1 − H(x t )/ log C for x t and its pseudo-label, where H(x t ) is the entropy of its prediction probabilities on all classes, and C is the number of classes.
In the joint discriminator J t of the target domain, we expect to align the joint distributions of real and generated images (from source-to-target) associated with their respective labels, and thus design a joint adversarial generation (JAG) loss in the target domain as: where the paired samples and labels (x st , y s ) or (x t , C t (x t )) are simultaneously fed into the joint discriminator J t to distinguish the authenticity/fakeness. The lower the weight γ(x t ), the less the target sample x t works. On the contrary, those target samples with higher weight are more useful to align the joint distributions. Likewise, in the joint discriminator J s of the source domain, we also introduce the entropy-based confidence weight γ(x ts ) to balance its possibly-incorrect pseudo-label. Thus, the JAG loss in the source domain can be written as: L JGANs (G s , J s , C s ) = E (xs,ys)∼P (xs,ys) [log J s (x s , y s )] + E (xts,yt)∼Q(xts,yt) [γ(x ts ) log(1 − J s (x ts , C s (x ts )))].

C. Main Objective
In summary, to effectively align the class distributions for domain adaptation, we integrate the aforementioned seven terms in Eqs. (1)-(7) into a whole objective function as below: where parameters λ 1 , λ 2 , λ 3 are the weight of cycle-consistent term (for image translation), CLC loss term (for target samples translated from target-to-source), and DSP loss term (for source samples translated from source-to-target), respectively. For the values of λ 1 , λ 2 , λ 3 in the experiments, we empirically set them as (5, 0.1, 10 -4 ) for Digits, (10, 0.5, 10 -3 ) for Faces and Scenes, and (10, 10 -3 , 10 -4 ) for Office31 respectively. Also, we found that our method is robust against the variation of three parameters.
Note that in Eq. (8), two generators G s , G t and two classifiers C s , C t are solved by minimizing the above objective, while four discriminators D s , J s , D t and J t are solved by maximizing the above objective. As the traditional GAN, the generators and discriminators are trained in an adversarial manner, and they are optimized alternately. In the training phase, the labeled source samples and unlabeled target samples are used to train our model. In the testing phase, we adopt the learned classifier C t to predict the labels of the unlabeled target samples.
Network Architecture. We implement our method CADIT using PyTorch on a single NVIDIA GeForce GTX 2080TI GPU. For the generators G s and G t , we adopt two different network structures on all the datasets due to their different image sizes. For Digits, we construct them by designing a simple two-layer convolutions and two-layer deconvolutions. For the other datasets, we apply the same architecture of the generators as that in CycleGAN, which contains two stride-2 convolutions, six residual blocks, and two fractionally-strided convolutions with stride 1/2. For the discriminators, we adopt a same network structure in all the datasets, which includes a common part and three different branches, as shown in Fig. 2. The common part is implemented by two stride-2 convolutions and a fully-connection layer with the LeakyReLU activation, and all the three branches are a specific fully-connected layer. Also, for the adversarial generation loss function in D s , J s , D t , J t , we adopt mean squared error (MSE) loss for training.
Network Training. We use the Adam solver [25] with the related gradient weights of 0.5 and 0.999 to train our model. The base learning rate is initially set as 0.002, and then decreases from 0.002 to 0.0002 as the number of iterations increases. The batch size is set as 64 for Digits, 8 for Faces and Scenes, and 6 for Office31, respectively. To reduce the training time on Faces and Scenes, we first train the CycleGAN network (by setting λ 1 as 10) to initialize our generators, and then alternately optimize our generators and discriminators.

IV. EXPERIMENTS
We evaluate the performance of our method on unsupervised domain adaptation for image classification. The experiments are conducted on three domain adaptation datasets: (1) Digits, (2) Faces, and (3) Scenes. For all the experiments, we follow the standard unsupervised protocol: using the entire labeled samples in the source domain and unlabeled samples in the target domain. It is worth noting that the samples between the two domains are not paired. Also, the labels of samples in the target domain are not available during the training phase.

A. Digits: MNIST↔USPS
For Digits, MNIST and USPS, two widely-used handwritten digit image datasets are viewed as two different domains. Following the same protocol in [26], [27], we randomly sample 2,000 images in MNIST and 1,800 images in USPS to construct the source/target-domain dataset, and uniformly rescale all images to the size of 16×16. We test two domain adaptation settings: (1) MNIST→USPS (abbreviated as M→U), and (2) USPS→MNIST (abbreviated as U→M). In each setting, we apply the learned classifier C t for digital image recognition (0-9) in the target domain.  We compare our method with fifteen representative UDA baselines: four traditional domain adaptation methods (JDA [26], TJM [27], JGSA [28], and TPN [17]), three deep domain adaptation methods (DANN [29], DRCN [30], and JAN [3]), four adversarial domain adaptation methods (ADDA [5], CDAN [6], RAAN [31] and MCD [32]), and four related adversarial image translation methods (CoGAN [22], ADGAN [9], CDRD [33] and SBADA [10]). Table II reports the average accuracy results,in which JAN, CDAN and SBADA were experimented by the publicly released codes, and the other twelve methods were reported by the literature. For fair comparison, the baselines applied the same protocol of data as our method (using randomly sampled 2000/1800 images instead of the entire training sets). As observed, our method shows the best performance in both settings and the average. This verifies the effectiveness of our method.
Also, we show the t-SNE results of M→U for different adversarial image translation methods in Fig. 3. Specifically, we compare the real and generated images for CycleGAN, SBADA and CADIT, and compare the generated images from both domains for ADGAN. Due to their small size and grayscale intensity, we simply project their intensity values to 2D embedding space as same as SBADA [10]. It is observed that the samples between the two domains are not aligned before image translation (see Fig. 3(a)), while the samples after image translation via our method are best aligned and clustered than the other methods (see Fig. 3(b)-(e)). Although the results of ADGAN show a good cluster structure, they are not well aligned between the two domains. This indicates that the class distributions between the two domains are well aligned in our method. In addition, we show the visualization results of typical examples in image translation between MNIST and USPS in Fig. 4. As observed, the generated images can well capture the style of digital images in the current domain.

B. Digits: SVHN↔MNIST
SVHN [34] was obtained by cropping house numbers in Google Street View images, and contains over 600k color images with a large variety of shapes and textures. Following the protocol [5], we use the entire training data of SVHN and MNIST as two domains, and test two settings: (1)  MNIST→SVHN (abbreviated as M→S), which presents a more challenging case of domain adaptation due to larger domain gap than M↔U.
We compare our method with nine representative UDA baselines: five deep/adversarial domain adaptation methods (DANN [29], DRCN [30], ADDA [5], JAN [3], and CDAN [6]) and four latest and related adversarial image translation methods (ADGAN [9], SBADA [10], CyCADA [11], and ACAL [14]). For fair comparison, the baselines applied the same protocol of data with our method. We evaluate the performance of JAN and CDAN by their publicly released codes and meanwhile report the best results of the other seven methods in the literature in Table III, compared with our method. As observed, the M→S and average result of our method outperform the rest baselines. In addition, we show the visualization results of typical examples in image translation from SVHN to MNIST by using three different methods (SBADA, ACAL and CADIT) in Fig. 5. As observed, during image translation via SBADA, the labels of some digits are changed, e.g., '4' is often translated to '6', '1' is often translated to '9'. For ACAL, all the images of '2' are translated to '7'-like images, which make them difficult to distinguish. Also, all the images of '4' are not well generated. Compared with SBADA and ACAL, our CADIT can effectively prevent label flipping by using the proposed DSP loss, and most of the generated digits seem more clear and better generated.

C. Faces: Photo→Sketch
For Faces, we use facial photo and sketch images as the source and target domains, respectively. Inspired by [33], we construct a facial photo/sketch dataset by using the CelebA dataset [35] that contains more than 200K celebrity photos an- notated with forty facial attributes. Specifically, we randomly select half of the CelebA dataset as the source domain, and then convert the other half into sketch images by using the method in [36] for the target domain. Since the number of attributes is large, we choose three common and representative attributes: "glasses", "smiling" and "male" (similar with that in [33]) to perform three individual binary classification tasks.
These tasks are to recognize if a target sketch image has the corresponding attribute, respectively, following the standard UDA setting. We compare our method with eight latest and most-related methods, JAN [3], CDAN [6], ADGAN [9], DupGAN [13], SBADA [10], DWT [18], ACAL [14] and JDDA [7]. For fair comparison, we test these methods by utilizing their released source codes and learning the best parameters. The average classification results of five independent runs on facial images are recorded in Table IV. As observed, CADIT obtains the highest accuracy in all the compared methods for the three classification tasks, which shows that our method with jointly aligning the marginal and joint distributions is very effective for classifying target samples again. Also, the visualization results of typical examples in facial image translation from photo to sketch are illustrated in Fig. 6. The generated sketchlike images are clear and realistic, which shows that our method has a promising visualization performance during adaptation besides its superior classification performance.

D. Scenes: Photo→Painting
For Scenes, we use scene photo and painting images as the source and target domains, respectively. We collect 1,838 scene photo images from the publicly accessible dataset 2 , and then randomly select half of the photo collection as the source domain. Afterwards, we construct painting images by applying the method in [36] on the rest half of the photo collection for the target domain. For performance evaluation, these scene images are manually labeled with three interest attributes: "night", "winter", and "mountain". Then, we test three binary classification tasks with UDA setting: using labeled source photo images to recognize target painting images with the corresponding attribute, respectively. We compare CADIT with the eight related methods (same as Faces) on Scenes. The average classification results of five independent runs are recorded in Table V. It is observed that CADIT achieves the highest accuracy against the other methods for all the three classification tasks, which validates the efficacy of our method again. Also, Fig. 7 (3) DSLR, which are abbreviated as A, W and D, respectively. Amazon images is downloaded from online merchants, Webcam images are with low-resolution by a web camera, and DSLR images are with high-resolution by a digital SLR camera. We only focus on four challenging unsupervised domain adaption tasks among the three domains: A→W, W→A, A→D and D→A. To alleviate the effect of the illgenerated images on classification, we train a classifier on the feature map learned by the generator, as in ADGAN [9]. For good performance, we initialize the generators G s , G t by using the pre-trained ResNet-50 model trained on Imagenet.
We compare our method with seven latest and most-related methods, DANN [29], ADDA [5], JAN [3], CDAN [6], ADGAN [9], and JDDA [7]. For fair comparison, we apply the standard protocol for unsupervised domain adaptation same as the baselines, and use all labeled source data and all unlabeled target data for experiments. We evaluate the averaged classification results of our method on three independent runs and report the best results of the baselines in the literature in Table  VI. As observed, our method performs best in the two tasks (W→A and W→D), and is comparable with CDAN in the averaged results. their nine different combinations on Digits, Faces and Scenes in Tables VII and VIII, respectively. We observe that the more terms are added, the better the performance is. Also, our method (Row 9) shows the best performance among all the methods.
(1) Specifically, the first three rows show that bi-directional cycle-consistent GAN outperforms the single source-totarget or target-to-source ones; (2) Rows 4-6 show that the addition of the CLC loss and JAG loss brings a large performance improvement, respectively; (3) Rows 7-9 show that using an entropy-based confidence weight (γ ≤ 1) to measure the reliability of predicting target samples is useful to align the joint distributions, and the DSP loss also presents a significant effect to enhance the performance of our method; (4) In addition, comparing all these methods, we notice that introducing L JGAN t/s (comparing Rows 3 and 5) into our method achieves the most significant performance improvement in all terms, which implies that applying JAG loss for the joint distribution alignment is most effective to reduce the classification deviation caused by domain gap. In sum, the results of Tables VII and VIII show that all the proposed loss terms are useful, and they collectively form an effective solution of UDA.
2) Distribution Discrepancy:  [15], [29], the proxy A-distance is adopted in our experiments, and the lower the A-distance, the less the domain discrepancy. The A-distance can be calculated as d A = 2(1 − 2 ), where is the generalization error of the domain classifier [29]. Fig. 8 depicts the A-distance of all the five methods. As observed, d A in our CADIT is lower than those in other four methods for all the tasks, which again indicates that our method can effectively reduce the domain discrepancy.

V. CONCLUSION
We present a novel method to simultaneously align the joint and marginal distributions between domains for adversarial image translation in order to better match the class distributions that is important for classification. Specifically, we develop the JAG loss, DSP loss and CLC loss on top of the structure of CycleGAN. Extensive experiments validate that our method achieves the outstanding performance in Faces and Scenes and the competitive results in Digits and Office31, compared with the state-of-the-arts. Also, the ablation study