Skip to content

CVL-UESTC/IET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

[ECCV 2026] From Local Windows to Adaptive Candidates via Individualized Exploratory: Rethinking Attention for Image Super-Resolution

This repository is an official implementation of the paper "From Local Windows to Adaptive Candidates via Individualized Exploratory: Rethinking Attention for Image Super-Resolution", ECCV, 2026.

arXiv Pretrained Models Visual Results

By Chunyu Meng, Wei Long and Shuhang Gu.

Abstract: Single Image Super-Resolution (SISR) is a fundamental computer vision task that aims to reconstruct a high-resolution (HR) image from a low-resolution (LR) input. Transformer-based methods have achieved remarkable performance by modeling long-range dependencies in degraded images. However, their feature-intensive attention computation incurs high computational cost. To improve efficiency, most existing approaches partition images into fixed groups and restrict attention within each group. Such group-wise attention overlooks the inherent asymmetry in token similarities, thereby failing to enable flexible and token-adaptive attention computation. To address this limitation, we propose the Individualized Exploratory Transformer (IET), which introduces a novel Individualized Exploratory Attention (IEA) mechanism that allows each token to adaptively select its own content-aware and independent attention candidates. This token-adaptive and asymmetric design enables more precise information aggregation while maintaining computational efficiency. Extensive experiments on standard SR benchmarks demonstrate that IET achieves state-of-the-art performance under comparable computational complexity.


πŸ“‘ Contents

  1. Environment
  2. Installation
  3. Inference
  4. Training
  5. Testing
  6. Results
  7. Visual Results
  8. Visualization of Attention Distributions
  9. Acknowledgements
  10. Citation

πŸ“’ Environment

  • Python 3.11
  • PyTorch 2.5.0

βš™οΈ Installation

  1. Create conda environment and install dependencies:

    git clone https://github.com/CVL-UESTC/IET.git
    
    conda create -n IET python=3.11
    conda activate IET
    
    pip install -r requirements.txt
    python setup.py develop
  2. Install the CUDA operators for sparse matrix operations:

    cd ./ops_smm
    ./make.sh
    cd ..
  3. Install Neighborhood Attention:

    Make sure to install the older version 0.17.5 or lower, as the new version no longer supports obtaining the attention map. You can also use the .whl file provided here

    pip install natten-0.17.5+torch250cu121-cp311-cp311-linux_x86_64.whl

πŸ”§ Inference

Using inference.py for fast inference on single image or multiple images within the same folder.

# For classical SR
python inference.py -i inference_image.png -o results/test/ --scale 4 --task classical
python inference.py -i inference_images/ -o results/test/ --scale 4 --task classical

# For lightweight SR
python inference.py -i inference_image.png -o results/test/ --scale 4 --task lightweight
python inference.py -i inference_images/ -o results/test/ --scale 4 --task lightweight

The IET SR model processes the image inference_image.png or images within the inference_images/ directory. The results will be saved in the results/test/ directory.

πŸ”© Training

Data Preparation

  • Download the training dataset DF2K (DIV2K + Flickr2K) and put them in the folder ./datasets.
  • It's recommanded to refer to the data preparation from BasicSR for faster data reading speed.

Training Commands

  • Refer to the training configuration files in ./options/train folder for detailed settings.
  • IET (Classical Image Super-Resolution)
# training dataset: DF2K

# Γ—2 scratch, input size = 64Γ—64, 500k iterations
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m torch.distributed.launch --use-env --nproc_per_node=8 --master_port=1145  basicsr/train.py -opt options/train/000_IET_SRx2_scratch.yml --launcher pytorch

# Γ—3 finetune, input size = 64Γ—64, 250k iterations
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m torch.distributed.launch --use-env --nproc_per_node=8 --master_port=1145  basicsr/train.py -opt options/train/002_IET_SRx3_finetune.yml --launcher pytorch

# Γ—4 finetune, input size = 64Γ—64, 250k iterations
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m torch.distributed.launch --use-env --nproc_per_node=8 --master_port=1145  basicsr/train.py -opt options/train/003_IET_SRx4_finetune.yml --launcher pytorch
  • IET-light (Lightweight Image Super-Resolution)
# training dataset: DIV2K

# Γ—2 scratch, input size = 64Γ—64, 500k iterations
CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --use-env --nproc_per_node=4 --master_port=1145  basicsr/train.py -opt options/train/101_IET_light_SRx2_scratch.yml --launcher pytorch

# Γ—3 finetune, input size = 64Γ—64, 250k iterations
CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --use-env --nproc_per_node=4 --master_port=1145  basicsr/train.py -opt options/train/102_IET_light_SRx3_finetune.yml --launcher pytorch

# Γ—4 finetune, input size = 64Γ—64, 250k iterations
CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --use-env --nproc_per_node=4 --master_port=1145  basicsr/train.py -opt options/train/103_IET_light_SRx4_finetune.yml --launcher pytorch

πŸ”¨ Testing

Data Preparation

  • Download the testing data (Set5 + Set14 + BSD100 + Urban100 + Manga109 [download]) and put them in the folder ./datasets.

Pretrained Models

  • Download the pretrained models and put them in the folder ./experiments/pretrained_models.

Testing Commands

  • Refer to the testing configuration files in ./options/test folder for detailed settings.
  • IET (Classical Image Super-Resolution)
  • We have now integrated the patchwise_testing strategy into basicsr/models/iet_model.py. This update allows for successful inference on RTX 4090 GPUs without running into memory issues.
python basicsr/test.py -opt options/test/001_IET_SRx2_scratch.yml
python basicsr/test.py -opt options/test/002_IET_SRx3_finetune.yml
python basicsr/test.py -opt options/test/003_IET_SRx4_finetune.yml
  • IET-light (Lightweight Image Super-Resolution)
python basicsr/test.py -opt options/test/101_IET_light_SRx2_scratch.yml
python basicsr/test.py -opt options/test/102_IET_light_SRx3_finetune.yml
python basicsr/test.py -opt options/test/103_IET_light_SRx4_finetune.yml

πŸ“ˆ Results

  • Classical Image Super-Resolution

  • Lightweight Image Super-Resolution

πŸ”Ž Visual Results

πŸ“‘ Visualization of Attention Distributions

πŸ’– Acknowledgements

This code is built on BasicSR, ATD and PFT.

πŸ“š Citation

@misc{meng2026iet,
      title={From Local Windows to Adaptive Candidates via Individualized Exploratory: Rethinking Attention for Image Super-Resolution}, 
      author={Chunyu Meng and Wei Long and Shuhang Gu},
      year={2026},
      eprint={2601.08341},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2601.08341}, 
}

About

ECCV2026-From Local Windows to Adaptive Candidates via Individualized Exploratory: Rethinking Attention for Image Super-Resolution

Topics

Resources

Stars

27 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages