pmm09c / ntire-dehazing

NTIRE 2019 submission repository

Home Page:https://pmm09c.github.io/ntire-dehazing/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Forwarding for Efficient Single Image Dehazing

Method for 2019 CVPR NTIRE Workshop, Image Dehazing Challenge

Our Paper: https://arxiv.org/abs/1904.09059

NTIRE 2019 Image Dehazing Challenge

Competition Page

Entry Information

Primary References

e-lab. LinkNet

Zhang, He. Densely Connected Pyramid Dehazing Network

Install Our Models

The code has been developed and tested with pytorch 1.0+ in a conda environment

conda activate {Project Environment}
git clone ${repository}
cd ntire-dehazing
conda install --yes --file requirements.txt
cd ..
git clone https://github.com/Po-Hsun-Su/pytorch-ssim
git clone https://github.com/jorge-pessoa/pytorch-msssim
cd pytorch-ssim 
python setup.py
cd ../pytorch-msssim
python setup.py

Data

Our competition results can be recreated by training with the Dense-Haze Dataset, introduced in the 2019 NTIRE Image Dehazing Challenge.

Other datasets available for image dehazing: I-HAZE, O-HAZE, and He, Zhang's training dataset.

Training Our Models

We propose two approaches. One approach estimates airlight and transmission maps with two separate encoder-to-decoder networks that feed into a refinement layer. This model is named DualFastNet. The second approach uses a single network to a refinement layer. This model is named FastNet (uses ResNet 18 pretrained model) / FastNet50 (uses ResNet 50 pretrained model). These models draw upon past work, including DCPDN and LinkNet.

To Train
# From randomly initialized weights
python train.py config.json
# From pretrained weights
python train.py config.json {path_to_weights_file}

All train configuration JSONs can be found in configs/train and modified as needed. Configuration JSON files are available for training a separate airlight model, a separate transmission map model, a DualFastNet model, a FastNet model, or a FastNet50 model. Each configuration JSON file is available for both the 2019 NTIRE Image Dehazing dataset or the He, Zhang dataset. Validation can also be done during training by setting the "validate" flag to "1" in the JSON configuration file and providing a path to the validation JSON configuration file in the "validation_config" field, as shown below:

"validate":1,
"validation_config":"./configs/validation/validate.json",
Loss Functions

Our JSON configuration files natively support the following loss functions: L1 Loss, MSE Loss, BCE Loss, Huber Loss, SSIM Loss, MSSSIM Loss, PSNR Loss, and Content Loss. Content Loss is computed as described in Perceptual Losses for Real-Time Style Transfer and Super-Resolution. Multiple losses can be used with weightings specified in the JSON configuration files. For example to use 10xMSE and 1xSSIM, you can specify the following in the config:

"loss_image": ["MSE","SSIM"],
"loss_image_w": [10.0,1.0],

Testing Our Models

As in training, testing can be done using a JSON configuration file. These are located in configs/test and can be modified as needed.

# To Test
python test.py config.json {path_to_weights_file}

Recreating 2019 NTIRE Challenge Results

Copy the weights from the release tagged ntire_submission to the wgts directory and run the following command

python test.py configs/test/test_nitre.json wgts/ntire_submission.ckpt

Results

Test Image Test Dehazed Image

About

NTIRE 2019 submission repository

https://pmm09c.github.io/ntire-dehazing/


Languages

Language:Python 79.9%Language:TeX 20.1%