Image-to-image translation aims to learn the mapping between two visual domains. There are two main challenges for many applications: 1) the lack of aligned training pairs and 2) multiple possible outputs from a single input image. In this work, we present an approach based on disentangled representation for producing diverse outputs without paired training images. To achieve diversity, we propose to embed images onto two spaces: a domain-invariant content space capturing shared information across domains and a domain-specific attribute space. Our model takes the encoded content features extracted from a given input and the attribute vectors sampled from the attribute space to produce diverse outputs at test time. To handle unpaired training data, we introduce a novel cross-cycle consistency loss based on disentangled representations. Qualitative results show that our model can generate diverse and realistic images on a wide range of tasks without paired training data. For quantitative comparisons, we measure realism with user study and diversity with a perceptual distance metric. We apply the proposed model to domain adaptation and show competitive performance when compared to the state-of-the-art on the MNIST-M and the LineMod datasets.READ FULL TEXT VIEW PDF
Image-to-image translation aims to learn the mapping between two visual
Image-to-image translation has drawn great attention during the past few...
Many image-to-image (I2I) translation problems are in nature of high
Sequential data often originates from diverse domains across which
Image deblurring aims to restore the latent sharp images from the
Recently, a multitude of methods for image-to-image translation has
Many image processing tasks can be formulated as translating images betw...
Image-to-Image (I2I) translation aims to learn the mapping between different visual domains. Many vision and graphics problems can be formulated as I2I translation problems, such as colorization[23, 46] (grayscale
color), super-resolution[25, 22, 26] (low-resolution high-resolution), and photorealistic image synthesis [6, 42] (label image). Furthermore, I2I translation has recently shown promising results in facilitating domain adaptation [3, 36, 16, 32].
Learning the mapping between two visual domains is challenging for two main reasons. First, aligned training image pairs are either difficult to collect (e.g., day scene night scene) or do not exist (e.g., artwork real photo). Second, many such mappings are inherently multimodal — a single input may correspond to multiple possible outputs. To handle multimodal translation, one possible approach is to inject a random noise vector to the generator for modeling the data distribution in the target domain. However, mode collapse may still occur easily since the generator often ignores the additional noise vectors.
Several recent efforts have been made to address these issues. Pix2pix  applies conditional generative adversarial network to I2I translation problems. Nevertheless, the training process requires paired data. A number of recent work [48, 27, 44, 38, 9] relaxes the dependency on paired training data for learning I2I translation. These methods, however, produce a single output conditioned on the given input image. As shown in [18, 49], simply incorporating noise vectors as additional inputs to the generator does not lead the increased variations of the generated outputs due to the mode collapsing issue. The generators in these methods are inclined to overlook the added noise vectors. Very recently, BicycleGAN  tackles the problem of generating diverse outputs in I2I problems by encouraging the one-to-one relationship between the output and the latent vector. Nevertheless, the training process of BicycleGAN requires paired images.
In this paper, we propose a disentangled representation framework for learning to generate diverse outputs with unpaired training data. Specifically, we propose to embed images onto two spaces: 1) a domain-invariant content space and 2) a domain-specific attribute space as shown in Figure 2. Our generator learns to perform I2I translation conditioned on content features and a latent attribute vector. The domain-specific attribute space aims to model the variations within a domain given the same content, while the domain-invariant content space captures information across domains. We achieve this representation disentanglement by applying a content adversarial loss to encourage the content features not to carry domain-specific cues, and a latent regression loss to encourage the invertible mapping between the latent attribute vectors and the corresponding outputs. To handle unpaired datasets, we propose a cross-cycle consistency loss using the disentangled representations. Given a pair of unaligned images, we first perform a cross-domain mapping to obtain intermediate results by swapping the attribute vectors from both images. We can then reconstruct the original input image pair by applying the cross-domain mapping one more time and use the proposed cross-cycle consistency loss to enforce the consistency between the original and the reconstructed images. At test time, we can use either 1) randomly sampled vectors from the attribute space to generate diverse outputs or 2) the transferred attribute vectors extracted from existing images for example-guided translation. Figure 1 shows examples of the two testing modes.
We evaluate the proposed model through extensive qualitative and quantitative evaluation. In a wide variety of I2I tasks, we show diverse translation results with randomly sampled attribute vectors and example-guided translation with transferred attribute vectors from existing images. We evaluate the realism of our results with a user study and the diversity using perceptual distance metrics . Furthermore, we demonstrate the potential application of unsupervised domain adaptation. On the tasks of adapting domains from MNIST  to MNIST-M  and Synthetic Cropped LineMod to Cropped LineMod [15, 43], we show competitive performance against state-of-the-art domain adaptation methods.
|Method||Pix2Pix ||CycleGAN ||UNIT ||BicycleGAN ||Ours|
We make the following contributions:
1) We introduce a disentangled representation framework for image-to-image translation. We apply a content discriminator to facilitate the factorization of domain-invariant content space and domain-specific attribute space, and a cross-cycle consistency loss that allows us to train the model with unpaired data.
2) Extensive qualitative and quantitative experiments show that our model compares favorably against existing I2I models. Images generated by our model are both diverse and realistic.
3) We demonstrate the application of our model on unsupervised domain adaptation. We achieve competitive results on both the MNIST-M and the Cropped LineMod datasets.
Our code, data and more results are available at https://github.com/HsinYingLee/DRIT/.
Generative adversarial networks. Recent years have witnessed rapid progress on generative adversarial networks (GANs) [14, 34, 2] for image generation. The core idea of GANs lies in the adversarial loss that enforces the distribution of generated images to match that of the target domain. The generators in GANs can map from noise vectors to realistic images. Several recent efforts explore conditional GAN in various contexts including conditioned on text , low-resolution images , video frames , and image . Our work focuses on using GAN conditioned on an input image. In contrast to several existing conditional GAN frameworks that require paired training data, our model produces diverse outputs without paired data. This suggests that our method has wider applicability to problems where paired training datasets are scarce or not available.
Image-to-image translation. I2I translation aims to learn the mapping from a source image domain to a target image domain. Pix2pix  applies a conditional GAN to model the mapping function. Although high-quality results have been shown, the model training requires paired training data. To train with unpaired data, CycleGAN , DiscoGAN , and UNIT  leverage cycle consistency to regularize the training. However, these methods perform generation conditioned solely on an input image and thus produce one single output. Simply injecting a noise vector to a generator is usually not an effective solution to achieve multimodal generation due to the lack of regularization between the noise vectors and the target domain. On the other hand, BicycleGAN  enforces the bijection mapping between the latent and target space to tackle the mode collapse problem. Nevertheless, the method is only applicable to problems with paired training data. Table 1 shows a feature-by-feature comparison among various I2I models. Unlike existing work, our method enables I2I translation with diverse outputs in the absence of paired training data.
Very recently, several concurrent works [1, 17, 5, 29] (all independently developed) also adopt a disentangled representation similar to our work for learning diverse I2I translation from unpaired training data. We encourage the readers to review these works for a complete picture.
Disentangled representations. The task of learning disentangled representation aims at modeling the factors of data variations. Previous work makes use of labeled data to factorize representations into class-related and class-independent components [8, 21, 30, 31]. Recently, the unsupervised setting has been explored [7, 10]. InfoGAN  achieves disentanglement by maximizing the mutual information between latent variables and data variation. Similar to DrNet  that separates time-independent and time-varying components with an adversarial loss, we apply a content adversarial loss to disentangle an image into domain-invariant and domain-specific representations to facilitate learning diverse cross-domain mappings.
Domain adaptation techniques focus on addressing the domain-shift problem between a source and a target domain. Domain Adversarial Neural Network (DANN)[11, 13] and its variants [40, 4, 39] tackle domain adaptation through learning domain-invariant features. Sun et al.  aims to map features in the source domain to those in the target domain. I2I translation has been recently applied to produce simulated images in the target domain by translating images from the source domain [11, 16]. Different from the aforementioned I2I based domain adaptation algorithms, our method does not utilize source domain annotations for I2I translation.
Our goal is to learn a multimodal mapping between two visual domains and without paired training data. As illustrated in Figure 3, our framework consists of content encoders , attribute encoders , generators , and domain discriminators for both domains, and a content discriminators . Take domain as an example, the content encoder maps images onto a shared, domain-invariant content space () and the attribute encoder maps images onto a domain-specific attribute space (). The generator generates images conditioned on both content and attribute vectors (). The discriminator aims to discriminate between real images and translated images in the domain . Content discriminator
is trained to distinguish the extracted content representations between two domains. To enable multimodal generation at test time, we regularize the attribute vectors so that they can be drawn from a prior Gaussian distribution.
In this section, we first discuss the strategies used to disentangle the content and attribute representations in Section 3.1 and then introduce the proposed cross-cycle consistency loss that enables the training on unpaired data in Section 3.2
. Finally, we detail the loss functions in Section3.3.
Our approach embeds input images onto a shared content space , and domain-specific attribute spaces, and . Intuitively, the content encoders should encode the common information that is shared between domains onto , while the attribute encoders should map the remaining domain-specific information onto and .
To achieve representation disentanglement, we apply two strategies: weight-sharing and a content discriminator. First, similar to , based on the assumption that two domains share a common latent space, we share the weight between the last layer of and and the first layer of and . Through weight sharing, we force the content representation to be mapped onto the same space. However, sharing the same high-level mapping functions cannot guarantee the same content representations encode the same information for both domains. Therefore, we propose a content discriminator which aims to distinguish the domain membership of the encoded content features and . On the other hand, content encoders learn to produce encoded content representations whose domain membership cannot be distinguished by the content discriminator . We express this content adversarial loss as:
With the disentangled representation where the content space is shared among domains and the attribute space encodes intra-domain variations, we can perform I2I translation by combining a content representation from an arbitrary image and an attribute representation from an image of the target domain. We leverage this property and propose a cross-cycle consistency. In contrast to cycle consistency constraint in  (i.e., ) which assumes one-to-one mapping between the two domains, the proposed cross-cycle constraint exploit the disentangled content and attribute representations for cyclic reconstruction.
Our cross-cycle constraint consists of two stages of I2I translation.
Forward translation. Given a non-corresponding pair of images and , we encode them into and . We then perform the first translation by swapping the attribute representation (i.e., and ) to generate , where .
Backward translation. After encoding and into and , we perform the second translation by once again swapping the attribute representation (i.e., and ).
Here, after two I2I translation stages, the translation should reconstruct the original images and (as illustrated in Figure 3). To enforce this constraint, we formulate the cross-cycle consistency loss as:
where and .
Other than the proposed content adversarial loss and cross-cycle consistency loss, we also use several other loss functions to facilitate network training. We illustrate these additional losses in Figure 4. Starting from the top-right, in the counter-clockwise order:
Domain adversarial loss. We impose adversarial loss where and attempt to discriminate between real images and generated images in each domain, while and attempt to generate realistic images.
Self-reconstruction loss. In addition to the cross-cycle reconstruction, we apply a self-reconstruction loss to facilitate the training. With encoded content/attribute features and , the decoders and should decode them back to original input and . That is, and .
KL loss. In order to perform stochastic sampling at test time, we encourage the attribute representation to be as close to a prior Gaussian distribution. We thus apply the loss , where .
Latent regression loss. To encourage invertible mapping between the image and the latent space, we apply a latent regression loss similar to . We draw a latent vector from the prior Gaussian distribution as the attribute representation and attempt to reconstruct it with and .
The full objective function of our network is:
where the hyper-parameters s control the importance of each term.
We implement our model with PyTorch. We use the input image size of for all of our experiments except domain adaptation. For the content encoder , we use an architecture consisting of three convolution layers followed by four residual blocks. For the attribute encoder , we use a CNN architecture with four convolution layers followed by fully-connected layers. We set the size of the attribute vector to for all experiments. For the generator
, we use an architecture containing four residual blocks followed by three fractionally strided convolution layers. For more details of architecture design, please refer to the supplementary material.
For training, we use the Adam optimizer  with a batch size of , a learning rate of , and exponential decay rates . In all experiments, we set the hyper-parameters as follows: , , , , , and . We also apply an L1 weight regularization on the content representation with a weight of . We follow the procedure in DCGAN  for training the model with adversarial loss.
Datasets. We evaluate our model on several datasets include Yosemite  (summer and winter scenes), artworks  (Monet and van Gogh), edge-to-shoes  and photo-to-portrait cropped from subsets of the WikiArt dataset 111https://www.wikiart.org/ and the CelebA dataset . We also perform domain adaptation on the classification task with MNIST  to MNIST-M 
, and on the classification and pose estimation tasks with Synthetic Cropped LineMod to Cropped LineMod[15, 43].
Compared methods. We perform the evaluation on the following algorithms:
DRIT: We refer to our proposed model, Disentangled Representation for Image-to-Image Translation, as DRIT.
DRIT w/o : Our proposed model without the content discriminator.
Cycle/Bicycle: As there is no previous work addressing the problem of multimodal generation from unpaired training data, we construct a baseline using a combination of CylceGAN and BicycleGAN. Here, we first train CycleGAN on unpaired data to generate corresponding images as pseudo image pairs. We then use this pseudo paired data to train BicycleGAN.
|real images||.448 .012|
|DRIT w/o||.410 .016|
|UNIT ||.406 .022|
|CycleGAN ||.413 .008|
Diversity. We first demonstrate the diversity of the generated images on several different tasks in Figure 5. In Figure 6, we compare the proposed model with other methods. Both our model without and Cycle/Bicycle can generate diverse results. However, the results contain clearly visible artifacts. Without the content discriminator, our model fails to capture domain-related details (e.g., the color of tree and sky). Therefore, the variations take place in global color difference. Cycle/Bicycle is trained on pseudo paired data generated by CycleGAN. The quality of the pseudo paired data is not uniformly ideal. As a result, the generated images are of ill-quality.
To have a better understanding of the learned domain-specific attribute space, we perform linear interpolation between two given attributes and generate the corresponding images as shown in Figure 7. The interpolation results verify the continuity in the attribute space and show that our model can generalize in the distribution, rather than memorize trivial visual information.
Attribute transfer. We demonstrate the results of the attribute transfer in Figure 8. Thanks to the representation disentanglement of content and attribute, we are able to perform attribute transfer from images of desired attributes, as illustrated in Figure 3(c). Moreover, since the content space is shared between two domains, we can generate images conditioned on content features encoded from either domain. Thus our model can achieve not only inter-domain but also intra-domain attribute transfer. Note that intra-domain attribute transfer is not explicitly involved in the training process.
Realism vs. diversity. Here we have the quantitative evaluation on the realism and diversity of the generated images. We conduct the experiment using winter summer translation with the Yosemite dataset. For realism, we conduct a user study using pairwise comparison. Given a pair of images sampled from real images and translated images generated from various methods, users need to answer the question “Which image is more realistic?” For diversity, similar to , we use the LPIPS metric  to measure the similarity among images. We compute the distance between 1000 pairs of randomly sampled images translated from 100 real images.
Figure 9 and Table 3 show the results of realism and diversity, respectively. UNIT obtains low realism score, suggesting that their assumption might not be generally applicable. CycleGAN achieves the highest scores in realism, yet the diversity is limited. The diversity and the visual quality of Cycle/Bicycle are constrained by the data CycleGAN can generate. Our results also demonstrate the need for the content discriminator.
Reconstruction ability. In addition to diversity evaluation, we conduct an experiment on the edge-to-shoes dataset to measure the quality of the disentangled encoding. Our model was trained using unpaired data. At test time, given a paired data , we can evaluate the quality of content-attribute disentanglement by measuring the reconstruction errors of with .
We compare our model with BicycleGAN, which requires paired data during training. Table 3 shows our model performs comparably with BicycleGAN despite training without paired data. Moreover, the result suggests that the content discriminator contributes greatly to the quality of disentangled representation.
We demonstrate that the proposed image-to-image translation scheme can benefit unsupervised domain adaptation. Following PixelDA , we conduct experiments on the classification and pose estimation tasks using MNIST  to MNIST-M , and Synthetic Cropped LineMod to Cropped LineMod [15, 43]. Several example images in these datasets are shown in Figure 10
(a) and (b). To evaluate our method, we first translate the labeled source images to the target domain. We then treat the generated labeled images as training data and train the classifiers of each task in the target domain. For a fair comparison, we use the classifiers with the same architecture as PixelDA. We compare the proposed method with CycleGAN, which generates the most realistic images in the target domain according to our previous experiment, and three state-of-the-art domain adaptation algorithms: PixelDA, DANN and DSN .
We present the quantitative comparisons in Table 4 and visual results from our method in Figure 10(c)(d). Since our model can generate diverse output, we generate one time, three times, and five times (denoted as ) of target images using the same amount of source images. Our results validate that the proposed method can simulate diverse images in the target domain and improve the performance in target tasks. While our method does not outperform PixelDA, we note that unlike PixelDA, we do not leverage label information during training. Compared to CycleGAN, our method performs favorably even with the same amount of generated images (i.e., ). We observe that CycleGAN suffers from the mode collapse problem and generates images with similar appearances, which degrade the performance of the adapted classifiers.
Our method has the following limitations. First, due to the limited amount of training data, the attribute space is not fully exploited. Our I2I translation fails when the sampled attribute vectors locate in under-sampled space, see Figure 11(a). Second, it remains difficult when the domain characteristics differ significantly. For example, Figure 11(b) shows a failure case on the human figure due to the lack of human-related portraits in Monet collections.
In this paper, we present a novel disentangled representation framework for diverse image-to-image translation with unpaired data. we propose to disentangle the latent space to a content space that encodes common information between domains, and a domain-specific attribute space that can model the diverse variations given the same content. We apply a content discriminator to facilitate the representation disentanglement. We propose a cross-cycle consistency loss for cyclic reconstruction to train in the absence of paired data. Qualitative and quantitative results show that the proposed model produces realistic and diverse images. We also apply the proposed method to domain adaptation and achieve competitive performance compared to the state-of-the-art methods.
This work is supported in part by the NSF CAREER Grant #1149783, the NSF Grant #1755785, and gifts from Verisk, Adobe and Nvidia.
Denton, E.L., Birodkar, V.: Unsupervised learning of disentangled representations from video. In: NIPS (2017)
Ganin, Y., Lempitsky, V.: Unsupervised domain adaptation by backpropagation. In: ICML (2015)
Isola, P., Zhu, J.Y., Zhou, T., Efros, A.A.: Image-to-image translation with conditional adversarial networks. In: CVPR (2017)
Kingma, D.P., Rezende, D., Mohamed, S.J., Welling, M.: Semi-supervised learning with deep generative models. In: NIPS (2014)
Liu, Z., Luo, P., Wang, X., Tang, X.: Deep learning face attributes in the wild. In: ICCV (2015)
Makhzani, A., Shlens, J., Jaitly, N., Goodfellow, I., Frey, B.: Adversarial autoencoders. In: ICLR workshop (2016)