This repository is for TFN introduced in the following paper
Yinghong Liao, Bin Qiu, Zhuo Su, Ruomei Wang, Xiangjian He, "Learning Transmission Filtering Network for Image-Based PM2.5 Estimation", ICME 2019 [link].
The code is built on RESCAN and TernausNet, which is tested on Ubuntu 14.04 environment (Python_3.6, PyTorch_0.4.1, CUDA_8.0.61, cuDNN_5.1) with a NVIDIA GeForce GTX Titan X GPU.
If you have any question, please send an email to [email protected] and we are willing to answer.
PM2.5 is an important indicator of the severity of air pollution and its level can be predicted through hazy photographs caused by its degradation. Image-based PM2.5 estimation is thus extensively employed in various multimedia applications but is challenging because of its ill-posed property. In this paper, we convert it to the problem of estimating the PM2.5-relevant haze transmission and propose a learning model called the transmission filtering network. Different from most methods that generate a transmission map directly from a hazy image, our model takes the coarse transmission map derived from the dark channel prior as the input. To obtain a transmission map that satisfies the local smoothness constraint without regional boundary degradation, our model performs the edge-preserving smoothing filtering as the refinement on the map. Moreover, we introduce the attention mechanism to the network architecture for more efficient feature extraction and smoothing effects in the transmission estimation. Experimental results prove that our model performs favorably against the state-of-the-art dehazing methods in a variety of hazy scenes.
Transmission Filtering Network (TFN) architecture. Residual Attention Block (RAB) architecture.
-
Download RESIDE training data from RESIDE-Standard and RESIDE-β.
-
Plaze the hazy images in the folder
./dataset/OTS_BETA/train/hazy/
and the haze-free images in the folder./dataset/OTS_BETA/train/clear/
. Besides, a validation set./dataset/OTS_BETA/val/
is needed, where the foldersclear
andhazy
are included. You can place some images you select for the validation.
-
(optional) Download models for our paper and place them in the folder
./models/
.All the trained models can be downloaded from BaiduYun and Google Drive. The BaiduYun password is as75.
-
Cd to
./config
, run the following scripts to train models. We adopt the initialization (warm-up) in network training, if you would like to train the network at the beginning, we recommend to use the modelstep_10000
'. You can set any parameter in the file./config/settings.py
.# (example) train the network with the model step_10000 python main.py -a train -m ../models/step_10000
-
The corresponding training inputs, targets, results can be found in the path
./logdir/
.
-
Download models for our paper and place them in
./models/
.All the trained models can be downloaded from BaiduYun and Google Drive. The BaiduYun password is as75.
-
Place the folders
./dataset/OTS_BETA/test/indoor/hazy
and./dataset/OTS_BETA/test/indoor/clear
in the path./dataset/OTS_BETA/test/hazy
and./dataset/OTS_BETA/test/clear
if you want to test the testing set Indoor. The similar opearions are conducted if you want to test the testing set Outdoor. -
Cd to
./config
, run the following scripts to test the testing dataset in batch. The batch size needs to be set as 1 in the file./config/settings.py
.# (example) test with the model step_100000 python main.py -a test -m ../models/step_100000
-
The corresponding testing inputs, targets and results can be found in the path
./logdir/
.
-
Download models for our paper and place them in
./models/
.All the trained models can be downloaded from BaiduYun and Google Drive. The BaiduYun password is as75.
-
Choose a real hazy image from the folder
./dataset/OTS_BETA/real/
. -
Cd to
./config
, run the following scripts to obtain a dehazed result.# (example) test a real hazy image with filename as 'tiananmen.bmp' with the model step_100000 python main.py -a real -m ../models/step_100000 -n tiananmen.bmp
-
The corresponding dehazed result can be found in the folder
./dataset/OTS_BETA/real_output/
.
Quantitative evaluation with some state-of-the-art methods on the synthetic datasets (SSIM/PSNR), where the best and the second best numeric values are marked in red and blue, respectively.
For more results, please refer to our main papar.
Visual comparison with some state-of-the-art dehazing methods on real hazy images.
@inproceedings{liao_2019_tfn,
title = {Learning Transmission Filtering Network for Image-Based PM2.5 Estimation},
author = {Liao, Yinghong and Qiu, Bin and Su, Zhuo and Wang, Ruomei and He, Xiangjian},
booktitle = {IEEE International Conference on Multimedia and Expo (ICME)},
year = {2019}
}
This code is built on RESCAN and TernausNet. We are particularly grateful to Xia Li for the support.