Paper commentary
Image-to-Image Translation with Conditional Adversarial Networks
- Problem Pixel-wise regression losses blur image outputs, and writing a loss that yields sharp, realistic results for each translation task usually needs expert work.
- Method Trains a conditional GAN whose discriminator sees the input and output pair, adds a weighted L1 term, and uses a U-Net generator with a PatchGAN discriminator.
- Results On Cityscapes labels↔photos, per-pixel accuracy rises from 0.42 with L1 alone to 0.66 with L1+cGAN.
Why a learned loss is needed
Many image tasks can be framed as turning one kind of image into another, for example label maps into photos, edge maps into objects, or grayscale images into color. Such tasks have usually been handled by separate, special-purpose methods, even though the input and output are always images. This paper asks whether one conditional GAN framework can serve as a general solution across these tasks.
The difficulty lies in the training loss. A pixel-wise Euclidean distance between prediction and ground truth is minimized by averaging over every plausible output, which produces blurry results. Designing a loss that forces sharp, realistic output usually requires expert knowledge for each task. GANs address this by learning a discriminator that judges realism, and the discriminator then acts as the loss for the generator.
The authors report that conditional GANs produce reasonable results on a wide variety of problems. They also offer a simple framework and analyse several architectural choices that affect the results.
Conditional GAN objective
A conditional GAN learns a mapping from an observed image x and a noise vector z to an output image y. The generator G tries to produce outputs that the discriminator D cannot separate from real images, while D is trained to tell generated outputs from real ones. The discriminator sees the input as well as the output, so the learned loss can penalize a mismatch between them.
The generator also observes the input edge map in the edges→photo setup.
G minimizes the conditional objective and D maximizes it. The first expectation runs over real pairs of x and y, and the second over generated outputs G(x,z). An unconditional variant removes x from the discriminator, which lets the authors test the value of conditioning. The conditional and unconditional objectives are written as follows.
\[ \mathcal{L}_{cGAN}(G,D)=\mathbb{E}_{x,y}[\log D(x,y)]+\mathbb{E}_{x,z}[\log(1-D(x,G(x,z)))] \] \[ \mathcal{L}_{GAN}(G,D)=\mathbb{E}_{y}[\log D(y)]+\mathbb{E}_{x,z}[\log(1-D(G(x,z)))] \]
Following earlier work, the authors also add a pixel-wise L1 term, the expected absolute difference between y and G(x,z), to the GAN term. They prefer L1 to L2 because L1 encourages less blurring. The L1 term is written as \( \mathcal{L}_{L1}(G)=\mathbb{E}_{x,y,z}[\|y-G(x,z)\|_1] \), and the full objective is \[ G^*=\arg\min_G\max_D \mathcal{L}_{cGAN}(G,D)+\lambda\mathcal{L}_{L1}(G) \].
In the ablations λ is set to 100.
The generator could in principle use z, but adding Gaussian noise as an input was not effective in initial experiments, because the generator tended to disregard it. In the final models, noise enters only as dropout on several generator layers, active at both training and test time. The outputs show only minor stochasticity, and building conditional GANs with highly stochastic outputs is left open.
Generator skips and patch discriminator
A standard encoder-decoder squeezes all information through a bottleneck layer, which is a poor route for low-level detail such as edges that the input and output share. Figure 3 contrasts the encoder-decoder and the U-Net layouts.
Each module is convolution, batch normalization and ReLU. The encoder is a stack of C64 to C512 layers with 4×4 filters applied at stride 2, and its first layer omits batch normalization. The decoder mirrors the encoder with CD512, CD512 and CD512 blocks that use 50% dropout, followed by C512, C256, C128 and C64 layers and a final convolution with Tanh.
The PatchGAN discriminator classifies each N×N patch of the image as real or fake and averages the responses across the image. Since the L1 term already handles low frequencies, the discriminator only needs to model high-frequency structure in local patches. Section 4.4 shows that N can be much smaller than the image size and still give high-quality results, which keeps the discriminator small and fast and lets it run on large images.
Treating the image as a Markov random field with independence beyond a patch diameter makes the PatchGAN a form of texture or style loss.
Optimization and test-time inference
Training alternates one gradient step on D with one step on G. Following the original GAN recipe, G is trained to maximize log D(x,G(x,z)) instead of minimizing log(1−D(x,G(x,z))). The D objective is divided by 2 during optimization, which slows D relative to G.
Optimization uses minibatch SGD with the Adam solver, a learning rate of 0.0002 and momentum parameters β1 = 0.5 and β2 = 0.999. Batch sizes range from 1 to 10 depending on the experiment.
With batch size 1 this becomes instance normalization, which the authors note has been effective for image generation.
Datasets and training scale
The experiments cover Cityscapes labels↔photo, CMP Facades architectural labels→photo, Google Maps map↔aerial photo, BW→color on ImageNet, edges→photo, sketch→photo, day→night, thermal→color and inpainting on Paris StreetView. Edges for the edges→photo models come from the HED edge detector followed by postprocessing, and input and output are 1 to 3 channel images.
The facade set has 400 training images, and the day→night set uses 91 unique webcams for training. The Google Maps set has 1096 training images. Training on the small facade set was fast: the results in Figure 14 took less than two hours on a single Pascal Titan X GPU.
Map and aerial models are trained on 256×256 images and then run convolutionally on 512×512 images at test time. Networks are trained from scratch with Gaussian weight initialization, mean 0 and standard deviation 0.02, and random jitter that resizes inputs to 286×286 and crops back to 256×256.
The day→night set has 17823 training images extracted from 91 webcams, with 10 webcams held out for test.
How outputs are scored
Per-pixel mean-squared error does not assess joint statistics of the output, so it cannot capture the structure that structured losses target. For graphics-style problems such as maps, aerial photos and colorization, the authors use real-versus-fake perceptual studies on Amazon Mechanical Turk.
In each trial an image is shown for 1 second, and Turkers then judge which image is fake with unlimited time. The first 10 images of each session are practice with feedback, and the 40 main trials give no feedback. About 50 Turkers evaluated each algorithm. Unlike the protocol of [62], the authors did not include vigilance trials.
For Cityscapes, the authors train an FCN-8s segmentation network on the Cityscapes data and score each synthesized photo by how accurately the network recovers the labels it was synthesized from. The authors treat this as a pseudo-metric, based on the idea that realistic outputs should be classified correctly by classifiers trained on real images.
Which loss terms matter
Per-pixel accuracy rises from 0.42 with L1 alone to 0.66 with L1+cGAN, against 0.80 for ground truth. Class IOU rises from 0.11 with L1 to 0.17 with L1+cGAN, and the other variants fall between these values.
Removing the input from the discriminator drops per-pixel accuracy to 0.22 for GAN, compared with 0.57 for cGAN. The authors observed that the unconditional generator collapsed to nearly the same output regardless of the input photo, so the discriminator must judge the match between input and output.
The authors report that cGAN alone gives sharper results with visual artifacts on some tasks, and that adding L1 with λ = 100 reduces these artifacts. The L1 term also pushes outputs to respect the input label maps, so L1+GAN is effective and the combined L1+cGAN performs similarly well.
The authors argue that L1 favors the median of the conditional color distribution, which yields grayish colors, while an adversarial loss can push outputs toward the true color distribution. In the Lab-space histogram comparison, L1 scores 0.81, 0.69 and 0.70 for L, a and b, and cGAN scores 0.87, 0.74 and 0.84. The histogram intersection scores are dominated by the high-probability region, while the plots emphasize low-probability regions.
U-Net versus encoder-decoder
With L1 loss, per-pixel accuracy is 0.35 for the encoder-decoder and 0.48 for the U-Net. With L1+cGAN, per-pixel accuracy is 0.29 for the encoder-decoder and 0.55 for the U-Net, and class IOU is 0.05 and 0.14.
The U-Net rows in this comparison were trained with batch size 10, whereas the other tables used batch size 1. With batch size 1, batch normalization zeroes the bottleneck activations, which effectively skips the innermost layer. The encoder-decoder cannot skip its bottleneck, so it needs a batch size above 1, whereas the U-Net does not.
The encoder-decoder was unable to learn realistic images in the authors' experiments. The authors argue the advantage is not specific to conditional GANs, because a U-Net trained with L1 alone also beats the encoder-decoder.
Patch size of the discriminator
Per-pixel accuracy is 0.39 for a 1×1 receptive field, 0.65 for 16×16, 0.66 for 70×70 and 0.42 for 286×286. Per-class accuracy is 0.15, 0.21, 0.23 and 0.16 for the same four sizes, and class IOU is 0.10, 0.17, 0.17 and 0.11. Input images are 256×256 and larger fields are padded with zeros.
The 70×70 PatchGAN gives sharp outputs in both spatial and spectral dimensions, and the 286×286 ImageGAN looks similar visually but has a lower FCN-score. The 70×70 patch alleviates the tiling artifacts and achieves slightly better scores than the 16×16 patch, so the experiments outside this section use 70×70 PatchGANs.
The authors suggest the 286×286 ImageGAN may be harder to train because it has more parameters and greater depth than the 70×70 PatchGAN.
Real-versus-fake study on maps
For map→photo, 18.9% ± 2.5% of trials labeled L1+cGAN outputs as real, against 0.8% ± 0.3% for L1. For photo→map, L1+cGAN reached 6.1% ± 1.3% and L1 reached 2.8% ± 1.0%.
The aerial photos from the cGAN fooled participants on 18.9% of trials, well above the L1 baseline, which produces blurry results that rarely fooled anyone. In the photo→map direction the cGAN fooled participants on 6.1% of trials, and a bootstrap test found no significant difference from L1.
A model trained on 256×256 images is run convolutionally on 512×512 map and aerial images, and the outputs are downsampled to 256×256 for the Turkers.
Colorization against prior work
In the same study, L2 regression from [62] reached 16.3% ± 2.4%, Zhang et al. 2016 reached 27.8% ± 2.7%, and the L1+cGAN method reached 22.5% ± 1.6%. The conditional GAN scored similarly to the L2 variant of [62], and the bootstrap test found the difference insignificant, but it fell short of the full method of [62]. The authors note that the method of [62] was specifically engineered to do well on colorization.
The authors note a common failure mode of colorization with cGANs: some outputs come out grayscale or desaturated.
Photo to labels
On Cityscapes photo→labels, L1 reaches per-pixel accuracy 0.86, cGAN 0.74 and L1+cGAN 0.83. Class IOU is 0.35 for L1, 0.22 for cGAN and 0.29 for L1+cGAN, and per-class accuracy is 0.42, 0.28 and 0.36.
The cGAN outputs look sharp and close to the ground truth at a glance, but they include many small, hallucinated objects. The authors argue that vision problems, where the output is less complex than the input, have less ambiguous targets, so reconstruction losses such as L1 are mostly sufficient.
The label maps are not exactly discrete, because they were resized with bilinear interpolation and saved as JPEG images with compression artifacts.
Limitations
Dropout gives only minor stochasticity in the outputs, so conditional GANs that capture the full entropy of their conditional distributions remain an open question.
The authors report artifacts where the input image is sparse and difficulty with unusual inputs, and they show some of the worst results on each task as failure cases.
The perceptual studies use the protocol described above, without vigilance trials, and the FCN-score is a pseudo-metric rather than a direct measure of realism. On day→night, the test set uses 10 webcams.
The community applications are creative projects that were not obtained under controlled scientific conditions, and some may rely on modifications to the released code.
Paper info
- Authors
- Isola, Phillip, Zhu, Jun-Yan, Zhou, Tinghui, Efros, Alexei A.
- Venue
- arXiv · Preprint
- First published
- 2016-11-21
- Added
- 2026-10-20
- Updated
- 2018-11-26
- Version
- v3
- arXiv
- 1611.07004
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Isola, Phillip, Zhu, Jun-Yan, Zhou, Tinghui, Efros, Alexei A. (2016). Image-to-Image Translation with Conditional Adversarial Networks. arXiv:1611.07004v3. https://arxiv.org/abs/1611.07004v3
BibTeX
@misc{phillip2016image,
title = {{Image-to-Image Translation with Conditional Adversarial Networks}},
author = {Isola, Phillip and Zhu, Jun-Yan and Zhou, Tinghui and Efros, Alexei A.},
year = {2016},
eprint = {1611.07004},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1611.07004v3}
}