Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

SwinIR: Image Restoration Using Swin Transformer

Swin Transformer blocks can restore degraded images better than CNNs

  • Problem CNN restorers use the same kernel on every region and model long-range dependencies poorly. Earlier Transformer restorers cut images into fixed patches, so border pixels cannot use neighbouring pixels.
  • Method SwinIR builds restoration from Swin Transformer blocks. It runs shallow and deep feature extraction, with plain convolutions at the entrance and exit, and predicts a residual added back to the input.
  • Results SwinIR outperforms state-of-the-art methods by up to 0.47 dB on classical super-resolution when trained on DIV2K and Flickr2K. It also reduces the parameter count by up to 67 percent.

Why CNN restorers and patch Transformers get stuck

Image restoration turns a degraded input into a clean image, and it covers super-resolution, denoising and JPEG artifact reduction. CNNs have become the default tool for these tasks, and most CNN work refines the architecture with residual and dense connections. The authors argue that the convolution layer itself causes two weaknesses for restoration.

The first weakness is that a convolution kernel's interaction with the image doesn't depend on the content, so the same kernel is used on every region. The second is that a convolution works locally, which makes long-range dependencies hard to model. A Transformer avoids both, because self-attention captures global interactions, but earlier restoration Transformers cut the image into fixed-size patches such as 48×48.

Each patch is processed on its own, so border pixels can't use neighbouring pixels outside the patch. Border artifacts can appear around each patch, and overlapping the patches reduces them but adds computation. Swin Transformer offers a middle path, since local attention suits large images and the shifted window scheme models long-range dependency.

The key idea and the three-stage layout

The key idea is to put Swin Transformer blocks at the core of a restoration network, with plain convolutions at the entrance and exit of the feature path. The authors expected the convolution placed at the end of feature extraction to bring convolution's inductive bias into the Transformer part. That convolution is also meant to give a stable base for merging shallow and deep features later.

The shallow stage applies one 3×3 convolution to the low-quality input, which has size H×W×Cin, and produces a C-channel feature. The shallow feature mostly carries low frequencies, and it is passed forward for the reconstruction stage.

The deep stage runs K residual Swin Transformer blocks in sequence, and each block takes the output of the one before it. The intermediate features follow \(F_i = H_{RSTB_i}(F_{i-1})\), and a final 3×3 convolution gives \(F_{DF} = H_{CONV}(F_K)\).

For super-resolution the reconstruction upsamples with a sub-pixel convolution layer, while denoising and JPEG artifact reduction use a single convolution. The network predicts a residual that is added back to the input, so the output is \(I^{RHQ} = H_{SwinIR}(I^{LQ}) + I^{LQ}\).

Inside one residual Swin Transformer block

Each RSTB runs L Swin Transformer layers on its input and then one convolution, and it adds its own input back at the end. This is written as \(F_{i,out} = H^{CONV}_i(F_{i,L}) + F_{i,0}\), where the layers produce \(F_{i,j} = H^{STL}_{i,j}(F_{i,j-1})\). The authors give two reasons for the convolution, which adds spatially invariant filters and so supports translational equivariance.

The skip connection also lets features from different blocks flow into the reconstruction stage.

Inside a Swin Transformer layer, the feature is cut into non-overlapping M×M windows, and self-attention runs separately inside each window. Queries, keys and values come from shared projection matrices, so the same weights apply to every window. The attention is \(\mathrm{Attention}(Q,K,V) = \mathrm{SoftMax}(QK^T/\sqrt{d} + B)V\), where B is a learnable relative positional encoding.

Several heads run in parallel and their outputs are concatenated, which gives the multi-head self-attention.

A two-layer MLP with GELU between the layers follows, and layer normalization sits before both the attention and the MLP. Each module has its own residual connection, so \(X = \mathrm{MSA}(\mathrm{LN}(X)) + X\) and then \(X = \mathrm{MLP}(\mathrm{LN}(X)) + X\).

Loss functions by task

For super-resolution the authors minimise the L1 pixel loss, \(L = \|I^{RHQ} - I^{HQ}\|_1\), between the output and the ground-truth image. Classical and lightweight SR use only this naive loss, so that the gains can be read as coming from the network. Real-world SR adds GAN and perceptual losses to improve visual quality.

Denoising and JPEG artifact reduction use the Charbonnier loss, \(L = \sqrt{\|I^{RHQ} - I^{HQ}\|^2 + \epsilon^2}\).

What the ablations show about the design and the training scale

For the ablations the authors trained SwinIR on DIV2K for ×2 classical SR and tested it on Manga109. Channel number was set to 180 because PSNR kept rising with it, but the parameter count grows quadratically. The RSTB and layer numbers were both set to 6, since their gains saturate beyond that.

Table 1 compares four RSTB designs, with no residual connection, a 1×1 convolution, a 3×3 convolution and three 3×3 convolutions. The 3×3 convolution variant reaches 39.58 dB, compared to 39.42 dB with no residual connection, which is the 0.16 dB gain the authors report. The 1×1 convolution gives only 39.45 dB, which the authors attribute to its inability to capture local neighbour information the way a 3×3 kernel does.

Compared with RCAN, SwinIR's PSNR curve rises faster during training and ends higher. The gap grows as the training patch size grows. SwinIR still beats CNN models trained on the same data when only 25 percent of the images, about 200 images, are used. The authors note that this runs against earlier reports that Transformers converge slowly.

Classical super-resolution results

Trained on DIV2K, SwinIR is best on almost all five benchmarks at ×2, ×3 and ×4. The largest gain is 0.26 dB on Manga109 at ×4. The authors attribute this to a Transformer-based design, since the CNN attention methods RCAN, HAN and NLSA all do worse.

With DIV2K+Flickr2K training the gain grows to 0.47 dB.

Visually, SwinIR restores high-frequency details and reduces blur, while most CNN methods give blurry images or wrong textures. IPT is better than the CNN methods but shows image distortions and border artifacts.

Lightweight and real-world super-resolution

For lightweight SR the authors reduce the RSTB number to 4 and the channel number to 60. At ×2, SwinIR has 878K parameters and 195.6G Mult-Adds, compared to 1,592K parameters and 222.8G for CARN. Across the benchmarks SwinIR exceeds the compared lightweight methods by up to 0.53 dB PSNR at similar cost.

For real-world SR the authors retrained SwinIR with the degradation model of BSRGAN. There are no ground-truth HQ images in this setting, so the comparison is visual only. The authors find SwinIR's edges clearer and sharper than those of ESRGAN, RealSR, BSRGAN and Real-ESRGAN.

Denoising and JPEG artifact reduction

SwinIR has 12.0M parameters, while DRUNet has 32.7M, so the authors read this as an efficient use of parameters. The visual results show that SwinIR keeps high-frequency details, while other methods either oversmooth or oversharpen.

For JPEG artifact reduction on Classic5 and LIVE1 at quality factors 10, 20, 30 and 40, SwinIR gains at least 0.11 dB and 0.07 dB on the two datasets.

Limitations

The ablation studies use only ×2 classical SR tested on Manga109. Real-world SR is compared only visually, and the larger real-world model is described only on the project page. The comparisons with IPT use different training data, since IPT was trained on ImageNet. Deblurring and deraining are named as future work, so they are untested. The JPEG window size is 7 rather than 8, because the authors saw a clear drop at 8.

Paper info

Authors
Jingyun Liang, Jiezhang Cao, Guolei Sun, Kai Zhang, Luc Van Gool, Radu Timofte
Venue
arXiv · Preprint
First published
2021-8-23
Added
2026-11-11
Updated
2021-8-23
Version
v1
arXiv
2108.10257
Category
eess.IV · cs.CV
Original paper terms
CC BY-NC-ND 4.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Jingyun Liang, Jiezhang Cao, Guolei Sun, Kai Zhang, Luc Van Gool, Radu Timofte (2021). SwinIR: Image Restoration Using Swin Transformer. arXiv:2108.10257v1. https://arxiv.org/abs/2108.10257v1

BibTeX
@misc{liang2021swinir,
  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},
  url = {https://arxiv.org/abs/2108.10257v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up