Home

Awesome

Recursive Generalization Transformer for Image Super-Resolution

Zheng Chen, Yulun Zhang, Jinjin Gu, Linghe Kong, and Xiaokang Yang, "Recursive Generalization Transformer for Image Super-Resolution", ICLR, 2024

[paper] [arXiv] [supplementary material] [visual results] [pretrained models]

🔥🔥🔥 News


Abstract: Transformer architectures have exhibited remarkable performance in image superresolution (SR). Since the quadratic computational complexity of the selfattention (SA) in Transformer, existing methods tend to adopt SA in a local region to reduce overheads. However, the local design restricts the global context exploitation, which is crucial for accurate image reconstruction. In this work, we propose the Recursive Generalization Transformer (RGT) for image SR, which can capture global spatial information and is suitable for high-resolution images. Specifically, we propose the recursive-generalization self-attention (RG-SA). It recursively aggregates input features into representative feature maps, and then utilizes cross-attention to extract global information. Meanwhile, the channel dimensions of attention matrices ($query$, $key$, and $value$) are further scaled to mitigate the redundancy in the channel domain. Furthermore, we combine the RG-SA with local self-attention to enhance the exploitation of the global context, and propose the hybrid adaptive integration (HAI) for module integration. The HAI allows the direct and effective fusion between features at different levels (local or global). Extensive experiments demonstrate that our RGT outperforms recent state-of-the-art methods quantitatively and qualitatively.


HRLRSwinIRCATRGT (ours)
<img src="figs/img_1_HR_x4.png" height=80><img src="figs/img_1_Bicubic_x4.png" height=80><img src="figs/img_1_SwinIR_x4.png" height=80><img src="figs/img_1_CAT_x4.png" height=80><img src="figs/img_1_RGT_x4.png" height=80>
<img src="figs/img_2_HR_x4.png" height=80><img src="figs/img_2_Bicubic_x4.png" height=80><img src="figs/img_2_SwinIR_x4.png" height=80><img src="figs/img_2_CAT_x4.png" height=80><img src="figs/img_2_RGT_x4.png" height=80>

⚙️ Dependencies

# Clone the github repo and go to the default directory 'RGT'.
git clone https://github.com/zhengchen1999/RGT.git
conda create -n RGT python=3.8
conda activate RGT
pip install -r requirements.txt -f https://download.pytorch.org/whl/torch_stable.html
python setup.py develop

⚒️ TODO

🔗 Contents

  1. Datasets
  2. Models
  3. Training
  4. Testing
  5. Results
  6. Citation
  7. Acknowledgements

<a name="datasets"></a>🖨️ Datasets

Used training and testing sets can be downloaded as follows:

Training SetTesting SetVisual Results
DIV2K (800 training images, 100 validation images) + Flickr2K (2650 images) [complete training dataset DF2K: Google Drive / Baidu Disk]Set5 + Set14 + BSD100 + Urban100 + Manga109 [complete testing dataset: Google Drive / Baidu Disk]Google Drive / Baidu Disk

Download training and testing datasets and put them into the corresponding folders of datasets/. See datasets for the detail of the directory structure.

<a name="models"></a>📦 Models

MethodParams (M)FLOPs (G)PSNR (dB)SSIMModel ZooVisual Results
RGT-S10.20193.0827.890.8347Google Drive / Baidu DiskGoogle Drive / Baidu Disk
RGT13.37251.0727.980.8369Google Drive / Baidu DiskGoogle Drive / Baidu Disk

The performance is reported on Urban100 (x4). Output size of FLOPs is 3×512×512.

<a name="training"></a>🔧 Training

<a name="testing"></a>🔨 Testing

🌗 Test images with HR

🌓 Test images without HR

<a name="results"></a>🔎 Results

We achieved state-of-the-art performance. Detailed results can be found in the paper.

<details> <summary>Quantitative Comparison (click to expand)</summary> <p align="center"> <img width="900" src="figs/T1.png"> </p> </details> <details> <summary>Visual Comparison (click to expand)</summary> <p align="center"> <img width="900" src="figs/F1.png"> </p> <p align="center"> <img width="900" src="figs/F2.png"> </p> <p align="center"> <img width="900" src="figs/F3.png"> </p> </details>

<a name="citation"></a>📎 Citation

If you find the code helpful in your resarch or work, please cite the following paper(s).

@inproceedings{chen2024recursive,
  title={Recursive Generalization Transformer for Image Super-Resolution},
  author={Chen, Zheng and Zhang, Yulun and Gu, Jinjin and Kong, Linghe and Yang, Xiaokang},
  booktitle={ICLR},
  year={2024}
}

<a name="acknowledgements"></a>💡 Acknowledgements

This code is built on BasicSR.