Home

Awesome

Cross Aggregation Transformer for Image Restoration

Zheng Chen, Yulun Zhang, Jinjin Gu, Yongbing Zhang, Linghe Kong, and Xin Yuan, "Cross Aggregation Transformer for Image Restoration", NeurIPS, 2022 (Spotlight)

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


Abstract: Recently, Transformer architecture has been introduced into image restoration to replace convolution neural network (CNN) with surprising results. Considering the high computational complexity of Transformer with global attention, some methods use the local square window to limit the scope of self-attention. However, these methods lack direct interaction among different windows, which limits the establishment of long-range dependencies. To address the above issue, we propose a new image restoration model, Cross Aggregation Transformer (CAT). The core of our CAT is the Rectangle-Window Self-Attention (Rwin-SA), which utilizes horizontal and vertical rectangle window attention in different heads parallelly to expand the attention area and aggregate the features cross different windows. We also introduce the Axial-Shift operation for different window interactions. Furthermore, we propose the Locality Complementary Module to complement the self-attention mechanism, which incorporates the inductive bias of CNN (e.g., translation invariance and locality) into Transformer, enabling global-local coupling. Extensive experiments demonstrate that our CAT outperforms recent state-of-the-art methods on several image restoration applications.


SR (x4)HQLQSwinIRCAT (ours)
<img src="figs/img_024_x4.png" height=80 width=110/><img src="figs/img_024_HR_x4.png" height=80/><img src="figs/img_024_Bicubic_x4.png" height=80/><img src="figs/img_024_SwinIR_x4.png" height=80/><img src="figs/img_024_CAT_x4.png" height=80/>
<img src="figs/img_074_x4.png" height=80 width=110/><img src="figs/img_074_HR_x4.png" height=80/><img src="figs/img_074_Bicubic_x4.png" height=80/><img src="figs/img_074_SwinIR_x4.png" height=80/><img src="figs/img_074_CAT_x4.png" height=80/>

Dependencies

# Clone the github repo and go to the default directory 'CAT'.
git clone https://github.com/zhengchen1999/CAT.git
conda create -n CAT python=3.8
conda activate CAT
pip install -r requirements.txt
python setup.py develop

TODO

Contents

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

Datasets

Used training and testing sets can be downloaded as follows:

TaskTraining SetTesting SetVisual Results
image SRDIV2K (800 training images, 100 validation images) + Flickr2K (2650 images) [complete training dataset DF2K]Set5 + Set14 + BSD100 + Urban100 + Manga109 [complete testing dataset download]here
grayscale JPEG compression artifact reductionDIV2K (800 training images) + Flickr2K (2650 images) + WED(4744 images) + BSD500 (400 training&testing images) [complete training dataset DFWB]Classic5 +LIVE + Urban100 [complete testing dataset download]here
real image denoisingSIDD (320 training images) [complete training dataset SIDD]SIDD + DND [complete testing dataset download]here

Here the visual results are generated under SR (x4), JPEG compression artifact reduction (q10), and real image denoising.

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

Models

TaskMethodParams (M)FLOPs (G)DatasetPSNR (dB)SSIMModel ZooVisual Results
SRCAT-R16.60292.7Urban10027.450.8254Google DriveGoogle Drive
SRCAT-A16.60360.7Urban10027.890.8339Google DriveGoogle Drive
SRCAT-R-211.93216.3Urban10027.590.8285Google DriveGoogle Drive
SRCAT-A-216.60387.9Urban10027.990.8357Google DriveGoogle Drive
CARCAT16.20346.4LIVE129.890.8295Google DriveGoogle Drive
real-DNCAT25.7753.2SIDD40.010.9600Google DriveGoogle Drive

The performance is reported on Urban100 (x4, SR), LIVE1 (q=10, CAR), and SIDD (real-DN). The test input size of FLOPs is 128 x 128.

Training

Image SR

JPEG Compression Artifact Reduction

Real Image Denoising

Testing

Image SR

JPEG Compression Artifact Reduction

Real Image Denoising

Results

We achieve state-of-the-art performance on image SR, JPEG compression artifact reduction and real image denoising. Detailed results can be found in the paper. All visual results of CAT can be downloaded here.

<details> <summary>Image SR (click to expand)</summary> <p align="center"> <img width="900" src="figs/SR-1.png"> </p> <p align="center"> <img width="900" src="figs/SR-2.png"> </p> <p align="center"> <img width="900" src="figs/SR-VC-1.png"> </p> <p align="center"> <img width="900" src="figs/SR-VC-2.png"> <img width="900" src="figs/SR-VC-3.png"> <img width="900" src="figs/SR-VC-4.png"> </p> </details> <details> <summary>JPEG Compression Artifact Reduction (click to expand)</summary> <p align="center"> <img width="900" src="figs/CAR-1.png"> </p> <p align="center"> <img width="900" src="figs/CAR-2.png"> </p> <p align="center"> <img width="900" src="figs/CAR-VC-1.png"> </p> <p align="center"> <img width="900" src="figs/CAR-VC-2.png"> <img width="900" src="figs/CAR-VC-3.png"> <img width="900" src="figs/CAR-VC-4.png"> </p> </details> <details> <summary>Real Image Denoising (click to expand)</summary> <p align="center"> <img width="900" src="figs/Real-DN.png"> </p>

*: We re-test the SIDD with all official pre-trained models.

</details>

Citation

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

@inproceedings{chen2022cross,
    title={Cross Aggregation Transformer for Image Restoration},
    author={Chen, Zheng and Zhang, Yulun and Gu, Jinjin and Zhang, Yongbing and Kong, Linghe and Yuan, Xin},
    booktitle={NeurIPS},
    year={2022}
}

Acknowledgements

This code is built on BasicSR and Restormer.