pix2pix_patch_discriminator
The 70 by 70 PatchGAN discriminator of pix2pix, judging each image patch as real or fake.
Diffusion and generative · 12 operations Checked
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
- 2.8M
- Operations
- 12
- Framework
- PyTorch
- Recurrent
- No
- Published
- CVPR (arXiv 2016)
- Cited by
- 22,864 (as of 18 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 file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m8192
- Graph hash
- fc11f303f7310141c7b78b357ac8c22d95fc807fdb6a8dbe5edffb834eca441e
- Skeleton hash
- 7b29dd51f4691098acea977acd9d1cad6c926fd31499aa69539ce831ce6f4615
- Architecture hash
- 813b19920e3d4e9c0e1bb411cb3010c007f50fd743893049551262a2cc97eeb1
- Diagram SHA-256
- 31b9e5c0fd4eaf86cd76d96b5444969e36d6176f60158e806b38c92261ca61c7
- 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
This is the PatchGAN discriminator from pix2pix, the conditional adversarial network that the paper proposes as a general-purpose solution to image-to-image translation. The appeal of the pix2pix approach is that the network learns not only the mapping from input image to output image but also a loss function to train that mapping. The paper demonstrates it on synthesizing photos from label maps, reconstructing objects from edge maps and colorizing images.
The discriminator is a convolutional PatchGAN classifier that only penalizes structure at the scale of image patches, while an L1 term handles low-frequency correctness. It tries to classify whether each N by N patch in an image is real or fake, running convolutionally across the image and averaging all responses to produce the final output. A smaller PatchGAN has fewer parameters, runs faster and can be applied to arbitrarily large images. The paper notes that such a discriminator effectively models the image as a Markov random field, assuming independence between pixels separated by more than a patch diameter.
The traced member is the 70 by 70 variant, whose architecture is C64-C128-C256-C512 followed by a convolution that maps to a 1-dimensional output. All its convolutions are 4 by 4 spatial filters applied with stride 2, each downsampling by a factor of 2. BatchNorm is skipped on the first C64 layer, and the paper's ablation found that this 70 by 70 receptive field gave the best FCN-scores among the patch sizes it tried, with 16 by 16 close behind and the full 286 by 286 ImageGAN falling off. The code comes from the authors' PyTorch rewrite of pix2pix and CycleGAN, which they say produces results comparable to or better than the original Torch software.
Key idea. The PatchGAN discriminator restricts adversarial feedback to local N by N patches, classifying each patch as real or fake and averaging the responses, which gives a small, fast discriminator that works on arbitrarily large images.
- PatchGAN
- pix2pix
- pix2pix discriminator
- conditional GAN
- cGAN
- image-to-image translation
- NLayerDiscriminator
- 70x70 PatchGAN
- Isola
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},
}