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

Jun-Yan Zhu, Taesung Park, Phillip Isola, Alexei A. Efros

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.

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.

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 , converting an image from one representation of a given scene, xx, to another, yy, 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 {xi,yi}i=1N\{x_{i},y_{i}\}_{i=1}^{N} are available (Figure 2, left), e.g., . 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., ), 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., zebra\leftrightarrowhorse, 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 XX and a different set in domain YY. We may train a mapping G:XYG:X\rightarrow Y such that the output y^=G(x)\hat{y}=G(x), xXx\in X, is indistinguishable from images yYy\in Y by an adversary trained to classify y^\hat{y} apart from yy. In theory, this objective can induce an output distribution over y^\hat{y} that matches the empirical distribution pdata(y)p_{data}(y) (in general, this requires GG to be stochastic) . The optimal GG thereby translates the domain XX to a domain Y^\hat{Y} distributed identically to YY. However, such a translation does not guarantee that an individual input xx and output yy are paired up in a meaningful way – there are infinitely many mappings GG that will induce the same distribution over y^\hat{y}. 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 .

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 . Mathematically, if we have a translator G:XYG:X\rightarrow Y and another translator F:YXF:Y\rightarrow X, then GG and FF should be inverses of each other, and both mappings should be bijections. We apply this structural assumption by training both the mapping GG and FF simultaneously, and adding a cycle consistency loss that encourages F(G(x))xF(G(x))\approx x and G(F(y))yG(F(y))\approx y. Combining this loss with adversarial losses on domains XX and YY 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. We provide both PyTorch and Torch implementations. Check out more results at our website.

Related work

Generative Adversarial Networks (GANs) have achieved impressive results in image generation , image editing , and representation learning . Recent methods adopt the same idea for conditional image generation applications, such as text2image , image inpainting , and future prediction , as well as to other domains like videos and 3D data . The key to GANs’ success is the idea of an adversarial loss that forces the generated images to be, in principle, indistinguishable from real photos. This loss 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 images 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 , who employ a non-parametric texture model 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., ). Our approach builds on the “pix2pix” framework of Isola et al. , which uses a conditional generative adversarial network to learn a mapping from input to output images. Similar ideas have been applied to various tasks such as generating photographs from sketches or from attribute and semantic layouts . However, unlike the above prior work, 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: XX and YY. Rosales et al. 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 and cross-modal scene networks use a weight-sharing strategy to learn a common representation across domains. Concurrent to our method, Liu et al. extends the above framework with a combination of variational autoencoders and generative adversarial networks . Another line of concurrent work encourages the input and output to share specific “content” features even though they may differ in “style“. These methods 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 , image pixel space , and image feature space .

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 . In the language domain, verifying and improving translations via “back translation and reconciliation” is a technique used by human translators (including, humorously, by Mark Twain ), as well as by machines . More recently, higher-order cycle consistency has been used in structure from motion , 3D shape matching , co-segmentation , dense semantic alignment , and depth estimation . Of these, Zhou et al. and Godard et al. 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 GG and FF to be consistent with each other. Concurrent with our work, in these same proceedings, Yi et al. independently use a similar objective for unpaired image-to-image translation, inspired by dual learning in machine translation .

Neural Style Transfer 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 primary 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\rightarrow photo, object transfiguration, etc. where single sample transfer methods do not perform well. We compare these two methods in Section 5.2.

Formulation

We apply adversarial losses to both mapping functions. For the mapping function G:XYG:X\rightarrow Y and its discriminator DYD_{Y}, we express the objective as:

where GG tries to generate images G(x)G(x) that look similar to images from domain YY, while DYD_{Y} aims to distinguish between translated samples G(x)G(x) and real samples yy. GG aims to minimize this objective against an adversary DD that tries to maximize it, i.e., minGmaxDYLGAN(G,DY,X,Y)\min_{G}\max_{D_{Y}}\mathcal{L}_{\text{GAN}}(G,D_{Y},X,Y). We introduce a similar adversarial loss for the mapping function F:YXF:Y\rightarrow X and its discriminator DXD_{X} as well: i.e., minFmaxDXLGAN(F,DX,Y,X)\min_{F}\max_{D_{X}}\mathcal{L}_{\text{GAN}}(F,D_{X},Y,X).

2 Cycle Consistency Loss

Adversarial training can, in theory, learn mappings GG and FF that produce outputs identically distributed as target domains YY and XX respectively (strictly speaking, this requires GG and FF to be stochastic functions) . 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 xix_{i} to a desired output yiy_{i}. 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 xx from domain XX, the image translation cycle should be able to bring xx back to the original image, i.e., xG(x)F(G(x))xx\rightarrow G(x)\rightarrow F(G(x))\approx x. We call this forward cycle consistency. Similarly, as illustrated in Figure 3 (c), for each image yy from domain YY, GG and FF should also satisfy backward cycle consistency: yF(y)G(F(y))yy\rightarrow F(y)\rightarrow G(F(y))\approx y. We 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 F(G(x))F(G(x)) and xx, and between G(F(y))G(F(y)) and yy, but did not observe improved performance.

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

3 Full Objective

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

Notice that our model can be viewed as training two “autoencoders” : we learn one autoencoder FG:XXF\circ G:X\rightarrow X jointly with another GF:YYG\circ F:Y\rightarrow Y. However, these autoencoders each have special internal structures: 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” , 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 XXX\rightarrow X autoencoder is that of the domain YY.

In Section 5.1.4, we compare our method against ablations of the full objective, including the adversarial loss LGAN\mathcal{L}_{\text{GAN}} alone and the cycle consistency loss Lcyc\mathcal{L}_{\text{cyc}} 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.

Implementation

We adopt the architecture for our generative networks from Johnson et al. who have shown impressive results for neural style transfer and super-resolution. This network contains three convolutions, several residual blocks , two fractionally-strided convolutions with stride 12\frac{1}{2}, and one convolution that maps features to RGB. We use 66 blocks for 128×128128\times 128 images and 99 blocks for 256×256256\times 256 and higher-resolution training images. Similar to Johnson et al. , we use instance normalization . For the discriminator networks we use 70×7070\times 70 PatchGANs , which aim to classify whether 70×7070\times 70 overlapping image patches are real or fake. Such a patch-level discriminator architecture has fewer parameters than a full-image discriminator and can work on arbitrarily-sized images in a fully convolutional fashion .

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

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

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 PyTorch and Torch code, models, and full results can be found at our website.

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

AMT perceptual studies On the map\leftrightarrowaerial 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. , except we only gather data from 2525 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 1010 trials of each session were practice and feedback was given as to whether the participant’s response was correct or incorrect. The remaining 4040 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. The numbers we report here are not directly comparable to those in as our ground truth images were processed slightly differently We train all the models on 256×256256\times 256 images while in pix2pix , the model was trained on 256×256256\times 256 patches of 512×512512\times 512 images, and run convolutionally on the 512×512512\times 512 images at test time. We choose 256×256256\times 256 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 (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 .

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 , and use it to evaluate the Cityscapes labels\rightarrowphoto 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 ). 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 the road”, then we have succeeded if the FCN applied to the generated photo detects “car on the road”.

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

1.2 Baselines

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

SimGAN Like our method, Shrivastava et al. uses an adversarial loss to train a translation from XX to YY. The regularization term xG(x)1\lVert x-G(x)\rVert_{1} i s used to penalize making large changes at pixel level.

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

BiGAN/ALI Unconditional GANs learn a generator G:ZXG:Z\rightarrow X, that maps a random noise zz to an image xx. The BiGAN and ALI propose to also learn the inverse mapping function F:XZF:X\rightarrow Z. Though they were originally designed for mapping a latent vector zz to an image xx, we implemented the same objective for mapping a source image xx to a target image yy.

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

For a fair comparison, we implement all the baselines using the same architecture and details as our method, except for CoGAN . 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.

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, can 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 maps\rightarrowaerial photos direction and the aerial photos\rightarrowmaps direction at 256×256256\times 256 resolutionWe also train CycleGAN and pix2pix at 512×512512\times 512 resolution, and observe the comparable performance: maps\rightarrowaerial photos: CycleGAN: 37.5%±3.6%37.5\%\pm 3.6\% and pix2pix: 33.9%±3.1%33.9\%\pm 3.1\%; aerial photos\rightarrowmaps: CycleGAN: 16.5%±4.1%16.5\%\pm 4.1\% and pix2pix: 8.5%±2.6%8.5\%\pm 2.6\%. All the baselines almost never fooled participants.

Table 2 assesses the performance of the labels\rightarrowphoto task on the Cityscapes and Table 3 evaluates the opposite mapping (photos\rightarrowlabels). In both cases, our method again outperforms the baselines.

1.4 Analysis of the loss function

1.5 Image reconstruction quality

In Figure 4, we show a few random samples of the reconstructed images F(G(x))F(G(x)). We observed that the reconstructed images were often close to the original inputs xx, at both training and testing time, even in cases where one domain represents significantly more diverse information, such as map\leftrightarrowaerial photos.

1.6 Additional results on paired datasets

Figure 8 shows some example results on other paired datasets used in “pix2pix” , such as architectural labels\leftrightarrowphotos from the CMP Facade Database , and edges\leftrightarrowshoes from the UT Zappos50K dataset . 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.

2 Applications

We demonstrate our method on several applications where paired training data does not exist. Please refer to the appendix (Section 7) 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. Unlike recent work on “neural style transfer” , 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 526526, 10731073, 400400, and 563563 for Cezanne, Monet, Van Gogh, and Ukiyo-e.

Object transfiguration (Figure 13) The model is trained to translate one object class from ImageNet to another (each class contains around 10001000 training images). Turmukhambetov et al. propose 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 854854 winter photos and 12731273 summer photos of Yosemite downloaded from Flickr.

Without Lidentity\mathcal{L}_{\text{identity}}, the generator GG and FF 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 flower photos taken by smartphones, which usually have deep DoF due to a small aperture. The target contains photos captured by DSLRs with a larger aperture. Our model successfully generates photos with shallower depth of field from the photos taken by smartphones.

Comparison with Gatys et al. In Figure 15, we compare our results with neural style transfer on photo stylization. For each row, we first use two representative artworks as the style images for . Our method, on the other hand, can 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” with Gatys et al .

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

Limitations and Discussion

Although our method can achieve compelling results in many cases, the results are far from uniformly positive. Figure 17 shows several typical failure cases. On translation tasks that involve color and texture changes, as 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 dog\rightarrowcat transfiguration, the learned translation degenerates into making minimal changes to the input (Figure 17). This failure might be caused by our generator architectures 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, our method has got confused in the horse \rightarrow zebra example (Figure 17, right), 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 photos\rightarrowlabels task. Resolving 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.

References

Appendix

We train our networks from scratch, with a learning rate of 0.00020.0002. In practice, we divide the objective by 22 while optimizing DD, which slows down the rate at which DD learns, relative to the rate of GG. We keep the same learning rate for the first 100100 epochs and linearly decay the rate to zero over the next 100100 epochs. Weights are initialized from a Gaussian distribution N(0,0.02)\mathcal{N}(0,0.02).

Cityscapes label\leftrightarrowPhoto 29752975 training images from the Cityscapes training set with image size 128×128128\times 128. We used the Cityscapes val set for testing.

Maps\leftrightarrowaerial photograph 10961096 training images were scraped from Google Maps with image size 256×256256\times 256. 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 labels\leftrightarrowphoto 400400 training images from the CMP Facade Database .

Edges\rightarrowshoes around 50,00050,000 training images from UT Zappos50K dataset . The model was trained for 55 epochs.

Horse\leftrightarrowZebra and Apple\leftrightarrowOrange We downloaded the images from ImageNet using keywords wild horse, zebra, apple, and navel orange. The images were scaled to 256×256256\times 256 pixels. The training set size of each class: 939939 (horse), 11771177 (zebra), 996996 (apple), and 10201020 (orange).

Summer\leftrightarrowWinter Yosemite The images were downloaded using Flickr API with the tag yosemite and the datetaken field. Black-and-white photos were pruned. The images were scaled to 256×256256\times 256 pixels. The training size of each class: 12731273 (summer) and 854854 ( winter).

Photo\leftrightarrowArt for style transfer The art images were downloaded from Wikiart.org. Some artworks that were sketches or too obscene were pruned by hand. The photos were downloaded from Flickr using the combination of tags landscape and landscapephotography. Black-and-white photos were pruned. The images were scaled to 256×256256\times 256 pixels. The training set size of each class was 10741074 (Monet), 584584 (Cezanne), 401401 (Van Gogh), 14331433 (Ukiyo-e), and 68536853 (Photographs). The Monet dataset was particularly pruned to include only landscape paintings, and the Van Gogh dataset included only his later works that represent his most recognizable artistic style.

Monet’s paintings\rightarrowphotos To achieve high resolution while conserving memory, we used random square crops of the original images for training. To generate results, we passed images of width 512512 pixels with correct aspect ratio to the generator network as input. The weight for the identity mapping loss was 0.5λ0.5\lambda where λ\lambda was the weight for cycle consistency loss. We set λ=10\lambda=10.

Flower photo enhancement Flower images taken on smartphones 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 360360 pixels by width. The identity mapping loss of weight 0.5λ0.5\lambda was used. The training set size of the smartphone and DSLR dataset were 18131813 and 33263326, respectively. We set λ=10\lambda=10.

2 Network architectures

We provide both PyTorch and Torch implementations.

Generator architectures We adopt our architectures from Johnson et al. . We use 66 residual blocks for 128×128128\times 128 training images, and 99 residual blocks for 256×256256\times 256 or higher-resolution training images. Below, we follow the naming convention used in the Johnson et al.’s Github repository.

Let c7s1-k denote a 7×77\times 7 Convolution-InstanceNorm-ReLU layer with kk filters and stride 11. dk denotes a 3×33\times 3 Convolution-InstanceNorm-ReLU layer with kk filters and stride 22. Reflection padding was used to reduce artifacts. Rk denotes a residual block that contains two 3×33\times 3 convolutional layers with the same number of filters on both layer. uk denotes a 3×33\times 3 fractional-strided-Convolution-InstanceNorm-ReLU layer with kk filters and stride 12\frac{1}{2}.

The network with 6 residual blocks consists of: c7s1-64,d128,d256,R256,R256,R256, R256,R256,R256,u128,u64,c7s1-3

The network with 9 residual blocks consists of: c7s1-64,d128,d256,R256,R256,R256, R256,R256,R256,R256,R256,R256,u128 u64,c7s1-3

Discriminator architectures For discriminator networks, we use 70×7070\times 70 PatchGAN . Let Ck denote a 4×44\times 4 Convolution-InstanceNorm-LeakyReLU layer with k filters and stride 22. After the last layer, we apply a convolution to produce a 11-dimensional output. We do not use InstanceNorm for the first C64 layer. We use leaky ReLUs with a slope of 0.20.2. The discriminator architecture is: C64-C128-C256-C512