Any Image Restoration via Efficient Spatial-Frequency Degradation Adaptation
Unified restoration for denoising, deraining, dehazing, deblurring, and low-light enhancement.
AnyIR is a single-model framework for all-in-one image restoration, designed to handle diverse degradations without training one model per task.
The key idea is efficient spatial-frequency degradation adaptation with compact model complexity.
- One model for multiple restoration tasks.
- Spatial-frequency fusion for robust degradation-aware representation.
- Strong accuracy-efficiency tradeoff for practical deployment.
Teaser: Overall quantitative performance (3-Degradation & 5-Degradation settings), efficiency comparison, and the qualitative comparison ( Zoom in for a better view).
Bin Ren 1,2$^\star$ , Eduard Zamfir3, Zongwei Wu3$^\dagger$ , Yawei Li4, Yidi Li5, Danda Pani Paudel6, Radu Timofte 3, Ming-Hsuan Yang 7, Luc Van Gool 6, Nicu Sebe 1
1 University of Trento, IT
2 Mohamed bin Zayed University of Artificial Intelligence, UAE
3 University of Würzburg, DE
4 ETH Zürich, CH
5 Taiyuan University of Technology, CN
6 INSAIT Sofia University, "St. Kliment Ohridski", BG
7 University of California, Merced, USA
- Projectpage update.
- Ckpts release.
- Main visual results release
-
02/2026: Model (i.e., code) released. -
07/2024: Repository created.
(a) Framework of the proposed AnyIR: *i.e.*, a convolutional patch embedding, a U-shape encoder-decoder main body, and an extra refined block. (b) Structure of degradation adaptation block (DAB).
Abstract
Restoring multiple degradations efficiently via just one model has become increasingly significant and impactful, especially with the proliferation of mobile devices. Traditional solutions typically involve training dedicated models per degradation, resulting in inefficiency and redundancy. More recent approaches either introduce additional modules to learn visual prompts, significantly increasing the size of the model, or incorporate cross-modal transfer from large language models trained on vast datasets, adding complexity to the system architecture. In contrast, our approach, termed AnyIR, takes a unified path that leverages inherent similarity across various degradations to enable both efficient and comprehensive restoration through a joint embedding mechanism, without scaling up the model or relying on large language models. Specifically, we examine the sub-latent space of each input, identifying key components and reweighting them first in a gated manner. To unify intrinsic degradation awareness with contextualized attention, we propose a spatial–frequency parallel fusion strategy that strengthens spatially informed local–global interactions and enriches restoration fidelity from the frequency domain. Comprehensive evaluations across four all-in-one restoration benchmarks demonstrate that AnyIR attains state-of-the-art performance while reducing model parameters by 84% and FLOPs by 80% relative to the baseline. These results highlight the potential of AnyIR as an effective and lightweight solution for further all-in-one image restoration. Our code is available at: https://github.com/Amazingren/AnyIR.AnyIR/
├── net/ # model definitions (AnyIR)
├── utils/ # datasets, losses, metrics, schedulers
├── data_dir/ # dataset organization helpers
├── train.py # training entry
├── test.py # evaluation entry
├── train_*.sh # training scripts
├── test_*.sh # testing scripts
└── README.md
micromamba create -n anyir python=3.9 -y
micromamba activate anyir
# or
conda create -n anyir python=3.9 -y
conda activate anyir# NOTE: file in this repo is currently named "requiements.txt"
pip install -r requiements.txtexport LD_LIBRARY_PATH=/opt/modules/nvidia-cuda-11.8.0/lib64:$LD_LIBRARY_PATH
export PATH=/opt/modules/nvidia-cuda-11.8.0/bin:$PATHThis repo supports two training/evaluation families:
AnyIR(multi-task restoration benchmarks)CDD11_*subsets (combined degradation setting)
Configure dataset roots via CLI arguments in train.py / test.py (examples below).
python train.py \
--trainset AnyIR \
--ckpt_dir train_ckpt/3deg \
--de_type denoise_15 denoise_25 denoise_50 derain dehaze \
--denoise_dir /path/to/Train/Denoise \
--derain_dir /path/to/Train/Derain \
--dehaze_dir /path/to/Train/Dehaze \
--gopro_dir /path/to/Train/Deblur \
--enhance_dir /path/to/Train/Enhance \
--num_gpus 1 \
--batch_size 32 \
--epochs 130 \
--fft_loss_weight 0.1python train.py \
--trainset AnyIR \
--ckpt_dir train_ckpt/5deg \
--de_type denoise_15 denoise_25 denoise_50 derain dehaze deblur enhance \
--denoise_dir /path/to/Train/Denoise \
--derain_dir /path/to/Train/Derain \
--dehaze_dir /path/to/Train/Dehaze \
--gopro_dir /path/to/Train/Deblur \
--enhance_dir /path/to/Train/Enhance \
--num_gpus 1 \
--batch_size 32 \
--epochs 150 \
--fft_loss_weight 0.1python train.py \
--trainset CDD11_all \
--ckpt_dir train_ckpt/cdd11 \
--de_type denoise_15 denoise_25 denoise_50 derain dehaze \
--cdd11_path /path/to/cdd11 \
--num_gpus 1 \
--batch_size 32 \
--epochs 170 \
--fft_loss_weight 0.1python test.py \
--trainset AnyIR \
--mode 6 \
--denoise_path /path/to/test/denoise \
--derain_path /path/to/test/derain \
--dehaze_path /path/to/test/dehaze \
--gopro_path /path/to/test/deblur \
--enhance_path /path/to/test/enhance \
--ckpt_name 5deg/epoch=109-step=546700.ckpt \
--output_path ./outputs/5deg_testmode options in test.py:
0: denoise1: derain2: dehaze3: deblur4: enhance5: three-task setting6: full five-task setting
python test.py \
--trainset CDD11_low_haze_rain \
--cdd11_path /path/to/cdd11 \
--ckpt_name cdd11/epoch=154-step=378045.ckpt \
--output_path ./output/cdd11/test- Use the provided
train_*.sh/test_*.shas cluster templates. - Save checkpoints under
train_ckpt/<experiment_name>/for consistenttest.py --ckpt_nameusage. - If you use LPIPS, add
--use_lpipsintest.py(slower evaluation).
If you find this project useful, please cite:
@misc{ren2025any,
title={Any Image Restoration via Efficient Spatial-Frequency Degradation Adaptation},
author={Ren, Bin and Zamfir, Eduard and Wu, Zongwei and Li, Yawei and Li, Yidi and Paudel, Danda Pani and Timofte, Radu and Yang, Ming-Hsuan and Van Gool, Luc and Sebe, Nicu},
year={2025},
eprint={2504.14249},
archivePrefix={arXiv},
primaryClass={cs.CV}
}This work was partially supported by the FIS project GUIDANCE (Debugging Computer Vision Models via Controlled Cross-modal Generation) (No. FIS2023-03251), the Alexander von Humboldt Foundation, and the National Natural Science Foundation of China (62403345).
The code base is built on top of excellent prior work, including:

