All models

swinir_classical_sr_x4

A Swin Transformer network that upscales an image by a factor of 4 (classical super-resolution).

Diffusion and generative · 245 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 (23 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
124K
Operations
245
Framework
PyTorch
Recurrent
No
Published
ICCV Workshops (arXiv 2021)
Cited by
4,689 (as of 9 October 2026)
Authors
Jingyun Liang, Jiezhang Cao, Guolei Sun 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
m12179
Graph hash
8b8cb6bb96ea5dcfe5a178196f4cb20d59d9204895a72dfe23644195473de513
Skeleton hash
40d7f19660b0f92a2e0f0ac985f2a1f95b3bcd6fbdaa27776597b5d2ffb13c1b
Architecture hash
87b0d2826e62845016973c5e31d226733abe84a74acca37ea1ecfc6151293305
Diagram SHA-256
d37e05243cabf7708cd7ddd8dec2a62f1fdc3bfc3037deb6e6f3123dc74d5d4a
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.swinir:build_swinir_classical_sr_x4: build({})

What it is

SwinIR is an image restoration model based on the Swin Transformer. This model is the classical super-resolution version at a scale factor of 4, the setting where the paper reports its largest gain over earlier methods, 0.26dB in PSNR on Manga109.

The network has three parts: shallow feature extraction, deep feature extraction and image reconstruction. A convolution layer extracts the shallow features, which go straight to the reconstruction module to preserve low-frequency information. The deep features come from a stack of residual Swin Transformer blocks (RSTB), each made of Swin Transformer layers, a convolution layer and a residual connection. Inside those layers self-attention is computed within local windows, and regular and shifted window partitions alternate so that information crosses window borders. For super-resolution the reconstruction module upsamples the features with a sub-pixel convolution layer.

For classical super-resolution the paper sets the number of RSTBs, the layers per block, the window size, the channel number and the attention heads to 6, 6, 8, 180 and 6. The paper reports 11.8M parameters for SwinIR in this comparison, fewer than the 15.4M to 44.3M of the convolutional models it is compared with.

Key idea. The paper builds an image restoration network from residual Swin Transformer blocks and reports gains over earlier methods on super-resolution, denoising and JPEG artifact reduction with fewer parameters.

  • SwinIR
  • swinir classical sr x4
  • image super-resolution
  • classical image SR
  • image restoration
  • x4 upscaling
  • residual swin transformer block
  • RSTB
  • shifted window attention
  • single image super-resolution

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}, 
}