All models

pytorch_gan_pix2pix_generator

The conditional GAN that maps one image into another, with a U-Net generator and a PatchGAN judge.

Diffusion and generative · 55 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (22 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
54.4M
Operations
55
Framework
PyTorch
Recurrent
No
Published
CVPR 2017
Cited by
22,860 (as of 17 October 2026)
Authors
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, Alexei A. Efros
License
BSD-3-Clause
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m8443
Graph hash
6a7627ad9e90e7e70d7ce2e165847fcb1fa55a6a211fa5b6ccea922ca405723d
Skeleton hash
3de39c58a474c2ca60811d3593a26641c87c67adaa3db5147381bf272c58c762
Architecture hash
68e985abcd25184c5f1c0dab0c880eadcab05fa5128ab5a061b9a355f2fbc3c3
Diagram SHA-256
c37b7c868f2945e008df72b97366c60b3b755aa401fa5a51ddd6bfd56947e4cb
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

pix2pix is the conditional adversarial network that turned image-to-image translation into one generic recipe: the same architecture and objective, simply trained on different data. Rather than hand-designing a loss for each task, the network learns the mapping from input image to output image and also learns a loss function to train that mapping. The paper shows it synthesizing photos from label maps, reconstructing objects from edge maps and colorizing images, among other tasks.

The motivation is that a plain Euclidean loss averages all plausible outputs and so blurs, whereas a GAN learns a loss under which blurry images are not tolerated because they look obviously fake. The final objective mixes the conditional GAN loss with an L1 term, chosen over L2 because L1 encourages less blurring. The generator is a U-Net: an encoder-decoder with skip connections between each layer i and layer n − i that concatenate their channels, so low-level information such as edge locations can bypass the bottleneck. The discriminator is a PatchGAN that classifies each N × N patch as real or fake, run convolutionally across the image with the responses averaged. Noise enters only as dropout, applied at both training and test time, because the generator simply learned to ignore an explicit noise vector.

Severing the skip connections left the plain encoder-decoder unable to generate realistic images in the authors' experiments. Decent results came from small datasets; the facade training set consists of just 400 images. The captured member is the generator alone, the U-Net-based architecture, without the discriminator. The authors' own PyTorch code, in the CycleGAN and pix2pix repository, produces results comparable to or better than their original Torch software. Since the release of the pix2pix software, a large number of internet users, many of them artists, have posted their own experiments with the system.

Key idea. pix2pix shows that a conditional GAN with a U-Net generator, a PatchGAN discriminator and an L1 term is a general-purpose solution to image-to-image translation.

  • pix2pix
  • image-to-image translation with conditional adversarial networks
  • conditional gan
  • cgan
  • image-to-image translation
  • u-net generator
  • patchgan
  • edges2cats
  • facades
  • cyclegan and pix2pix

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{isola2018imagetoimagetranslationconditionaladversarial,
      title={Image-to-Image Translation with Conditional Adversarial Networks}, 
      author={Phillip Isola and Jun-Yan Zhu and Tinghui Zhou and Alexei A. Efros},
      year={2018},
      eprint={1611.07004},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1611.07004}, 
}