All models

monai.MultiScalePatchDiscriminator

pix2pixHD's multi-scale PatchGAN discriminator, one PatchGAN per level of an image pyramid.

Diffusion and generative · 44 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 (17 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
2.8M
Operations
44
Framework
PyTorch
Recurrent
No
Published
CVPR (arXiv 2017)
Cited by
4,495 (as of 9 October 2026)
Authors
Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu and others
License
Apache-2.0
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
m7436
Graph hash
e796aa5976a0939c50ae29b70bd2005114a65e727a5598738204506d39195e28
Skeleton hash
c12b8cb05a753aa009517004b6183289893fab52afef82f81d27e0099ea6591f
Architecture hash
f6db7e3588e45af727ef4cb9d47270be3070a87d678a76cd166906766bce2d49
Diagram SHA-256
4dbad0d081e2cf9cd6b56ef00da400a02ae75270e0aa4d36f63337d29d0b8f11
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

How this diagram was made

monai.networks.nets.patchgan_discriminator.MultiScalePatchDiscriminator(num_d=2, num_layers_d=3, spatial_dims=2, channels=8, in_channels=1, out_channels=1, minimum_size_im=256)

What it is

This is the multi-scale PatchGAN discriminator of pix2pixHD, as implemented in MONAI. In the pix2pix setup it comes from, the generator translates semantic label maps into realistic-looking images while the discriminator tries to tell real images from translated ones. The problem at high resolution is that a discriminator needs a large receptive field, and getting one with a deeper network or bigger kernels adds capacity that can overfit.

The answer is three discriminators with an identical structure that operate at different image scales. Real and synthesized images are downsampled by factors of 2 and 4 to form a three-level pyramid, and each discriminator is trained on one level. The coarsest-scale discriminator has the largest receptive field and steers the generator toward globally consistent images. Without the multi-scale discriminators, the authors saw many repeated patterns in generated images. Each discriminator in the paper is a 70 × 70 PatchGAN. Its blocks are 4 × 4 Convolution-InstanceNorm-LeakyReLU layers with stride 2, followed by a convolution to a 1-dimensional output. The adversarial loss is augmented with a feature matching loss on intermediate discriminator features, which stabilizes training by making the generator match natural statistics at multiple scales.

MONAI's version builds several PatchGAN discriminators that process the image at different spatial scales. Each subsequent discriminator gets one additional convolution layer, so its output size is halved. Filters start at the channels argument and double with each layer. A minimum_size_im guard makes sure the requested stack will not downsample the input below a size of 1. The member traced here is a small configuration with two discriminators of three layers each, 8 starting filters and a single-channel 256 × 256 input.

Key idea. Three identical PatchGAN discriminators applied to a three-scale image pyramid, so the coarse one enforces global consistency while the fine one pushes for detail.

  • multiscale patchgan
  • multi-scale discriminator
  • pix2pixhd
  • pix2pixhd discriminator
  • patchgan
  • monai multiscalepatchdiscriminator
  • gan discriminator
  • conditional gan
  • high-resolution image synthesis

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

Cite the paper

@misc{wang2018highresolutionimagesynthesissemantic,
      title={High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs}, 
      author={Ting-Chun Wang and Ming-Yu Liu and Jun-Yan Zhu and Andrew Tao and Jan Kautz and Bryan Catanzaro},
      year={2018},
      eprint={1711.11585},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1711.11585}, 
}