Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks

Unpaired Image-to-Image Translation
using Cycle-Consistent Adversarial Networks

Jun-Yan Zhu empty    Taesung Park11footnotemark: 1    Phillip Isola    Alexei A. Efros    Berkeley AI Research (BAIR) laboratory, UC Berkeley

Image-to-image translation is a class of vision and graphics problems where the goal is to learn the mapping between an input image and an output image using a training set of aligned image pairs. However, for many tasks, paired training data will not be available. We present an approach for learning to translate an image from a source domain to a target domain in the absence of paired examples. Our goal is to learn a mapping such that the distribution of images from is indistinguishable from the distribution using an adversarial loss. Because this mapping is highly under-constrained, we couple it with an inverse mapping and introduce a cycle consistency loss to enforce (and vice versa). Qualitative results are presented on several tasks where paired training data does not exist, including collection style transfer, object transfiguration, season transfer, photo enhancement, etc. Quantitative comparisons against several prior methods demonstrate the superiority of our approach.

Figure 1: Given any two unordered image collections and , our algorithm learns to automatically “translate” an image from one into the other and vice versa: (left) Monet paintings and landscape photos from Flickr; (center) zebras and horses from ImageNet; (right) summer and winter Yosemite photos from Flickr. Example application (bottom): using a collection of paintings of famous artists, our method learns to render natural photographs into the respective styles.

1 Introduction

What did Claude Monet see as he placed his easel by the bank of the Seine near Argenteuil on a lovely spring day in 1873 (Figure 1, top-left)? A color photograph, had it been invented, may have documented a crisp blue sky and a glassy river reflecting it. Monet conveyed his impression of this same scene through wispy brush strokes and a bright palette.* indicates equal contribution

What if Monet had happened upon the little harbor in Cassis on a cool summer evening (Figure 1, bottom-left)? A brief stroll through a gallery of Monet paintings makes it possible to imagine how he would have rendered the scene: perhaps in pastel shades, with abrupt dabs of paint, and a somewhat flattened dynamic range.

Figure 2: Paired training data (left) consists of training examples , where the correspondence between and exists [21]. We instead consider unpaired training data (right), consisting of a source set () and a target set (), with no information provided as to which matches which .

We can imagine all this despite never having seen a side by side example of a Monet painting next to a photo of the scene he painted. Instead we have knowledge of the set of Monet paintings and of the set of landscape photographs. We can reason about the stylistic differences between these two sets, and thereby imagine what a scene might look like if we were to “translate” it from one set into the other.

In this paper, we present a method that can learn to do the same: capturing special characteristics of one image collection and figuring out how these characteristics could be translated into the other image collection, all in the absence of any paired training examples.

This problem can be more broadly described as image-to-image translation [21], converting an image from one representation of a given scene, , to another, , e.g., grayscale to color, image to semantic labels, edge-map to photograph. Years of research in computer vision, image processing, computational photography, and graphics have produced powerful translation systems in the supervised setting, where example image pairs are available (Figure 2, left), e.g., [10, 18, 21, 22, 26, 31, 44, 55, 57, 61]. However, obtaining paired training data can be difficult and expensive. For example, only a couple of datasets exist for tasks like semantic segmentation (e.g., [4]), and they are relatively small. Obtaining input-output pairs for graphics tasks like artistic stylization can be even more difficult since the desired output is highly complex, typically requiring artistic authoring. For many tasks, like object transfiguration (e.g., zebrahorse,  Figure 1 top-middle), the desired output is not even well-defined.

We therefore seek an algorithm that can learn to translate between domains without paired input-output examples (Figure 2, right). We assume there is some underlying relationship between the domains – for example, that they are two different renderings of the same underlying scene – and seek to learn that relationship. Although we lack supervision in the form of paired examples, we can exploit supervision at the level of sets: we are given one set of images in domain and a different set in domain . We may train a mapping such that the output , , is indistinguishable from images by an adversary trained to classify apart from . In theory, this objective can induce an output distribution over that matches the empirical distribution (in general, this requires to be stochastic) [15]. The optimal thereby translates the domain to a domain distributed identically to . However, such a translation does not guarantee that an individual input and output are paired up in a meaningful way – there are infinitely many mappings that will induce the same distribution over . Moreover, in practice, we have found it difficult to optimize the adversarial objective in isolation: standard procedures often lead to the well-known problem of mode collapse, where all input images map to the same output image and the optimization fails to make progress [14].

These issues call for adding more structure to our objective. Therefore, we exploit the property that translation should be “cycle consistent”, in the sense that if we translate, e.g., a sentence from English to French, and then translate it back from French to English, we should arrive back at the original sentence [3]. Mathematically, if we have a translator and another translator , then and should be inverses of each other, and both mappings should be bijections. We apply this structural assumption by training both the mapping and simultaneously, and adding a cycle consistency loss [64] that encourages and . Combining this loss with adversarial losses on domains and yields our full objective for unpaired image-to-image translation.

We apply our method to a wide range of applications, including collection style transfer, object transfiguration, season transfer and photo enhancement. We also compare against previous approaches that rely either on hand-defined factorizations of style and content, or on shared embedding functions, and show that our method outperforms these baselines. Our code is available at https://github.com/junyanz/CycleGAN. Check out more results at https://junyanz.github.io/CycleGAN/.

Figure 3: (a) Our model contains two mapping functions and , and associated adversarial discriminators and . encourages to translate into outputs indistinguishable from domain , and vice versa for and . To further regularize the mappings, we introduce two cycle consistency losses that capture the intuition that if we translate from one domain to the other and back again we should arrive at where we started: (b) forward cycle-consistency loss: , and (c) backward cycle-consistency loss:

2 Related work

Generative Adversarial Networks (GANs) [15, 62] have achieved impressive results in image generation [5, 37], image editing [65], and representation learning [37, 42, 35].  Recent methods adopt the same idea for conditional image generation applications, such as text2image [39], image inpainting [36], and future prediction [34], as well as to other domains like videos [53] and 3D data [56]. The key to GANs’ success is the idea of an adversarial loss that forces the generated images to be, in principle, indistinguishable from real images. This is particularly powerful for image generation tasks, as this is exactly the objective that much of computer graphics aims to optimize. We adopt an adversarial loss to learn the mapping such that the translated image cannot be distinguished from images in the target domain.

Image-to-Image Translation The idea of image-to-image translation goes back at least to Hertzmann et al.’s Image Analogies [18], who employ a non-parametric texture model [9] on a single input-output training image pair. More recent approaches use a dataset of input-output examples to learn a parametric translation function using CNNs, e.g. [31]. Our approach builds on the “pix2pix” framework of Isola et al. [21], which uses a conditional generative adversarial network [15] to learn a mapping from input to output images. Similar ideas have been applied to various tasks such as generating photographs from sketches [43] or from attribute and semantic layouts [23]. However, unlike these prior works, we learn the mapping without paired training examples.

Unpaired Image-to-Image Translation Several other methods also tackle the unpaired setting, where the goal is to relate two data domains, and . Rosales et al. [40] propose a Bayesian framework that includes a prior based on a patch-based Markov random field computed from a source image, and a likelihood term obtained from multiple style images. More recently, CoGAN [30] and cross-modal scene networks [1] use a weight-sharing strategy to learn a common representation across domains. Concurrent to our method, Liu et al. [29] extends this framework with a combination of variational autoencoders [25] and generative adversarial networks. Another line of concurrent work [45, 48, 2] encourages the input and output to share certain “content” features even though they may differ in “style“. They also use adversarial networks, with additional terms to enforce the output to be close to the input in a predefined metric space, such as class label space [2], image pixel space [45], and image feature space [48].

Unlike the above approaches, our formulation does not rely on any task-specific, predefined similarity function between the input and output, nor do we assume that the input and output have to lie in the same low-dimensional embedding space. This makes our method a general-purpose solution for many vision and graphics tasks. We directly compare against several prior and contemporary approaches in Section 5.1.

Cycle Consistency The idea of using transitivity as a way to regularize structured data has a long history. In visual tracking, enforcing simple forward-backward consistency has been a standard trick for decades [47]. In the language domain, verifying and improving translations via “back translation and reconsiliation” is a technique used by human translators [3] (including, humorously, by Mark Twain [50]), as well as by machines [16]. More recently, higher-order cycle consistency has been used in structure from motion [60], 3D shape matching [20], co-segmentation [54], dense semantic alignment [63, 64], and depth estimation [13]. Of these, Zhou et al. [64] and Godard et al. [13] are most similar to our work, as they use a cycle consistency loss as a way of using transitivity to supervise CNN training. In this work, we are introducing a similar loss to push and to be consistent with each other. Concurrent with our work, in these same proceedings, Yi et al. [58] independently use a similar objective for unpaired image-to-image translation, inspired by dual learning in machine translation [16].

Neural Style Transfer [12, 22, 51, 11] is another way to perform image-to-image translation, which synthesizes a novel image by combining the content of one image with the style of another image (typically a painting) based on matching the Gram matrix statistics of pre-trained deep features. Our main focus, on the other hand, is learning the mapping between two image collections, rather than between two specific images, by trying to capture correspondences between higher-level appearance structures. Therefore, our method can be applied to other tasks, such as painting photo, object transfiguration, etc. where single sample transfer methods do not perform well. We compare these two methods in  Section 5.2.

3 Formulation

Our goal is to learn mapping functions between two domains and given training samples where and where 111We often omit the subscript and for simplicity.. We denote the data distribution as and . As illustrated in Figure 3 (a), our model includes two mappings and . In addition, we introduce two adversarial discriminators and , where aims to distinguish between images and translated images ; in the same way, aims to discriminate between and . Our objective contains two types of terms: adversarial losses [15] for matching the distribution of generated images to the data distribution in the target domain; and cycle consistency losses to prevent the learned mappings and from contradicting each other.

3.1 Adversarial Loss

We apply adversarial losses [15] to both mapping functions. For the mapping function and its discriminator , we express the objective as:


where tries to generate images that look similar to images from domain , while aims to distinguish between translated samples and real samples . aims to minimize this objective against an adversary that tries to maximize it, i.e. . We introduce a similar adversarial loss for the mapping function and its discriminator as well: i.e. .

Figure 4: The generated images and the reconstructed images from various experiments. From top to bottom: photoCezanne, horseszebras, wintersummer Yosemite, aerial photosmaps on Google Maps.

3.2 Cycle Consistency Loss

Adversarial training can, in theory, learn mappings and that produce outputs identically distributed as target domains and respectively (strictly speaking, this requires and to be stochastic functions) [14]. However, with large enough capacity, a network can map the same set of input images to any random permutation of images in the target domain, where any of the learned mappings can induce an output distribution that matches the target distribution. Thus, adversarial losses alone cannot guarantee that the learned function can map an individual input to a desired output . To further reduce the space of possible mapping functions, we argue that the learned mapping functions should be cycle-consistent: as shown in Figure 3 (b), for each image from domain , the image translation cycle should be able to bring back to the original image, i.e. . We call this forward cycle consistency. Similarly, as illustrated in Figure 3 (c), for each image from domain , and should also satisfy backward cycle consistency: . We can incentivize this behavior using a cycle consistency loss:


In preliminary experiments, we also tried replacing the L1 norm in this loss with an adversarial loss between and , and between and , but did not observe improved performance.

The behavior induced by the cycle consistency loss can be observed in Figure 4: the reconstructed images end up matching closely to the input images .

3.3 Full Objective

Our full objective is:


where controls the relative importance of the two objectives. We aim to solve:


Notice that our model can be viewed as training two “autoencoders” [19]: we learn one autoencoder jointly with another . However, these autoencoders each have special internal structure: they map an image to itself via an intermediate representation that is a translation of the image into another domain. Such a setup can also be seen as a special case of “adversarial autoencoders” [32], which use an adversarial loss to train the bottleneck layer of an autoencoder to match an arbitrary target distribution. In our case, the target distribution for the autoencoder is that of domain .

In Section 5.1.4, we compare our method against ablations of the full objective, including the adversarial loss alone and the cycle consistency loss alone, and empirically show that both objectives play critical roles in arriving at high-quality results. We also evaluate our method with only cycle loss in one direction, and show that a single cycle is not sufficient to regularize the training for this under-constrained problem.

4 Implementation

Network Architecture

We adapt the architecture for our generative networks from Johnson et al. [22] who have shown impressive results for neural style transfer and super-resolution. This network contains two stride-2 convolutions, several residual blocks [17], and two fractionally-strided convolutions with stride . We use blocks for images, and blocks for and higher-resolution training images. Similar to Johnson et al. [22], we use instance normalization [52]. For the discriminator networks we use PatchGANs [21, 28, 27], which aim to classify whether overlapping image patches are real or fake. Such a patch-level discriminator architecture has fewer parameters than a full-image discriminator, and can be applied to arbitrarily-sized images in a fully convolutional fashion [21].

Training details

We apply two techniques from recent works to stabilize our model training procedure. First, for (Equation 1), we replace the negative log likelihood objective by a least-squares loss [33]. This loss is more stable during training and generates higher quality results. In particular, for a GAN loss , we train the to minimize and train the to minimize .

Second, to reduce model oscillation [14], we follow Shrivastava et al’s strategy [45] and update the discriminators using a history of generated images rather than the ones produced by the latest generative networks. We keep an image buffer that stores the previously generated images.

For all the experiments, we set in Equation 3. We use the Adam solver [24] with a batch size of . All networks were trained from scratch with a learning rate of . We keep the same learning rate for the first epochs and linearly decay the rate to zero over the next epochs. Please see the appendix (Section A) for more details about the datasets, architectures, and training procedures.

5 Results

We first compare our approach against recent methods for unpaired image-to-image translation on paired datasets where ground truth input-output pairs are available for evaluation. We then study the importance of both the adversarial loss and the cycle consistency loss, and compare our full method against several variants. Finally, we demonstrate the generality of our algorithm on a wide range of applications where paired data does not exist. For brevity, we refer to our method as CycleGAN. The code and full results can be viewed at https://github.com/junyanz/CycleGAN.

5.1 Evaluation

Figure 5: Different methods for mapping labelsphotos trained on Cityscapes images. From left to right: input, BiGAN/ALI [6, 8], CoGAN [30], feature loss + GAN, SimGAN [45], CycleGAN (ours), pix2pix [21] trained on paired data, and ground truth.
Figure 6: Different methods for mapping aerial photosmaps on Google Maps. From left to right: input, BiGAN/ALI [6, 8], CoGAN [30], feature loss + GAN, SimGAN [45], CycleGAN (ours), pix2pix [21] trained on paired data, and ground truth.

Using the same evaluation datasets and metrics as “pix2pix” [21], we compare our method against several baselines both qualitatively and quantitatively. The tasks include semantic labelsphoto on the Cityscapes dataset [4], and mapaerial photo on data scraped from Google Maps. We also perform ablation study on the full loss function.

5.1.1 Metrics

AMT perceptual studies On the mapaerial photo task, we run “real vs fake” perceptual studies on Amazon Mechanical Turk (AMT) to assess the realism of our outputs. We follow the same perceptual study protocol from Isola et al. [21], except we only gather data from participants per algorithm we tested. Participants were shown a sequence of pairs of images, one a real photo or map and one fake (generated by our algorithm or a baseline), and asked to click on the image they thought was real. The first 10 trials of each session were practice and feedback was given as to whether the participant’s response was correct or incorrect. The remaining 40 trials were used to assess the rate at which each algorithm fooled participants. Each session only tested a single algorithm, and participants were only allowed to complete a single session. Note that the numbers we report here are not directly comparable to those in [21] as our ground truth images were processed slightly differently 222We train all the models on images while in pix2pix [21], the model was trained on patches of images, and run convolutionally on the images at test time. We choose in our experiments as many baselines cannot scale up to high resolution images, and CoGAN cannot be tested fully convolutionally. and the participant pool we tested may be differently distributed from those tested in [21] (due to running the experiment at a different date and time). Therefore, our numbers should only be used to compare our current method against the baselines (which were run under identical conditions), rather than against [21].

FCN score Although perceptual studies may be the gold standard for assessing graphical realism, we also seek an automatic quantitative measure that does not require human experiments. For this we adopt the “FCN score” from [21], and use it to evaluate the Cityscapes labelsphoto task. The FCN metric evaluates how interpretable the generated photos are according to an off-the-shelf semantic segmentation algorithm (the fully-convolutional network, FCN, from [31]). The FCN predicts a label map for a generated photo. This label map can then be compared against the input ground truth labels using standard semantic segmentation metrics described below. The intuition is that if we generate a photo from a label map of “car on road”, then we have succeeded if the FCN applied to the generated photo detects “car on road”.

Semantic segmentation metrics To evaluate the performance of photolabels, we use the standard metrics from the Cityscapes benchmark, including per-pixel accuracy, per-class accuracy, and mean class Intersection-Over-Union (Class IOU) [4].

5.1.2 Baselines

CoGAN [30] This method learns one GAN generator for domain and one for domain , with tied weights on the first few layers for shared latent representation. Translation from to can be achieved by finding a latent representation that generates image and then rendering this latent representation into style .

SimGAN [45] Like our method, Shrivastava et al.[45] uses an adversarial loss to train a translation from to . The regularization term was used to penalize making large changes at pixel level.

Feature loss + GAN We also test a variant of SimGAN [45] where the L1 loss is computed over deep image features using a pretrained network (VGG-16 relu4_2 [46]), rather than over RGB pixel values. Computing distances in deep feature space, like this, is also sometimes referred to as using a “perceptual loss” [7, 22].

BiGAN/ALI [8, 6] Unconditional GANs [15] learn a generator , that maps random noise to images . The BiGAN [8] and ALI [6] propose to also learn the inverse mapping function . Though they were originally designed for mapping a latent vector to an image , we implemented the same objective for mapping a source image to a target image .

pix2pix [21] We also compare against pix2pix [21], which is trained on paired data, to see how close we can get to this “upper bound” without using any paired training data.

For a fair comparison, we implement all the baselines using the same architecture and details as our method, except for CoGAN [30]. CoGAN builds on generators that produce images from a shared latent representation, which is incompatible with our image-to-image network. We use the public implementation of CoGAN instead 333https://github.com/mingyuliutw/CoGAN.

Map Photo Photo Map
Loss % Turkers labeled real % Turkers labeled real
CoGAN [30] 0.6% 0.5% 0.9% 0.5%
BiGAN/ALI [8, 6] 2.1% 1.0% 1.9% 0.9%
SimGAN [45] 0.7% 0.5% 2.6% 1.1%
Feature loss + GAN 1.2% 0.6% 0.3% 0.2%
CycleGAN (ours) 26.8% 2.8% 23.2% 3.4%
Table 1: AMT “real vs fake” test on mapsaerial photos at resolution.
Loss Per-pixel acc. Per-class acc. Class IOU
CoGAN [30] 0.40 0.10 0.06
BiGAN/ALI [8, 6] 0.19 0.06 0.02
SimGAN [45] 0.20 0.10 0.04
Feature loss + GAN 0.06 0.04 0.01
CycleGAN (ours) 0.52 0.17 0.11
pix2pix [21] 0.71 0.25 0.18
Table 2: FCN-scores for different methods, evaluated on Cityscapes labelsphoto.
Loss Per-pixel acc. Per-class acc. Class IOU
CoGAN [30] 0.45 0.11 0.08
BiGAN/ALI [8, 6] 0.41 0.13 0.07
SimGAN [45] 0.47 0.11 0.07
Feature loss + GAN 0.50 0.10 0.06
CycleGAN (ours) 0.58 0.22 0.16
pix2pix [21] 0.85 0.40 0.32
Table 3: Classification performance of photolabels for different methods on cityscapes.
Figure 7: Different variants of our method for mapping labelsphotos trained on cityscapes. From left to right: input, cycle-consistency loss alone, adversarial loss alone, GAN + forward cycle-consistency loss (), GAN + backward cycle-consistency loss (), CycleGAN (our full method), and ground truth. Both Cycle alone and GAN + backward fail to produce images similar to the target domain. GAN alone and GAN + forward suffer from mode collapse, producing identical label maps regardless of the input photo.
Loss Per-pixel acc. Per-class acc. Class IOU
Cycle alone 0.22 0.07 0.02
GAN alone 0.51 0.11 0.08
GAN + forward cycle 0.55 0.18 0.12
GAN + backward cycle 0.39 0.14 0.06
CycleGAN (ours) 0.52 0.17 0.11
Table 4: Ablation study: FCN-scores for different variants of our method, evaluated on Cityscapes labelsphoto.
Loss Per-pixel acc. Per-class acc. Class IOU
Cycle alone 0.10 0.05 0.02
GAN alone 0.53 0.11 0.07
GAN + forward cycle 0.49 0.11 0.07
GAN + backward cycle 0.01 0.06 0.01
CycleGAN (ours) 0.58 0.22 0.16
Table 5: Ablation study: classification performance of photolabels for different losses, evaluated on Cityscapes.

5.1.3 Comparison against baselines

As can be seen in Figure 5 and Figure 6, we were unable to achieve compelling results with any of the baselines. Our method, on the other hand, is able to produce translations that are often of similar quality to the fully supervised pix2pix.

Table 1 reports performance regarding the AMT perceptual realism task. Here, we see that our method can fool participants on around a quarter of trials, in both the mapsaerial photos direction and the aerial photosmaps direction at resolution444We also train CycleGAN and pix2pix at resolution, and observe the comparable performance: mapsaerial photos: CycleGAN: and pix2pix: ; aerial photosmaps: CycleGAN: and pix2pix: .

All baselines almost never fooled participants.

Table 2 assesses the performance of the labelsphoto task on the Cityscapes and Table 3 assesses the opposite mapping (photoslabels). In both cases, our method again outperforms the baselines.

5.1.4 Analysis of the loss function

In Table 4 and Table 5, we compare against ablations of our full loss. Removing the GAN loss substantially degrades results, as does removing the cycle-consistency loss. We therefore conclude that both terms are critical to our results. We also evaluate our method with the cycle loss in only one direction: GAN+forward cycle loss , or GAN+backward cycle loss (Equation 2) and find that it often incurs training instability and causes mode collapse, especially for the direction of the mapping that was removed. Figure 7 shows several qualitative examples.

5.1.5 Image reconstruction quality

In Figure 4, we show a few random samples of the reconstructed images . We observed that the reconstructed images were very close to the original inputs , at both training and testing time, even in cases where one domain represents significantly more diverse information, such as mapaerial photos.

Figure 8: Example results of CycleGAN on paired datasets used in “pix2pix” [21] such as architectural labelsphotos and edgesshoes.

5.1.6 Additional results on paired datasets

Figure 8 shows some example results on other paired datasets used in “pix2pix” [21], such as architectural labelsphotos from the CMP Facade Database [38], and edgesshoes from the UT Zappos50K dataset [59]. The image quality of our results is close to those produced by the fully supervised pix2pix while our method learns the mapping without paired supervision.

5.2 Applications

We demonstrate our method on several applications where paired training data does not exist. Please refer to the appendix (Section A) for more details about the datasets. We observe that translations on training data are often more appealing than those on test data, and full results of all applications on both training and test data can be viewed on our project website.

Collection style transfer (Figure 10 and  Figure 11) We train the model on landscape photographs downloaded from Flickr and WikiArt. Note that unlike recent work on “neural style transfer” [12], our method learns to mimic the style of an entire collection of artworks, rather than transferring the style of a single selected piece of art. Therefore, we can learn to generate photos in the style of, e.g., Van Gogh, rather than just in the style of Starry Night. The size of the dataset for each artist/style was , , , and for Cezanne, Monet, Van Gogh, and Ukiyo-e.

Object transfiguration (Figure 13) The model is trained to translate one object class from ImageNet [41] to another (each class contains around training images). Turmukhambetov et al. [49] proposes a subspace model to translate one object into another object of the same category, while our method focuses on object transfiguration between two visually similar categories.

Season transfer (Figure 13) The model is trained on winter photos and summer photos of Yosemite downloaded from Flickr.

Figure 9: The effect of the identity mapping loss on Monet’s painting photos. From left to right: input paintings, CycleGAN without identity mapping loss, CycleGAN with identity mapping loss. The identity mapping loss helps preserve the color of the input paintings.

Photo generation from paintings (Figure 12) For paintingphoto, we find that it is helpful to introduce an additional loss to encourage the mapping to preserve color composition between the input and output. In particular, we adopt the technique of Taigman et al. [48] and regularize the generator to be near an identity mapping when real samples of the target domain are provided as the input to the generator: i.e.

Without , the generator and are free to change the tint of input images when there is no need to. For example, when learning the mapping between Monet’s paintings and Flickr photographs, the generator often maps paintings of daytime to photographs taken during sunset, because such a mapping may be equally valid under the adversarial loss and cycle consistency loss. The effect of this identity mapping loss are shown in Figure 9.

In Figure 12, we show additional results translating Monet’s paintings to photographs. This figure and Figure 9 show results on paintings that were included in the training set, whereas for all other experiments in the paper, we only evaluate and show test set results. Because the training set does not include paired data, coming up with a plausible translation for a training set painting is a nontrivial task. Indeed, since Monet is no longer able to create new paintings, generalization to unseen, “test set”, paintings is not a pressing problem.

Photo enhancement (Figure 14) We show that our method can be used to generate photos with shallower depth of field. We train the model on flower photos downloaded from Flickr. The source domain consists of photos of flower taken by smartphones, which usually have deep DoF due to small aperture. The target contains photos captured by DSLRs with larger aperture. Our model successfully generates photos with shallower depth of field from the photos taken by smartphones.

Comparison with Gatys et al. [12] In  Figure 15, we compare our results with neural style transfer [12] on photo stylization. For each row, we first use two representative artworks as the style images for  [12]. Our method, on the other hand, is able to produce photos in the style of entire collection. To compare against neural style transfer of an entire collection, we compute the average Gram Matrix across the target domain, and use this matrix to transfer the “average style” using [12].

Figure 16 demonstrates similar comparisons for other translation tasks. We observe that Gatys et al. [12] requires finding target style images that closely match the desired output, but still often fails to produce photo-realistic results, while our method succeeds to generate natural looking results, similar to the target domain.

6 Limitations and Discussion

Although our method can achieve compelling results in many cases, the results are far from uniformly positive. Several typical failure cases are shown in Figure 17. On translation tasks that involve color and texture changes, like many of those reported above, the method often succeeds. We have also explored tasks that require geometric changes, with little success. For example, on the task of dogcat transfiguration, the learned translation degenerates to making minimal changes to the input (Figure 17). This might be caused by our generator architecture choices which are tailored for good performance on the appearance changes. Handling more varied and extreme transformations, especially geometric changes, is an important problem for future work.

Some failure cases are caused by the distribution characteristics of the training datasets. For example, the horse zebra example (Figure 17, right) has got confused, because our model was trained on the wild horse and zebra synsets of ImageNet, which does not contain images of a person riding a horse or zebra.

We also observe a lingering gap between the results achievable with paired training data and those achieved by our unpaired method. In some cases, this gap may be very hard – or even impossible – to close: for example, our method sometimes permutes the labels for tree and building in the output of the photoslabels task. To resolve this ambiguity may require some form of weak semantic supervision. Integrating weak or semi-supervised data may lead to substantially more powerful translators, still at a fraction of the annotation cost of the fully-supervised systems.

Nonetheless, in many cases completely unpaired data is plentifully available and should be made use of. This paper pushes the boundaries of what is possible in this “unsupervised” setting.

Acknowledgments: We thank Aaron Hertzmann, Shiry Ginosar, Deepak Pathak, Bryan Russell, Eli Shechtman, Richard Zhang, and Tinghui Zhou for many helpful comments. This work was supported in part by NSF SMA-1514512, NSF IIS-1633310, a Google Research Award, Intel Corp, and hardware donations from NVIDIA. JYZ is supported by the Facebook Graduate Fellowship and TP is supported by the Samsung Scholarship. The photographs used for style transfer were taken by AE, mostly in France.

Figure 10: Collection style transfer I: we transfer input images into the artistic styles of Monet, Van Gogh, Cezanne, and Ukiyo-e. Please see our website for additional examples.
Figure 11: Collection style transfer II: we transfer input images into the artistic styles of Monet, Van Gogh, Cezanne, Ukiyo-e. Please see our website for additional examples.
Figure 12: Relatively successful results on mapping Monet’s paintings to photographs. Please see our website for additional examples.
Figure 13: Our method applied to several translation problems. These images are selected as relatively successful results – please see our website for more comprehensive and random results. In the top two rows, we show results on object transfiguration between horses and zebras, trained on 939 images from the wild horse class and 1177 images from the zebra class in Imagenet [41]. Also check out the horsezebra demo video at https://youtu.be/9reHvktowLY. The middle two rows show results on season transfer, trained on winter and summer photos of Yosemite from Flickr. In the bottom two rows, we train our method on 996 apple images and 1020 navel orange images from ImageNet.
Figure 14: Photo enhancement: mapping from a set of iPhone snaps to professional DSLR photographs, the system often learns to produce shallow focus. Here we show some of the most successful results in our test set – average performance is considerably worse. Please see our website for more comprehensive and random examples.
Figure 15: We compare our method with neural style transfer [12] on photo stylization. Left to right: input image, results from [12] using two different representative artworks as style images, results from [12] using the entire collection of the artist, and CycleGAN (ours).
Figure 16: We compare our method with neural style transfer [12] on various applications. From top to bottom: appleorange, horsezebra, and Monetphoto. Left to right: input image, results from [12] using two different images as style images, results from [12] using all the images from the target domain, and CycleGAN (ours).
Figure 17: Typical failure cases of our method. Please see our website for more comprehensive results.


  • [1] Y. Aytar, L. Castrejon, C. Vondrick, H. Pirsiavash, and A. Torralba. Cross-modal scene networks. arXiv preprint arXiv:1610.09003, 2016.
  • [2] K. Bousmalis, N. Silberman, D. Dohan, D. Erhan, and D. Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. arXiv preprint arXiv:1612.05424, 2016.
  • [3] R. W. Brislin. Back-translation for cross-cultural research. Journal of cross-cultural psychology, 1(3):185–216, 1970.
  • [4] M. Cordts, M. Omran, S. Ramos, T. Rehfeld, M. Enzweiler, R. Benenson, U. Franke, S. Roth, and B. Schiele. The cityscapes dataset for semantic urban scene understanding. In CVPR, 2016.
  • [5] E. L. Denton, S. Chintala, R. Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In NIPS, pages 1486–1494, 2015.
  • [6] J. Donahue, P. Krähenbühl, and T. Darrell. Adversarial feature learning. arXiv preprint arXiv:1605.09782, 2016.
  • [7] A. Dosovitskiy and T. Brox. Generating images with perceptual similarity metrics based on deep networks. In NIPS, pages 658–666, 2016.
  • [8] V. Dumoulin, I. Belghazi, B. Poole, A. Lamb, M. Arjovsky, O. Mastropietro, and A. Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016.
  • [9] A. A. Efros and T. K. Leung. Texture synthesis by non-parametric sampling. In ICCV, volume 2, pages 1033–1038. IEEE, 1999.
  • [10] D. Eigen and R. Fergus. Predicting depth, surface normals and semantic labels with a common multi-scale convolutional architecture. In ICCV, pages 2650–2658, 2015.
  • [11] L. A. Gatys, M. Bethge, A. Hertzmann, and E. Shechtman. Preserving color in neural artistic style transfer. arXiv preprint arXiv:1606.05897, 2016.
  • [12] L. A. Gatys, A. S. Ecker, and M. Bethge. Image style transfer using convolutional neural networks. CVPR, 2016.
  • [13] C. Godard, O. Mac Aodha, and G. J. Brostow. Unsupervised monocular depth estimation with left-right consistency. In CVPR, 2017.
  • [14] I. Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
  • [15] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NIPS, 2014.
  • [16] D. He, Y. Xia, T. Qin, L. Wang, N. Yu, T. Liu, and W.-Y. Ma. Dual learning for machine translation. In NIPS, pages 820–828, 2016.
  • [17] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016.
  • [18] A. Hertzmann, C. E. Jacobs, N. Oliver, B. Curless, and D. H. Salesin. Image analogies. In SIGGRAPH, pages 327–340. ACM, 2001.
  • [19] G. E. Hinton and R. R. Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006.
  • [20] Q.-X. Huang and L. Guibas. Consistent shape maps via semidefinite programming. In Computer Graphics Forum, volume 32, pages 177–186. Wiley Online Library, 2013.
  • [21] P. Isola, J.-Y. Zhu, T. Zhou, and A. A. Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017.
  • [22] J. Johnson, A. Alahi, and L. Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, pages 694–711. Springer, 2016.
  • [23] L. Karacan, Z. Akata, A. Erdem, and E. Erdem. Learning to generate images of outdoor scenes from attributes and semantic layouts. arXiv preprint arXiv:1612.00215, 2016.
  • [24] D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
  • [25] D. P. Kingma and M. Welling. Auto-encoding variational bayes. ICLR, 2014.
  • [26] P.-Y. Laffont, Z. Ren, X. Tao, C. Qian, and J. Hays. Transient attributes for high-level understanding and editing of outdoor scenes. ACM Transactions on Graphics (TOG), 33(4):149, 2014.
  • [27] C. Ledig, L. Theis, F. Huszár, J. Caballero, A. Cunningham, A. Acosta, A. Aitken, A. Tejani, J. Totz, Z. Wang, et al. Photo-realistic single image super-resolution using a generative adversarial network. arXiv preprint arXiv:1609.04802, 2016.
  • [28] C. Li and M. Wand. Precomputed real-time texture synthesis with markovian generative adversarial networks. ECCV, 2016.
  • [29] M.-Y. Liu, T. Breuel, and J. Kautz. Unsupervised image-to-image translation networks. arXiv preprint arXiv:1703.00848, 2017.
  • [30] M.-Y. Liu and O. Tuzel. Coupled generative adversarial networks. In NIPS, pages 469–477, 2016.
  • [31] J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In CVPR, pages 3431–3440, 2015.
  • [32] A. Makhzani, J. Shlens, N. Jaitly, I. Goodfellow, and B. Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
  • [33] X. Mao, Q. Li, H. Xie, R. Y. Lau, and Z. Wang. Multi-class generative adversarial networks with the l2 loss function. arXiv preprint arXiv:1611.04076, 2016.
  • [34] M. Mathieu, C. Couprie, and Y. LeCun. Deep multi-scale video prediction beyond mean square error. ICLR, 2016.
  • [35] M. F. Mathieu, J. Zhao, A. Ramesh, P. Sprechmann, and Y. LeCun. Disentangling factors of variation in deep representation using adversarial training. In NIPS, pages 5040–5048, 2016.
  • [36] D. Pathak, P. Krahenbuhl, J. Donahue, T. Darrell, and A. A. Efros. Context encoders: Feature learning by inpainting. CVPR, 2016.
  • [37] A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
  • [38] R. Š. Radim Tyleček. Spatial pattern templates for recognition of objects with regular structure. In Proc. GCPR, Saarbrucken, Germany, 2013.
  • [39] S. Reed, Z. Akata, X. Yan, L. Logeswaran, B. Schiele, and H. Lee. Generative adversarial text to image synthesis. arXiv preprint arXiv:1605.05396, 2016.
  • [40] R. Rosales, K. Achan, and B. J. Frey. Unsupervised image translation. In iccv, pages 472–478, 2003.
  • [41] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, et al. Imagenet large scale visual recognition challenge. IJCV, 115(3):211–252, 2015.
  • [42] T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. Improved techniques for training gans. arXiv preprint arXiv:1606.03498, 2016.
  • [43] P. Sangkloy, J. Lu, C. Fang, F. Yu, and J. Hays. Scribbler: Controlling deep image synthesis with sketch and color. In CVPR, 2017.
  • [44] Y. Shih, S. Paris, F. Durand, and W. T. Freeman. Data-driven hallucination of different times of day from a single outdoor photo. ACM Transactions on Graphics (TOG), 32(6):200, 2013.
  • [45] A. Shrivastava, T. Pfister, O. Tuzel, J. Susskind, W. Wang, and R. Webb. Learning from simulated and unsupervised images through adversarial training. arXiv preprint arXiv:1612.07828, 2016.
  • [46] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
  • [47] N. Sundaram, T. Brox, and K. Keutzer. Dense point trajectories by gpu-accelerated large displacement optical flow. In ECCV, pages 438–451. Springer, 2010.
  • [48] Y. Taigman, A. Polyak, and L. Wolf. Unsupervised cross-domain image generation. arXiv preprint arXiv:1611.02200, 2016.
  • [49] D. Turmukhambetov, N. D. Campbell, S. J. Prince, and J. Kautz. Modeling object appearance using context-conditioned component analysis. In CVPR, pages 4156–4164, 2015.
  • [50] M. Twain. The Jumping Frog: in English, then in French, and then Clawed Back into a Civilized Language Once More by Patient, Unremunerated Toil. 1903.
  • [51] D. Ulyanov, V. Lebedev, A. Vedaldi, and V. Lempitsky. Texture networks: Feed-forward synthesis of textures and stylized images. In Int. Conf. on Machine Learning (ICML), 2016.
  • [52] D. Ulyanov, A. Vedaldi, and V. Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
  • [53] C. Vondrick, H. Pirsiavash, and A. Torralba. Generating videos with scene dynamics. In NIPS, pages 613–621, 2016.
  • [54] F. Wang, Q. Huang, and L. J. Guibas. Image co-segmentation via consistent functional maps. In ICCV, pages 849–856, 2013.
  • [55] X. Wang and A. Gupta. Generative image modeling using style and structure adversarial networks. ECCV, 2016.
  • [56] J. Wu, C. Zhang, T. Xue, B. Freeman, and J. Tenenbaum. Learning a probabilistic latent space of object shapes via 3d generative-adversarial modeling. In NIPS, pages 82–90, 2016.
  • [57] S. Xie and Z. Tu. Holistically-nested edge detection. In ICCV, 2015.
  • [58] Z. Yi, H. Zhang, T. Gong, Tan, and M. Gong. Dualgan: Unsupervised dual learning for image-to-image translation. In ICCV, 2017.
  • [59] A. Yu and K. Grauman. Fine-grained visual comparisons with local learning. In CVPR, pages 192–199, 2014.
  • [60] C. Zach, M. Klopschitz, and M. Pollefeys. Disambiguating visual relations using loop constraints. In CVPR, pages 1426–1433. IEEE, 2010.
  • [61] R. Zhang, P. Isola, and A. A. Efros. Colorful image colorization. In ECCV, 2016.
  • [62] J. Zhao, M. Mathieu, and Y. LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
  • [63] T. Zhou, Y. Jae Lee, S. X. Yu, and A. A. Efros. Flowweb: Joint image set alignment by weaving consistent, pixel-wise correspondences. In CVPR, pages 1191–1200, 2015.
  • [64] T. Zhou, P. Krahenbuhl, M. Aubry, Q. Huang, and A. A. Efros. Learning dense correspondence via 3d-guided cycle consistency. In CVPR, pages 117–126, 2016.
  • [65] J.-Y. Zhu, P. Krähenbühl, E. Shechtman, and A. A. Efros. Generative visual manipulation on the natural image manifold. In ECCV, 2016.

Appendix A Appendix

a.1 Training details

All the networks (except edgesshoes) were trained from scratch, with a learning rate of for epochs. In practice, we divide the objective by while optimizing , which slows down the rate at which learns relative to . We keep the same learning rate for the first epochs and linearly decay the rate to zero over the next epochs. Weights were initialized from a Gaussian distribution with mean and standard deviation .

Cityscapes labelPhoto training images from the Cityscapes training set [4] with image size . We used the Cityscapes val set for testing.

Mapsaerial photograph training images scraped from Google Maps [21] with image size . Images were sampled from in and around New York City. Data was then split into train and test about the median latitude of the sampling region (with a buffer region added to ensure that no training pixel appeared in the test set).

Architectural facades labelsphoto training images from [38].

Edgesshoes around training images from UT Zappos50K dataset [59]. The model was trained for epochs with learning rate of .

HorseZebra and AppleOrange The images for each class were downloaded from ImageNet using keywords wild horse, zebra, apple, and navel orange. The images were scaled to pixels. The training set size of each class was horse: , zebra: , apple: , orange: .

SummerWinter Yosemite The images were downloaded using Flickr API using the tag yosemite and the datetaken field. Black-and-white photos were pruned. The images were scaled to pixels. The training size of each class was summer: , winter: .

PhotoArt for style transfer The art images were downloaded from Wikiart.org by crawling. Some artworks that were sketches or too obscene were pruned by hand. The photos are downloaded from Flickr using the combination of tags landscape and landscapephotography. Black-and-white photos were pruned. The images were scaled to pixels. The training set size of each class was Monet: , Cezanne: , Van Gogh: , Ukiyo-e: , Photographs: . The Monet dataset was particularly pruned to include only landscape paintings, and Van Gogh included only his later works that represent his most recognizable artistic style.

Monet’s paintingsphotos In order to achieve high resolution while conserving memory, random square crops of the rectangular images were used for training. To generate results, images of width 512 pixels with correct aspect ratio were passed to the generator network as input. The weight for the identity mapping loss was .

Flower photo enhancement Flower images taken on iPhones were downloaded from Flickr by searching for the photos taken by Apple iPhone 5, 5s, or 6, with search text flower. DSLR images with shallow DoF were also downloaded from Flickr by search tag flower, dof. The images were scaled to width pixels. The identity mapping loss of weight was used. The training set size of the smartphone and DSLR dataset were and , respectively.

a.2 Network architectures

Our code and models are available at https://github.com/junyanz/CycleGAN. We also provide a pytorch implementation at https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix

Generator architectures We adapt our architectures from Johnson et al. [22]. We use blocks for training images, and blocks for or higher-resolution training images. Below, we follow the naming convention used in the Johnson el al.’s Github repository555https://github.com/jcjohnson/fast-neural-style.

Let c7s1-k denote a Convolution-InstanceNorm-ReLU layer with filters and stride . dk denotes a Convolution-InstanceNorm-ReLU layer with filters, and stride . Reflection padding was used to reduce artifacts. Rk denotes a residual block that contains two convolutional layers with the same number of filters on both layer. uk denotes a fractional-strided-Convolution-InstanceNorm-ReLU layer with filters, and stride .

The network with 6 blocks consists of:

The network with 9 blocks consists of:

Discriminator architectures For discriminator networks, we use PatchGAN [21]. Let Ck denote a Convolution-InstanceNorm-LeakyReLU layer with k filters and stride . After the last layer, we apply a convolution to produce a dimensional output. We do not use InstanceNorm for the first C64 layer. We use leaky ReLUs with slope . The discriminator architecture is:

Comments 0
Request Comment
You are adding the first comment!
How to quickly get a good reply:
  • Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
  • Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
  • Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters
Add comment
Loading ...
This is a comment super asjknd jkasnjk adsnkj
The feedback must be of minumum 40 characters
The feedback must be of minumum 40 characters

You are asking your first question!
How to quickly get a good answer:
  • Keep your question short and to the point
  • Check for grammar or spelling errors.
  • Phrase it like a question
Test description