Progressive Image Deraining Networks: A Better and Simpler Baseline

Related tags

Deep Learning PReNet
Overview

Progressive Image Deraining Networks: A Better and Simpler Baseline

[arxiv] [pdf] [supp]

Introduction

This paper provides a better and simpler baseline deraining network by discussing network architecture, input and output, and loss functions. Specifically, by repeatedly unfolding a shallow ResNet, progressive ResNet (PRN) is proposed to take advantage of recursive computation. A recurrent layer is further introduced to exploit the dependencies of deep features across stages, forming our progressive recurrent network (PReNet). Furthermore, intra-stage recursive computation of ResNet can be adopted in PRN and PReNet to notably reduce network parameters with graceful degradation in deraining performance (PRN_r and PReNet_r). For network input and output, we take both stage-wise result and original rainy image as input to each ResNet and finally output the prediction of residual image. As for loss functions, single MSE or negative SSIM losses are sufficient to train PRN and PReNet. Experiments show that PRN and PReNet perform favorably on both synthetic and real rainy images. Considering its simplicity, efficiency and effectiveness, our models are expected to serve as a suitable baseline in future deraining research.

Prerequisites

  • Python 3.6, PyTorch >= 0.4.0
  • Requirements: opencv-python, tensorboardX
  • Platforms: Ubuntu 16.04, cuda-8.0 & cuDNN v-5.1 (higher versions also work well)
  • MATLAB for computing evaluation metrics

Datasets

PRN and PReNet are evaluated on four datasets*: Rain100H [1], Rain100L [1], Rain12 [2] and Rain1400 [3]. Please download the testing datasets from BaiduYun or OneDrive, and place the unzipped folders into ./datasets/test/.

To train the models, please download training datasets: RainTrainH [1], RainTrainL [1] and Rain12600 [3] from BaiduYun or OneDrive, and place the unzipped folders into ./datasets/train/.

*We note that:

(i) The datasets in the website of [1] seem to be modified. But the models and results in recent papers are all based on the previous version, and thus we upload the original training and testing datasets to BaiduYun and OneDrive.

(ii) For RainTrainH, we strictly exclude 546 rainy images that have the same background contents with testing images. All our models are trained on remaining 1,254 training samples.

Getting Started

1) Testing

We have placed our pre-trained models into ./logs/.

Run shell scripts to test the models:

bash test_Rain100H.sh   # test models on Rain100H
bash test_Rain100L.sh   # test models on Rain100L
bash test_Rain12.sh     # test models on Rain12
bash test_Rain1400.sh   # test models on Rain1400 
bash test_Ablation.sh   # test models in Ablation Study
bash test_real.sh       # test PReNet on real rainy images

All the results in the paper are also available at BaiduYun. You can place the downloaded results into ./results/, and directly compute all the evaluation metrics in this paper.

2) Evaluation metrics

We also provide the MATLAB scripts to compute the average PSNR and SSIM values reported in the paper.

 cd ./statistic
 run statistic_Rain100H.m
 run statistic_Rain100L.m
 run statistic_Rain12.m
 run statistic_Rain1400.m
 run statistic_Ablation.m  # compute the metrics in Ablation Study

Average PSNR/SSIM values on four datasets:

Dataset PRN PReNet PRN_r PReNet_r JORDER[1] RESCAN[4]
Rain100H 28.07/0.884 29.46/0.899 27.43/0.874 28.98/0.892 26.54/0.835 28.88/0.866
Rain100L 36.99/0.977 37.48/0.979 36.11/0.973 37.10/0.977 36.61/0.974 ---
Rain12 36.62/0.952 36.66/0.961 36.16/0.961 36.69/0.962 33.92/0.953 ---
Rain1400 31.69/0.941 32.60/0.946 31.31/0.937 32.44/0.944 --- ---

*We note that:

(i) The metrics by JORDER[1] are computed directly based on the deraining images provided by the authors.

(ii) RESCAN[4] is re-trained with their default settings: (1) RESCAN for Rain100H is trained on the full 1800 rainy images, while our models are all trained on the strict 1254 rainy images. (2) The re-trained model of RESCAN is available at here.

(iii) The deraining results by JORDER and RESCAN can be downloaded from here, and their metrics in the above table can be computed by the Matlab scripts.

3) Training

Run shell scripts to train the models:

bash train_PReNet.sh      
bash train_PRN.sh   
bash train_PReNet_r.sh    
bash train_PRN_r.sh  

You can use tensorboard --logdir ./logs/your_model_path to check the training procedures.

Model Configuration

The following tables provide the configurations of options.

Training Mode Configurations

Option Default Description
batchSize 18 Training batch size
recurrent_iter 6 Number of recursive stages
epochs 100 Number of training epochs
milestone [30,50,80] When to decay learning rate
lr 1e-3 Initial learning rate
save_freq 1 save intermediate model
use_GPU True use GPU or not
gpu_id 0 GPU id
data_path N/A path to training images
save_path N/A path to save models and status

Testing Mode Configurations

Option Default Description
use_GPU True use GPU or not
gpu_id 0 GPU id
recurrent_iter 6 Number of recursive stages
logdir N/A path to trained model
data_path N/A path to testing images
save_path N/A path to save results

References

[1] Yang W, Tan RT, Feng J, Liu J, Guo Z, Yan S. Deep joint rain detection and removal from a single image. In IEEE CVPR 2017.

[2] Li Y, Tan RT, Guo X, Lu J, Brown MS. Rain streak removal using layer priors. In IEEE CVPR 2016.

[3] Fu X, Huang J, Zeng D, Huang Y, Ding X, Paisley J. Removing rain from single images via a deep detail network. In IEEE CVPR 2017.

[4] Li X, Wu J, Lin Z, Liu H, Zha H. Recurrent squeeze-and-excitation context aggregation net for single image deraining.In ECCV 2018.

Citation

 @inproceedings{ren2019progressive,
   title={Progressive Image Deraining Networks: A Better and Simpler Baseline},
   author={Ren, Dongwei and Zuo, Wangmeng and Hu, Qinghua and Zhu, Pengfei and Meng, Deyu},
   booktitle={IEEE Conference on Computer Vision and Pattern Recognition},
   year={2019},
 }
Comments
  • Question of loss and training

    Question of loss and training

    Hello, thank you for your contribution. I have read your thesis, can you answer some questions?

    1. Does Loss only use SSIM and not MSE? What happens if these two Loss are used at the same time?
    2. About four networks. During training, are these 4 written separately when typing commands? For example to train PReNet, I just need to type

    bash train_PReNet.sh

    and I don't need to type the remaining three

    bash train_PRN.sh bash train_PReNet_r.sh bash train_PRN_r.sh

    Looking forward to your answer, thank you

    opened by FUNGERN 4
  • Data set path

    Data set path

    You have 4 .py training files (train_PReNet, train_PRN, train_PReNet_r, train_PRN_r), but you have 3 training datasets (RainTrainH, RainTrainL, and Rain12600). When filling in the path, is there any specific .py corresponding to a specific training set path, or are these three optional?

    opened by FUNGERN 4
  • how to train only LSTM models in stages 2, 3, 4, 5, 6, and 7 and test these 6 models?

    how to train only LSTM models in stages 2, 3, 4, 5, 6, and 7 and test these 6 models?

    Hi, your work is great. I have a question to ask you if I only want to train the LSTM model in stages 2, 3, 4, 5, 6, and 7 . Do I just need to change recurrent_iter=2,3,4,5,6,7 in networks.py and train_PReNet.py? I don't quite understand, please tell me, thanks

    opened by FUNGERN 3
  • How to put 100H, 100L and 12600 together to train a model?

    How to put 100H, 100L and 12600 together to train a model?

    Hello, thank you for your contribution! I would like to ask how to put three models of 100H, 100L and 12600 together to train a model? If you train together, will you still train for 100 epochs? Will it be a waste of time? Looking forward to your reply, thanks.

    opened by FUNGERN 3
  • what is h5py version ?

    what is h5py version ?

    I tried to read the datasets, but error shows

      File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
      File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
      File "h5py/h5f.pyx", line 96, in h5py.h5f.open
    OSError: Unable to open file (bad object header version number)
    

    any suggestion ?

    opened by Stephenfang51 2
  • no file named train_target.h5

    no file named train_target.h5

    hello! thanks a lot for your wonderful code! I want to try ur code on my own dataset, so i create a folder named 'mydatasets' and put it in 'datasets/train/', and put rain and norain images in this folder.

    i run 'python train_PReNet.py --preprocess True save_path xxxx -- data_path datasets/train/mydatasets' and error occurs as below: Unable to open file (unable to open file: name = ' datasets/train/mydatasets/train_target.h5') no such file or directory

    so, how to get the file train_target.h5? looking forward to ur response!!!

    opened by Jamofl 0
  • Guānyú cèshì 4 / 5,000 Translation results About testing

    Guānyú cèshì 4 / 5,000 Translation results About testing

    I entered a 2048 * 2048 picture for test results showing insufficient memory but input small resolution pictures can be, I can ask me to test a big resolution image? image

    opened by BALDman66 0
  • RainTrainL dataset

    RainTrainL dataset

    hello! thanks a lot for your code!! in the RainTrainL dataset, where do rainstreak-xxx.png and rainregion-xxx.png come from? how to get them? if i create a dataset on my own, and there are only norain and rain image pairs(without rainstreak and rainnregion images) is it possilble to train on this dataset? if not, what should i do? thanks a lot!

    opened by Jamofl 0
  • Different stage t output

    Different stage t output

    How to obtain different stages of the derain image, like the Fig.1 t=1,2,4 in your paper? Is it the intermediate output of a complete network or is it the result of constructing different networks to experiment with?

    opened by xuefei0123 0
  • 关于RainTrainL数据集

    关于RainTrainL数据集

    有以下几个问题想请教一下作者: 1.请问为什么这个数据集中除了由于无雨图外还有雨痕和雨图,这两个是怎么得到的呢(这个数据集是怎么制作的)? 2.四种图片类型放在同一个文件夹下又是怎么分别读取的呢? 3.在根据sh文件按要求放置数据集后为什么报错UnboundLocalError: local variable 'input_train' referenced before assignment,代码中的input_train和out_train是怎么设置或者读取(得到)的? 非常感谢!期待您的回复

    opened by Gelute0 0
Owner
null
Image-generation-baseline - MUGE Text To Image Generation Baseline

MUGE Text To Image Generation Baseline Requirements and Installation More detail

null 23 Oct 17, 2022
Image-retrieval-baseline - MUGE Multimodal Retrieval Baseline

MUGE Multimodal Retrieval Baseline This repo is implemented based on the open_cl

null 47 Dec 16, 2022
Official repository for "Restormer: Efficient Transformer for High-Resolution Image Restoration". SOTA for motion deblurring, image deraining, denoising (Gaussian/real data), and defocus deblurring.

Restormer: Efficient Transformer for High-Resolution Image Restoration Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan,

Syed Waqas Zamir 906 Dec 30, 2022
Jingju baseline - A baseline model of our project of Beijing opera script generation

Jingju Baseline It is a baseline of our project about Beijing opera script gener

midon 1 Jan 14, 2022
Selective Wavelet Attention Learning for Single Image Deraining

SWAL Code for Paper "Selective Wavelet Attention Learning for Single Image Deraining" Prerequisites Python 3 PyTorch Models We provide the models trai

Bobo 9 Jun 17, 2022
A Python package for faster, safer, and simpler ML processes

Bender ?? A Python package for faster, safer, and simpler ML processes. Why use bender? Bender will make your machine learning processes, faster, safe

Otovo 6 Dec 13, 2022
Semi-supervised Video Deraining with Dynamical Rain Generator (CVPR, 2021, Pytorch)

S2VD Semi-supervised Video Deraining with Dynamical Rain Generator (CVPR, 2021) Requirements and Dependencies Ubuntu 16.04, cuda 10.0 Python 3.6.10, P

Zongsheng Yue 53 Nov 23, 2022
Multi-Stage Progressive Image Restoration

Multi-Stage Progressive Image Restoration Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, Ming-Hsuan Yang, and Ling Sh

Syed Waqas Zamir 859 Dec 22, 2022
Code for Referring Image Segmentation via Cross-Modal Progressive Comprehension, CVPR2020.

CMPC-Refseg Code of our CVPR 2020 paper Referring Image Segmentation via Cross-Modal Progressive Comprehension. Shaofei Huang*, Tianrui Hui*, Si Liu,

spyflying 55 Dec 1, 2022
PyTorch implementation of Progressive Growing of GANs for Improved Quality, Stability, and Variation.

PyTorch implementation of Progressive Growing of GANs for Improved Quality, Stability, and Variation. Warning: the master branch might collapse. To ob

null 559 Dec 14, 2022
Efficient Conformer: Progressive Downsampling and Grouped Attention for Automatic Speech Recognition

Efficient Conformer: Progressive Downsampling and Grouped Attention for Automatic Speech Recognition Official implementation of the Efficient Conforme

Maxime Burchi 145 Dec 30, 2022
Sparse Progressive Distillation: Resolving Overfitting under Pretrain-and-Finetune Paradigm

Sparse Progressive Distillation: Resolving Overfitting under Pretrain-and-Finetu

null 3 Dec 5, 2022
Progressive Domain Adaptation for Object Detection

Progressive Domain Adaptation for Object Detection Implementation of our paper Progressive Domain Adaptation for Object Detection, based on pytorch-fa

null 96 Nov 25, 2022
(AAAI 2021) Progressive One-shot Human Parsing

End-to-end One-shot Human Parsing This is the official repository for our two papers: Progressive One-shot Human Parsing (AAAI 2021) End-to-end One-sh

null 54 Dec 30, 2022
Official code of paper "PGT: A Progressive Method for Training Models on Long Videos" on CVPR2021

PGT Code for paper PGT: A Progressive Method for Training Models on Long Videos. Install Run pip install -r requirements.txt. Run python setup.py buil

Bo Pang 27 Mar 30, 2022
PyTorch inference for "Progressive Growing of GANs" with CelebA snapshot

Progressive Growing of GANs inference in PyTorch with CelebA training snapshot Description This is an inference sample written in PyTorch of the origi

null 320 Nov 21, 2022
Official implementation of the paper Vision Transformer with Progressive Sampling, ICCV 2021.

Vision Transformer with Progressive Sampling This is the official implementation of the paper Vision Transformer with Progressive Sampling, ICCV 2021.

yuexy 123 Jan 1, 2023
Source code for "Progressive Transformers for End-to-End Sign Language Production" (ECCV 2020)

Progressive Transformers for End-to-End Sign Language Production Source code for "Progressive Transformers for End-to-End Sign Language Production" (B

null 58 Dec 21, 2022