Dr. Haofeng Li is recruiting students that want to pursue PhD/Master degrees in CUHK(SZ). Please check https://haofengli.net
This repository is an official PyTorch implementation of the paper "Robust Real-World Image Super-Resolution against Adversarial Attacks" from ACM MM 2021. If you have any problems about the code, please contact [email protected]
We provide the training and testing codes, pre-trained models. You can train your model from scratch, or use the pre-trained model.
- Python 3.6
- PyTorch >= 1.1.0
- numpy
- cv2
- skimage
- tqdm
- torch-dct
Clone this github repo.
git clone https://github.com/yuejiutao/Robust-Real-World-Image-Super-Resolution-against-Adversarial-Attacks.git
cd Robust-Real-World-Image-Super-Resolution-against-Adversarial-Attacks
We recommend that you use the following directory structure:
yourfolder
└─Code
│ └─Robust-Real-World-Image-Super-Resolution-against-Adversarial-Attacks
│ └─Other project...
└─Data
│ └─RealSR
│ └─x4
│ └─test_LR
│ └─test_HR
│ └─train_LR
│ └─train_HR
│ └─adv
└─Other folder...
- Download the RealSR dataset(Version3) and unpack them like above. Then, change the
dataroot
andtest_dataroot
argument in./options/realSR_HGSR_MSHR.py
to the place where images are located. - Run the adversarial training with
train.py
using script filetrain.sh
.
sh train.sh
- You can change the
exp_name
in./options/realSR_HGSR_MSHR.py
and find the results in./experiments/exp_name
.
- Download our pre-trained models to
Robust-Real-World-Image-Super-Resolution-against-Adversarial-Attacks/pre/
folder or use your pre-trained models - Change the
test_dataroot
argument intest.sh
to the place where images are located - Run
test.sh
.
sh test.sh
- You can find the enlarged images under different adversarial intensities in
/yourfolder/Data/RealSR/x4/adv/CDC_MC/
folder
If you find our work useful in your research or publication, please cite:
@inproceedings{yue2021robust,
title={Robust Real-World Image Super-Resolution against Adversarial Attacks},
author={Yue, Jiutao and Li, Haofeng and Wei, Pengxu and Li, Guanbin and Lin, Liang},
booktitle={Proceedings of the 29th ACM International Conference on Multimedia},
pages={5148--5157},
year={2021}
}