Papers › SwinIR: Image Restoration Using Swin Transformer

SwinIR: Image Restoration Using Swin Transformer

23 Aug 2021arXiv:2108.10257archive 2025-07-28

Jingyun Liang, JieZhang Cao, Guolei Sun, Kai Zhang, Luc van Gool, Radu Timofte

Image restoration is a long-standing low-level vision problem that aims to restore high-quality images from low-quality images (e.g., downscaled, noisy and compressed images). While state-of-the-art image restoration methods are based on convolutional neural networks, few attempts have been made with Transformers which show impressive performance on high-level vision tasks. In this paper, we propose a strong baseline model SwinIR for image restoration based on the Swin Transformer. SwinIR consists of three parts: shallow feature extraction, deep feature extraction and high-quality image reconstruction. In particular, the deep feature extraction module is composed of several residual Swin Transformer blocks (RSTB), each of which has several Swin Transformer layers together with a residual connection. We conduct experiments on three representative tasks: image super-resolution (including classical, lightweight and real-world image super-resolution), image denoising (including grayscale and color image denoising) and JPEG compression artifact reduction. Experimental results demonstrate that SwinIR outperforms state-of-the-art methods on different tasks by up to 0.14\sim$0.45dB}$, while the total number of parameters can be reduced by $\textbf{up to 67%}$.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2108.10257")

Code

Syntology Ran 30 of 45 code samples harvested from 6 repositories linked to this paper; 15 have no recorded run. Of those that ran: 7 ran · our draft was wrong; 7 ran · fixture could not drive it; 16 ran with no contract checked.

By repository: official repository: 3 samples from 1 repository, 1 ran; community (archive-listed): 40 samples from 5 repositories, 27 ran; 2 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

jingyunliang/swinir officialmentioned in papermentioned on GitHubpytorch report
ayanglab/swinganmr mentioned on GitHubpytorch report
ayanglab/swinmr mentioned on GitHubpytorch report
jingyunliang/vrt mentioned on GitHubpytorch report
mv-lab/swin2sr mentioned on GitHubpytorch report
rami0205/ngramswin mentioned on GitHubpytorchApache-2.0 report
skchen1993/SwinIR mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

45 samples harvested; 30 ran; 0 honoured the contract we drafted; 15 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

7ran · our draft was wrong
7ran · fixture could not drive it
16ran
15unverified

Licence: 5 of the 45 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 6 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

setup jingyunliang/swinir/main_test_swinir.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 31b521c272528885 · report
RSTB jingyunliang/swinir/models/network_swinir.py official repository unverified Apache-2.0 (permissive) · 13721b7fb0c3449e · report
SwinIR jingyunliang/swinir/models/network_swinir.py official repository unverified Apache-2.0 (permissive) · a8c3f25f547b1cd4 · report
Mlp pilot7747/sldl/sldl/image/swinir.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 9b7e99667d6f97b5 · report
PatchEmbed pilot7747/sldl/sldl/image/swinir.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · c3d1df420e59f005 · report
PatchEmbed mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · f1109f9b1b73dca7 · report
PatchUnEmbed pilot7747/sldl/sldl/image/swinir.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 2d3ebe5f83f401e2 · report
PatchUnEmbed mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) ran Apache-2.0 (permissive) · 926e8d276bb28da7 · report
PatchUnEmbed XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) ran · metamorphic tier: invariant Apache-2.0 (permissive) · 1ca0dd483faa6682 · report
RSTB pilot7747/sldl/sldl/image/swinir.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 83d329df57a93e38 · report
RSTB skchen1993/SwinIR/models/network_swinir.py community (archive-listed) ran no licence file found · pointer only · c9ad6c972cd89083 · report
SwinIR pilot7747/sldl/sldl/image/swinir.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 15fea014fc69f0c6 · report
Upsample pilot7747/sldl/sldl/image/swinir.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · d4fd867e299aa381 · report
UpsampleOneStep pilot7747/sldl/sldl/image/swinir.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 66093c479a99786e · report
UpsampleOneStep mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) ran Apache-2.0 (permissive) · ffe7885c0403a8ad · report
Upsample_hf mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) ran Apache-2.0 (permissive) · d32e066d4cc1a4ce · report
WindowAttention pilot7747/sldl/sldl/image/swinir.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 6184e406e3b12051 · report
WindowAttention mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) ran Apache-2.0 (permissive) · 0b773949f1dbd046 · report
WindowAttention XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) ran Apache-2.0 (permissive) · a79acfc7f5245c04 · report
_no_grad_trunc_normal_ XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · c30c007e9c6365e0 · report
drop_path XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · 52d96aa31ed74a56 · report
setup mv-lab/swin2sr/main_test_swin2sr.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · c1dd0848500dd803 · report
trunc_normal_ XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · 0af416f19e3851c1 · report
window_partition XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · 60363d0620f5778d · report
window_partition mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · f9fd6241d935f07b · report
window_partition rami0205/ngramswin/my_model/ngswin_model/win_partition.py community (archive-listed) ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 2e2b1611530d7466 · report
window_partition pilot7747/sldl/sldl/image/swinir.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · def274ea4faeed8e · report
window_reverse XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 4f003e9ad9b7a7cb · report
window_reverse mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · fb32094c6dbece71 · report
window_reverse pilot7747/sldl/sldl/image/swinir.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · f424ec76ee33ee41 · report
BasicLayer pilot7747/sldl/sldl/image/swinir.py community (archive-listed) unverified Apache-2.0 (permissive) · b8c4b72467b45853 · report
BasicLayer mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) unverified Apache-2.0 (permissive) · 4b45c8b3f6e06e21 · report
BasicLayer skchen1993/SwinIR/models/network_swinir.py community (archive-listed) unverified no licence file found · pointer only · c0fa116516c7281e · report
BasicLayer XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) unverified Apache-2.0 (permissive) · b03980f33707e7ed · report
PatchEmbed XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) unverified Apache-2.0 (permissive) · 0ad2bdf7da7fee45 · report
RSTB mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) unverified Apache-2.0 (permissive) · 5b79ebccea629915 · report
RSTB XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) unverified Apache-2.0 (permissive) · f56a662c7641524f · report
Swin2SR mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) unverified Apache-2.0 (permissive) · eeeeae50440c5756 · report
SwinIR skchen1993/SwinIR/models/network_swinir.py community (archive-listed) unverified no licence file found · pointer only · d59939ffe142f76f · report
SwinIR XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) unverified Apache-2.0 (permissive) · b6fd49729a87480e · report
SwinTransformerBlock pilot7747/sldl/sldl/image/swinir.py community (archive-listed) unverified Apache-2.0 (permissive) · 21b564ba0365248a · report
SwinTransformerBlock mv-lab/swin2sr/models/network_swin2sr.py community (archive-listed) unverified Apache-2.0 (permissive) · f09171fe10737272 · report
SwinTransformerBlock XPixelGroup/BasicSR/basicsr/archs/swinir_arch.py community (archive-listed) unverified Apache-2.0 (permissive) · 16d322e629d07ccc · report
window_partition identical code first harvested elsewhere ran · fixture could not drive it fingerprinted licence of this copy not recorded · 144d10b49baeb8a6 · report
window_reverse identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · 61bf152e6a42a184 · report

Tasks

Color Image DenoisingDenoisingGrayscale Image DenoisingImage DenoisingImage ReconstructionImage RestorationImage Super-ResolutionJpeg Compression Artifact ReductionSuper-ResolutionVideo Super-Resolution

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Color Image Denoising Kodak24 sigma50 SwinIR PSNR 29.79 #6 of 9 Archive leaderboard report
Color Image Denoising Urban100 sigma10 SwinIR PSNR 35.13 #2 of 2 Archive leaderboard report
Color Image Denoising Urban100 sigma25 SwinIR PSNR 32.9 #5 of 6 Archive leaderboard report
Color Image Denoising Urban100 sigma50 SwinIR PSNR 29.82 #6 of 9 Archive leaderboard report
Color Image Denoising urban100 sigma15 SwinIR Average PSNR 35.13 #5 of 8 Archive leaderboard report
Grayscale Image Denoising BSD68 sigma15 SwinIR PSNR 31.97 #3 of 16 Archive leaderboard report
Grayscale Image Denoising Urban100 sigma15 SwinIR PSNR 33.70 #2 of 7 Archive leaderboard report
Grayscale Image Denoising Urban100 sigma25 SwinIR PSNR 31.3 #5 of 10 Archive leaderboard report
Grayscale Image Denoising Urban100 sigma50 SwinIR PSNR 27.98 #5 of 10 Archive leaderboard report
Image Super-Resolution Manga109 - 4x upscaling SwinIR PSNR 32.22 #16 of 50 Archive leaderboard report
Image Super-Resolution Manga109 - 4x upscaling SwinIR SSIM 0.9273 #16 of 50 Archive leaderboard report
Image Super-Resolution Set14 - 4x upscaling SwinIR PSNR 29.15 #22 of 104 Archive leaderboard report
Image Super-Resolution Set14 - 4x upscaling SwinIR SSIM 0.7958 #22 of 104 Archive leaderboard report
Image Super-Resolution Urban100 - 4x upscaling SwinIR PSNR 27.45 #15 of 65 Archive leaderboard report
Image Super-Resolution Urban100 - 4x upscaling SwinIR SSIM 0.8254 #15 of 65 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x264 BSQ-rate over ERQA 0.76 #3 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x264 BSQ-rate over LPIPS 0.559 #3 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x264 BSQ-rate over MS-SSIM 0.736 #3 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x264 BSQ-rate over PSNR 6.268 #3 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x264 BSQ-rate over Subjective Score 0.304 #3 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x264 BSQ-rate over VMAF 0.642 #3 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x265 BSQ-rate over ERQA 1.575 #5 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x265 BSQ-rate over LPIPS 1.474 #5 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x265 BSQ-rate over MS-SSIM 4.641 #5 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x265 BSQ-rate over PSNR 8.13 #5 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x265 BSQ-rate over Subjective Score 0.346 #5 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + x265 BSQ-rate over VMAF 1.304 #5 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + uavs3e BSQ-rate over ERQA 6.803 #9 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + uavs3e BSQ-rate over LPIPS 1.671 #9 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + uavs3e BSQ-rate over MS-SSIM 4.411 #9 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + uavs3e BSQ-rate over PSNR 15.144 #9 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + uavs3e BSQ-rate over Subjective Score 0.639 #9 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + uavs3e BSQ-rate over VMAF 1.848 #9 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + aomenc BSQ-rate over ERQA 10.854 #14 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + aomenc BSQ-rate over LPIPS 4.566 #14 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + aomenc BSQ-rate over MS-SSIM 7.105 #14 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + aomenc BSQ-rate over PSNR 15.144 #14 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + aomenc BSQ-rate over Subjective Score 0.835 #14 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + aomenc BSQ-rate over VMAF 3.32 #14 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + vvenc BSQ-rate over ERQA 6.624 #20 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + vvenc BSQ-rate over LPIPS 1.552 #20 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + vvenc BSQ-rate over MS-SSIM 5.758 #20 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + vvenc BSQ-rate over PSNR 8.971 #20 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + vvenc BSQ-rate over Subjective Score 1.35 #20 of 85 Archive leaderboard report
Video Super-Resolution MSU Super-Resolution for Video Compression SwinIR + vvenc BSQ-rate over VMAF 0.887 #20 of 85 Archive leaderboard report
Video Super-Resolution MSU Video Super Resolution Benchmark: Detail Restoration SwinIR 1 - LPIPS 0.895 #23 of 32 Archive leaderboard report
Video Super-Resolution MSU Video Super Resolution Benchmark: Detail Restoration SwinIR ERQAv1.0 0.618 #23 of 32 Archive leaderboard report
Video Super-Resolution MSU Video Super Resolution Benchmark: Detail Restoration SwinIR FPS 0.407 #23 of 32 Archive leaderboard report
Video Super-Resolution MSU Video Super Resolution Benchmark: Detail Restoration SwinIR PSNR 25.12 #23 of 32 Archive leaderboard report
Video Super-Resolution MSU Video Super Resolution Benchmark: Detail Restoration SwinIR QRCRv1.0 0 #23 of 32 Archive leaderboard report
Video Super-Resolution MSU Video Super Resolution Benchmark: Detail Restoration SwinIR SSIM 0.782 #23 of 32 Archive leaderboard report
Video Super-Resolution MSU Video Super Resolution Benchmark: Detail Restoration SwinIR Subjective score 4.799 #23 of 32 Archive leaderboard report
Video Super-Resolution MSU Video Upscalers: Quality Enhancement SwinIR-Real-B LPIPS 0.183 #4 of 48 Archive leaderboard report
Video Super-Resolution MSU Video Upscalers: Quality Enhancement SwinIR-Real-B PSNR 28.86 #4 of 48 Archive leaderboard report
Video Super-Resolution MSU Video Upscalers: Quality Enhancement SwinIR-Real-B SSIM 0.830 #4 of 48 Archive leaderboard report
Video Super-Resolution MSU Video Upscalers: Quality Enhancement SwinIR-Real-S LPIPS 0.189 #7 of 48 Archive leaderboard report
Video Super-Resolution MSU Video Upscalers: Quality Enhancement SwinIR-Real-S PSNR 28.55 #7 of 48 Archive leaderboard report
Video Super-Resolution MSU Video Upscalers: Quality Enhancement SwinIR-Real-S SSIM 0.845 #7 of 48 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxStochastic DepthSwin TransformerTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections