All models

swinir (MMagic)

A Swin Transformer image restorer, captured in its lightweight ×2 super-resolution form.

Diffusion and generative · 1,231 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 (27 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
910.2K
Operations
1,231
Framework
PyTorch
Recurrent
No
Published
ICCV Workshops 2021
Cited by
4,997 (as of 18 October 2026)
Authors
Jingyun Liang, Jiezhang Cao, Guolei Sun and others
Name in source
mmagic:swinir
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
m6160
Graph hash
09b3f5353a2b28311911b55f57dfc7e6c5816191cd79ff7da37ab04f1c28d2fa
Skeleton hash
7344b2434c078c63d08fe1a9a94f8bf347c37e05ddd7e4237a739d49d9875452
Architecture hash
95564cced34e80a823f1f3b8209d7278f70785fbe14caa4f06f6b14c283c7b6e
Diagram SHA-256
d8257b697f28781a56c1d1599dac7ec415944503b2fe0748f267b3c0bd6004e4
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

SwinIR is a Transformer for image restoration: it takes a low-quality image, whether downscaled, noisy or compressed, and tries to give back the high-quality one. At the time, state-of-the-art image restoration methods were based on convolutional neural networks, and few attempts had been made with Transformers. The authors' answer is a strong baseline model for image restoration based on the Swin Transformer.

SwinIR consists of three parts: shallow feature extraction, deep feature extraction and high-quality image reconstruction. The shallow stage is a single convolution layer whose output is passed straight to the reconstruction module so as to preserve low-frequency information. The deep stage is a chain of residual Swin Transformer blocks (RSTB), each of which has several Swin Transformer layers together with a residual connection. Each block also ends with a convolution layer, added for feature enhancement, before the residual shortcut. Inside the Swin layers, self-attention runs within local windows, and regular and shifted window partitioning alternate so that information can cross window borders. For super-resolution, the reconstruction module upsamples with a sub-pixel convolution layer.

The build captured here is the lightweight super-resolution configuration: for lightweight image SR the authors decrease RSTB number and channel number to 4 and 60, respectively. Even that small model outperforms competitive lightweight methods by a PSNR margin of up to 0.53dB on different benchmark datasets. Across all tasks, the paper reports that SwinIR outperforms state-of-the-art methods by up to 0.14∼0.45dB, while the total number of parameters can be reduced by up to 67%. One quirk worth knowing: SwinIR converges faster and better than RCAN, contrary to the usual complaint that Transformer-based models suffer from slow convergence. Another: the window size is set to 7 for JPEG compression artifact reduction rather than 8, because the authors observed a significant performance drop at 8, possibly because JPEG encoding uses 8 × 8 image partitions.

Key idea. SwinIR brought the Swin Transformer's windowed, shifted self-attention to low-level vision and showed it achieves better PSNR with fewer parameters than existing image super-resolution methods.

  • swinir
  • swin ir
  • image restoration using swin transformer
  • swin transformer for image restoration
  • image restoration
  • super-resolution
  • image super-resolution
  • denoising
  • jpeg artifact reduction
  • lightweight sr
  • mmagic

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

Cite the paper

@misc{liang2021swinirimagerestorationusing,
      title={SwinIR: Image Restoration Using Swin Transformer}, 
      author={Jingyun Liang and Jiezhang Cao and Guolei Sun and Kai Zhang and Luc Van Gool and Radu Timofte},
      year={2021},
      eprint={2108.10257},
      archivePrefix={arXiv},
      primaryClass={eess.IV},
      url={https://arxiv.org/abs/2108.10257}, 
}