All models

mmagic_partial_conv

A U-Net-like inpainting network that fills holes in images using partial convolutions.

Diffusion and generative · 46 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 (47 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
234.7K
Operations
46
Framework
PyTorch
Recurrent
No
Published
Lecture Notes in Computer Science (arXiv 2018)
Cited by
2,420 (as of 9 October 2026)
Authors
Guilin Liu, Fitsum A. Reda, Kevin J. Shih and others
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
m12026
Graph hash
4014905bb1c82b7d106c6ee67800316a69ef41046305ee6bc417b27d7b5f3fae
Skeleton hash
033db4495e527db5397d408b3fe9114405183421503d8c9739802f4c66dcae91
Architecture hash
2921749826f7889aa62988a5515f734c7e358d1b8fbda949fde2fd40d77d8d90
Diagram SHA-256
344285a983515d6900bafdb4367a8c713ec0ab3f096009c89a5bf8571719f955
TorchLens version
2.35.3
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

menagerie.classics.partialconv_unet:build_partialconv_unet_places: build({})

What it is

This model does image inpainting, the task of filling in holes in an image. The paper observes that deep learning methods of its time ran a standard convolutional network over the corrupted image, so filter responses depended on the substitute values in the holes as well as on valid pixels. It reports that this often leads to artifacts such as color discrepancy and blurriness.

The paper proposes partial convolutions instead, where the convolution is masked and renormalized so that it is conditioned only on valid pixels. After each partial convolution the mask is updated as well: a location is marked valid if the convolution could condition its output on at least one valid input value. With enough layers of these updates, even the largest masked holes eventually shrink away. The network is a UNet-like architecture in which all convolutional layers are replaced with partial convolutional layers, with nearest neighbor up-sampling in the decoding stage. Its skip links concatenate the masks as well as the feature maps.

The authors generated their own irregular masks, 55,116 for training and 24,866 for testing. The comparison reports L1 error, PSNR and SSIM on Places2 and the Inception score on ImageNet. On those measurements the paper reports that its method outperforms all the other compared methods on irregular masks. The authors note that it fails for some sparsely structured images, such as the bars on a door, and struggles on the largest holes.

Key idea. The paper proposes partial convolutions, masked and renormalized to depend only on valid pixels, with an automatic mask update for the next layer.

  • partial convolution
  • PConv
  • partial convolution U-Net
  • image inpainting
  • irregular holes
  • irregular masks
  • hole filling
  • mask update

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

Cite the paper

@misc{liu2018imageinpaintingirregularholes,
      title={Image Inpainting for Irregular Holes Using Partial Convolutions}, 
      author={Guilin Liu and Fitsum A. Reda and Kevin J. Shih and Ting-Chun Wang and Andrew Tao and Bryan Catanzaro},
      year={2018},
      eprint={1804.07723},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1804.07723}, 
}