All models

swinir_color_jpeg_car

SwinIR for color JPEG artifact removal: window-7 Swin attention predicting a residual over the compressed input.

Image classification · 240 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 (16 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
58.9K
Operations
240
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
m12181
Graph hash
72768c3971730ea46e2f03bb6a76c04616dda2b0d5bcb9741d256d917bcfad08
Skeleton hash
dfacff191ed6d995986f4a4a248bfd6d52191fd4023c3d06dff813380b088579
Architecture hash
d6514e427dfd27659ad7ea9739590e03068a0c43f86265d4e4cd8e356c6f99b0
Diagram SHA-256
6a402ce59ccee5604675c0c5a0dbe50019e43b418e84117b8dc8dc9a4d585fc9
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_color_jpeg_car: 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 tasks without upsampling, such as JPEG compression artifact reduction, a single convolution layer does the reconstruction. It also uses residual learning, predicting the residual between the low-quality and high-quality image rather than the image itself. The window size drops to 7 for this task because 8 caused a significant performance drop, possibly because JPEG encodes 8 × 8 blocks. Training uses the Charbonnier loss. On Classic5 and LIVE1 across quality factors, SwinIR gains at least 0.11 dB and 0.07 dB on average. It does so with 11.5M parameters, against 32.7M for the previous best model DRUNet. 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 color jpeg car
  • JPEG compression artifact reduction
  • JPEG artifact removal
  • CAR
  • color image restoration
  • 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}, 
}