1 Single Image Super Resolution(SISR)

December 21, 2021 · View on GitHub

1.1 Principle

Super resolution is a process of upscaling and improving the details within an image. It usually takes a low-resolution image as input and upscales the same image to a higher resolution as output. Here we provide four super-resolution models, namely RealSR, ESRGAN, LESRCNN, PAN.

RealSR focus on designing a novel degradation framework for realworld images by estimating various blur kernels as well as real noise distributions. Based on the novel degradation framework, we can acquire LR images sharing a common domain with real-world images. RealSR is a real-world super-resolution model aiming at better perception. Extensive experiments on synthetic noise data and real-world images demonstrate that RealSR outperforms the state-of-the-art methods, resulting in lower noise and better visual quality.

ESRGAN is an enhanced SRGAN. To further enhance the visual quality of SRGAN, ESRGAN improves three key components of srgan. In addition, ESRGAN also introduces the Residual-in-Residual Dense Block (RRDB) without batch normalization as the basic network building unit, lets the discriminator predict relative realness instead of the absolute value, and improves the perceptual loss by using the features before activation. Benefiting from these improvements, the proposed ESRGAN achieves consistently better visual quality with more realistic and natural textures than SRGAN and won the first place in the PIRM2018-SR Challenge.

Considering that the application of CNN in SISR often consume high computational cost and more memory storage for training a SR model, a lightweight enhanced SR CNN (LESRCNN) was proposed.Extensive experiments demonstrate that the proposed LESRCNN outperforms state-of-the-arts on SISR in terms of qualitative and quantitative evaluation. Then PAN designed a lightweight convolutional neural network for image super-resolution (SR).

1.2 How to use

1.2.1 Prepare Datasets

A list of common image super-resolution datasets is as following:

NameDatasetsShort DescriptionDownload
2K ResolutionDIV2Kproposed in NTIRE17 (800 train and 100 validation)official website
Classical SR TestingSet5Set5 test datasetGoogle Drive / Baidu Drive
Classical SR TestingSet14Set14 test datasetGoogle Drive / Baidu Drive

The structure of DIV2K, Set5 and Set14 is as following:

  PaddleGAN
    ├── data
        ├── DIV2K
              ├── DIV2K_train_HR
              ├── DIV2K_train_LR_bicubic
              |    ├──X2
              |    ├──X3
              |    └──X4
              ├── DIV2K_valid_HR
              ├── DIV2K_valid_LR_bicubic
            Set5
              ├── GTmod12
              ├── LRbicx2
              ├── LRbicx3
              ├── LRbicx4
              └── original
            Set14
              ├── GTmod12
              ├── LRbicx2
              ├── LRbicx3
              ├── LRbicx4
              └── original
            ...

Use the following commands to process the DIV2K data set:

  python data/process_div2k_data.py --data-root data/DIV2K

When the program is finished, check whether there are DIV2K_train_HR_sub, X2_sub, X3_sub and X4_sub directories in the DIV2K directory

  PaddleGAN
    ├── data
        ├── DIV2K
              ├── DIV2K_train_HR
              ├── DIV2K_train_HR_sub
              ├── DIV2K_train_LR_bicubic
              |    ├──X2
              |    ├──X2_sub
              |    ├──X3
              |    ├──X3_sub
              |    ├──sX4
              |    └──X4_sub
              ├── DIV2K_valid_HR
              ├── DIV2K_valid_LR_bicubic
            ...

Prepare dataset for realsr df2k model

Download dataset from NTIRE 2020 RWSR and unzip it to your path. Unzip Corrupted-tr-x.zip and Corrupted-tr-y.zip to PaddleGAN/data/ntire20 directory.

Run the following commands:

  python ./data/realsr_preprocess/create_bicubic_dataset.py --dataset df2k --artifacts tdsr

  python ./data/realsr_preprocess/collect_noise.py --dataset df2k --artifacts tdsr

Prepare dataset for realsr dped model

Download dataset from NTIRE 2020 RWSR and unzip it to your path. Unzip DPEDiphone-tr-x.zip and DPEDiphone-va.zip to PaddleGAN/data/ntire20 directory.

Use KernelGAN to generate kernels from source images. Clone the repo here. Replace SOURCE_PATH with specific path and run:

python train.py --X4 --input-dir SOURCE_PATH

for convenient, we provide DPED_KERNEL.tar. You can download it to PaddleGAN/data/DPED_KERNEL

Run the following commands:

  python ./data/realsr_preprocess/create_kernel_dataset.py --dataset dped --artifacts clean --kernel_path data/DPED_KERNEL
  python ./data/realsr_preprocess/collect_noise.py --dataset dped --artifacts clean

1.2.2 Train/Test

Datasets used in example is df2k, you can change it to your own dataset in the config file. The model used in example is RealSR, you can change other models by replacing the config file.

Train a model:

   python -u tools/main.py --config-file configs/realsr_bicubic_noise_x4_df2k.yaml

Test the model:

   python tools/main.py --config-file configs/realsr_bicubic_noise_x4_df2k.yaml --evaluate-only --load ${PATH_OF_WEIGHT}

1.3 Results

Evaluated on RGB channels, scale pixels in each border are cropped before evaluation.

The metrics are PSNR / SSIM.

MethodSet5Set14DIV2K
realsr_df2k28.4385 / 0.810624.7424 / 0.667826.7306 / 0.7512
realsr_dped20.2421 / 0.615819.3775 / 0.525920.5976 / 0.6051
realsr_merge24.8315 / 0.703023.0393 / 0.598624.8510 / 0.6856
lesrcnn_x431.9476 / 0.890928.4110 / 0.777030.231 / 0.8326
esrgan_psnr_x432.5512 / 0.899128.8114 / 0.787130.7565 / 0.8449
esrgan_x428.7647 / 0.818725.0065 / 0.676226.9013 / 0.7542
pan_x430.4574 / 0.864326.7204 / 0.743428.9187 / 0.8176
drns_x432.6684 / 0.899928.9037 / 0.7885-

1.4 Model Download

MethodDatasetDownload Link
realsr_df2kdf2krealsr_df2k
realsr_dpeddpedrealsr_dped
realsr_mergeDIV2Krealsr_merge
lesrcnn_x4DIV2Klesrcnn_x4
esrgan_psnr_x4DIV2Kesrgan_psnr_x4
esrgan_x4DIV2Kesrgan_x4
pan_x4DIV2Kpan_x4
drns_x4DIV2Kdrns_x4

References

    1. Real-World Super-Resolution via Kernel Estimation and Noise Injection
    @inproceedings{ji2020real,
    title={Real-World Super-Resolution via Kernel Estimation and Noise Injection},
    author={Ji, Xiaozhong and Cao, Yun and Tai, Ying and Wang, Chengjie and Li, Jilin and Huang, Feiyue},
    booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops},
    pages={466--467},
    year={2020}
    }
    
    1. ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks
    @inproceedings{wang2018esrgan,
    title={Esrgan: Enhanced super-resolution generative adversarial networks},
    author={Wang, Xintao and Yu, Ke and Wu, Shixiang and Gu, Jinjin and Liu, Yihao and Dong, Chao and Qiao, Yu and Change Loy, Chen},
    booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
    pages={0--0},
    year={2018}
    }
    
    1. Lightweight image super-resolution with enhanced CNN
    @article{tian2020lightweight,
    title={Lightweight image super-resolution with enhanced CNN},
    author={Tian, Chunwei and Zhuge, Ruibin and Wu, Zhihao and Xu, Yong and Zuo, Wangmeng and Chen, Chen and Lin, Chia-Wen},
    journal={Knowledge-Based Systems},
    volume={205},
    pages={106235},
    year={2020},
    publisher={Elsevier}
    }
    
    1. Efficient Image Super-Resolution Using Pixel Attention
    @inproceedings{Hengyuan2020Efficient,
    title={Efficient Image Super-Resolution Using Pixel Attention},
    author={Hengyuan Zhao and Xiangtao Kong and Jingwen He and Yu Qiao and Chao Dong},
    booktitle={Computer Vision – ECCV 2020 Workshops},
    volume={12537},
    pages={56-72},
    year={2020}
    }
    
    1. Closed-loop Matters: Dual Regression Networks for Single Image Super-Resolution
    @inproceedings{guo2020closed,
    title={Closed-loop Matters: Dual Regression Networks for Single Image Super-Resolution},
    author={Guo, Yong and Chen, Jian and Wang, Jingdong and Chen, Qi and Cao, Jiezhang and Deng, Zeshuai and Xu, Yanwu and Tan, Mingkui},
    booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
    year={2020}
    }