SwinIR
SwinIR is a Transformer-based image restoration model developed by Jingyun Liang and the research team at ETH Zurich that achieves state-of-the-art performance across multiple restoration tasks including super-resolution, image denoising, and JPEG compression artifact removal.
Key Highlights
Swin Transformer Architecture
Efficiently captures both local texture details and long-range structural dependencies with shifted window attention mechanism
Multiple Restoration Tasks
Supports various image restoration tasks including super-resolution, image denoising and JPEG compression artifact removal
Efficient Computation
An efficient transformer architecture providing superior performance with fewer parameters and computations compared to CNN-based methods
Benchmark Leader
Results outperforming CNN-based methods on standard benchmarks including Set5, Set14, BSD100, Urban100 and Manga109
About
SwinIR (Swin Transformer for Image Restoration) is a Transformer-based image restoration model that achieves state-of-the-art performance across multiple restoration tasks including super-resolution, image denoising, and JPEG compression artifact removal. Developed by Jingyun Liang and the research team at ETH Zurich in 2021, SwinIR represents a pivotal shift from CNN-based approaches to Transformer architectures in the image restoration domain, demonstrating that vision transformer technology is equally effective for low-level image processing tasks that were traditionally dominated by convolutional networks.
The technical foundation of SwinIR relies on Swin Transformer blocks that employ a shifted window mechanism for computing self-attention. This approach reduces the quadratic computational complexity of standard Transformers to linear complexity relative to image size, enabling efficient processing of high-resolution images that would be prohibitively expensive with global attention. The architecture comprises three main components: a shallow feature extraction layer using a single convolutional layer, a deep feature extraction module consisting of multiple Residual Swin Transformer blocks (RSTB) with residual connections, and an image reconstruction module tailored to each specific task. Channel attention mechanisms further enhance feature representation, allowing the model to selectively emphasize the most informative channels for each restoration operation.
SwinIR has been trained and evaluated across five distinct restoration tasks: classical super-resolution with bicubic downsampling, lightweight super-resolution with reduced parameters for resource-constrained deployment, real-world super-resolution handling unknown degradations, JPEG compression artifact removal at various quality levels, and both color and grayscale image denoising at multiple noise levels. Pre-trained weights are provided for each task configuration individually. The lightweight variant achieves impressive results with only 878K parameters, while the full model with 11.8M parameters delivers maximum quality, providing deployment flexibility ranging from mobile devices to server environments.
Practical applications span diverse industries and use cases with broad professional relevance. Photographers and restoration specialists use SwinIR for recovering degraded vintage photographs and enhancing scan quality from archival materials. Media companies employ it for archival footage restoration and broadcast quality improvement. Web platforms integrate it into upload pipelines for automatic image enhancement of user-generated content. In scientific domains, SwinIR finds applications in medical imaging for enhancing MRI and CT scan resolution, satellite imagery processing for remote sensing analysis, and microscopy image enhancement. Its JPEG artifact removal capability is particularly valuable for rescuing images that have suffered quality degradation through repeated social media sharing and compression cycles. Educational publishing also benefits from its ability to enhance visual materials.
In the academic landscape, SwinIR serves as a benchmark reference model for image restoration research worldwide. It surpasses CNN-based methods on traditional metrics like PSNR and SSIM while remaining competitive on perceptual quality measures such as LPIPS and FID. The model is implemented in PyTorch and can be exported to ONNX format for cross-platform deployment flexibility across different inference frameworks. Its widespread adoption by the research community has spawned numerous variants, adaptations, and extensions that continue to push the boundaries of restoration quality in competitions and real-world applications.
One of SwinIR's most significant advantages is its ability to handle multiple restoration tasks within a single architectural framework, reducing the need to deploy and maintain separate specialized models in production environments. Released under the Apache 2.0 license, it is freely available for both academic research and commercial applications without restriction. As a foundational work in Transformer-based image restoration, SwinIR has directly inspired next-generation models including HAT, Restormer, and SRFormer, cementing its enduring legacy as a transformative contribution to the image processing research field.
Use Cases
Academic Image Restoration
Using as a baseline architecture and benchmark model in image restoration research
Photo Upscaling
Enhancing detail and sharpness by upscaling low-resolution photos at 2x, 3x or 4x
JPEG Artifact Removal
Cleaning up blocking and blurring artifacts caused by heavy JPEG compression
Image Denoising
Removing noise from images shot in low light or with high ISO values
Pros & Cons
Pros
- Outperforms state-of-the-art methods by 0.14-0.45dB while using up to 67% fewer parameters than CNN and transformer counterparts
- Exceptional parameter efficiency with 11.8M parameters vs IPT's 115M+
- Produces visually pleasing images with clear and sharp edges; avoids artifacts common in other methods
- Strong performance across multiple restoration tasks including super-resolution, denoising, and JPEG compression reduction
Cons
- Newer models like HAT have surpassed SwinIR in PSNR and SSIM scores across all scales
- Room for improvement in handling periodic noise and combining local-global features
- As a 2021 model, may struggle to compete with most current architectures
- 4.2% improvement seen when merged with Lewin architecture; standalone may be insufficient
Technical Details
Parameters
12M
Architecture
Swin Transformer with residual and convolutional layers
Training Data
DIV2K and Flickr2K datasets for training, Set5/Set14/Urban100 for evaluation
License
Apache 2.0
Features
- Shifted Window Self-Attention
- 2x/3x/4x Super-Resolution
- JPEG Artifact Removal
- Image Denoising
- Residual Swin Transformer Blocks
- Lightweight Model Architecture
Benchmark Results
| Metric | Value | Compared To | Source |
|---|---|---|---|
| PSNR (Set5, ×4) | 32.92 dB | RCAN: 32.63 dB | ICCV 2021 Workshop Paper |
| SSIM (Set5, ×4) | 0.9044 | RCAN: 0.9002 | ICCV 2021 Workshop Paper |
| PSNR (Urban100, ×4) | 27.45 dB | RCAN: 26.82 dB | ICCV 2021 Workshop Paper |
| Parametre Sayısı | 11.8M | EDSR: 43M | GitHub JingyunLiang/SwinIR |
Available Platforms
Frequently Asked Questions
Related Models
CodeFormer
Evaluate CodeFormer for a permitted portrait restoration: compare fidelity settings, inspect face changes and recomposition, and check the non-commercial S-Lab license.
FidelityFx Super Resolution
FidelityFX Super Resolution (FSR) is AMD's open-source spatial upscaling technology designed to boost performance in real-time rendering applications, particularly video games. Unlike NVIDIA's DLSS which requires dedicated Tensor Cores, FSR is hardware-agnostic and runs on AMD, NVIDIA, and Intel GPUs including integrated graphics. The technology has evolved through multiple generations: FSR 1.0 used Lanczos-based spatial upscaling on single frames, FSR 2.0 introduced temporal upscaling leveraging motion vectors and previous frame data for near-native quality, and FSR 3.0 added optical flow-based frame generation to dramatically increase perceived frame rates. Quality modes range from Ultra Quality to Ultra Performance, letting users balance visual fidelity against performance gains of up to 2x or more. FSR supports DirectX 11, DirectX 12, and Vulkan APIs and is deployed across PC, Xbox, PlayStation, and portable devices like Steam Deck where it enables playable frame rates within limited GPU power budgets. Hundreds of major titles including Cyberpunk 2077, Starfield, and Hogwarts Legacy feature FSR integration, with engine-level support in Unreal Engine and Unity simplifying adoption. Released under the MIT license through AMD's GPUOpen platform, FSR encourages transparent collaboration and modification by developers and researchers. Its platform independence and open-source nature have made it one of the most widely adopted upscaling solutions in the gaming industry, shaping the future of real-time image quality enhancement.
Real-ESRGAN
Real-ESRGAN is an open-source image upscaling and restoration model developed by Xintao Wang and collaborators at Tencent ARC Lab that enhances low-resolution, degraded, or compressed images to high-resolution outputs with remarkable detail recovery. Released in 2021 under the BSD license, Real-ESRGAN builds on the original ESRGAN architecture by introducing a high-order degradation modeling approach that simulates the complex, unpredictable quality loss found in real-world images, including compression artifacts, noise, blur, and downsampling. The model uses a U-Net architecture with Residual-in-Residual Dense Blocks as its generator network, trained with a combination of perceptual loss, GAN loss, and pixel loss to produce sharp, natural-looking upscaled results. Real-ESRGAN supports upscaling factors of 2x, 4x, and higher, and includes specialized model variants for anime and illustration content alongside the general-purpose photographic model. The model handles real-world degradations far better than its predecessor ESRGAN, which was trained only on synthetic degradation patterns. Real-ESRGAN has become one of the most widely deployed AI upscaling solutions, integrated into numerous applications including desktop tools, web services, mobile apps, and professional image editing workflows. The model runs efficiently on both CPU and GPU, with the lighter RealESRGAN-x4plus-anime variant optimized for consumer hardware. As a fully open-source project available on GitHub with pre-trained weights, it serves as the backbone for popular tools like Upscayl and various ComfyUI nodes. Real-ESRGAN is essential for photographers, content creators, game developers, and anyone who needs to enhance image resolution while preserving natural appearance and adding realistic detail.
StableSR
StableSR is an innovative super-resolution model developed by Jianyi Wang and collaborators that leverages the generative prior of a pre-trained Stable Diffusion model for high-quality image upscaling with realistic detail synthesis. Released in 2023 under the Apache 2.0 license, StableSR represents one of the first successful applications of diffusion-based generative models to the image super-resolution task. The model introduces a time-aware encoder that injects information from the low-resolution input image into the Stable Diffusion denoising process at each timestep, along with a controllable feature wrapping module that balances between fidelity to the original image and the richness of generated details. This architecture enables StableSR to produce upscaled images with remarkably realistic textures and fine details that go beyond what traditional regression-based super-resolution methods can achieve. The controllable feature wrapping allows users to adjust the strength of generative enhancement, providing a spectrum from conservative restoration that closely follows the input to aggressive enhancement that adds more synthesized detail. StableSR handles diverse image types including photographs, artwork, screenshots, and text-containing images, with particular strength in restoring natural textures like skin, hair, fabric, and foliage. The model is fully open source with code and pre-trained weights available on GitHub and is compatible with existing Stable Diffusion infrastructure. StableSR is valuable for photographers restoring low-resolution images, digital artists upscaling reference material, and content creators who need high-resolution outputs from limited source imagery. Its diffusion-based approach has influenced subsequent research in generative super-resolution methods.
Quick Info
Swin Transformer with residual and convolutional layers