All models

swinir_real_sr_x4

SwinIR retrained on BSRGAN-style degradations for ×4 real-world super-resolution.

Image classification · 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
289K
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
m12184
Graph hash
c4ba8c1f277647c8e3eb828dab5e48e356f8b698c2b3a21ad761a8219f125447
Skeleton hash
cdb6c73c63836c5a05f148ac2b4f12b502d7f62264eca6b7ba2c88cce668ec88
Architecture hash
fa5ec90068e8968a922de9bdf6ccd42a1f958d3419acdf4bf5366db2506fb4b2
Diagram SHA-256
7c9744b18e08e6c5799dfdd77c42cd6029d422a97b5bdea5d7d3c464fa8af49e
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

menagerie.classics.swinir:build_swinir_real_sr_x4: build({})

What it is

SwinIR is an image restoration model built on the Swin Transformer, offered as a strong baseline for the field. Image restoration here means recovering a high-quality image from a downscaled, noisy or compressed one. Its three parts are shallow feature extraction, deep feature extraction and high-quality image reconstruction.

The shallow module is a single convolution whose output is sent straight to the reconstruction module to preserve low-frequency information. Deep features come from a stack of residual Swin Transformer blocks (RSTB), each holding Swin Transformer layers, a convolution layer and a residual connection. A Swin Transformer layer partitions the input into non-overlapping M × M local windows and attends within each one. Long-range dependencies come from the shifted window mechanism. The convolution at the end of the deep module brings the inductive bias of convolution into the Transformer network. The same feature extraction modules serve every restoration task, while the reconstruction module changes per task.

The standard setting uses 6 RSTBs, 6 STLs per block, window size 8, 180 channels and 6 attention heads. For super-resolution the reconstruction module upsamples with a sub-pixel convolution layer. For real-world SR, SwinIR is re-trained with the same degradation model as BSRGAN to synthesize its low-quality training images. The loss here combines pixel, GAN and perceptual terms to improve visual quality. Because real images have no ground truth, the paper offers only visual comparisons against ESRGAN, RealSR, BSRGAN and Real-ESRGAN. In those comparisons SwinIR produces images with clear, sharp edges where the other methods show artifacts. Across tasks the paper reports gains of up to 0.14 to 0.45 dB over prior methods with up to 67% fewer parameters.

Key idea. A Swin-Transformer-based restoration baseline whose deep feature extractor is a stack of residual Swin Transformer blocks, each pairing several Swin Transformer layers with a residual connection.

  • SwinIR
  • swinir real sr x4
  • real-world super-resolution
  • real-world SR
  • x4 upscaling
  • BSRGAN degradation
  • Swin Transformer
  • RSTB
  • image restoration

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