Code Monkey home page Code Monkey logo

tfn-dehazing's Introduction

Learning Transmission Filtering Network for Image-Based PM2.5 Estimation

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.

Contents

  1. Introduction
  2. Train
  3. Test
  4. Single Image Test
  5. Results
  6. Citation
  7. Acknowledgements

Introduction

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.

CA Transmission Filtering Network (TFN) architecture. RAB Residual Attention Block (RAB) architecture.

Train

Prepare training data

  1. Download RESIDE training data from RESIDE-Standard and RESIDE-β.

  2. 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 folders clear and hazy are included. You can place some images you select for the validation.

Begin to train

  1. (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.

  2. 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 model step_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
    
  3. The corresponding training inputs, targets, results can be found in the path ./logdir/.

Test

Quick start

  1. 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.

  2. 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.

  3. 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
    
  4. The corresponding testing inputs, targets and results can be found in the path ./logdir/.

Real

Test with a single hazy image

  1. 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.

  2. Choose a real hazy image from the folder ./dataset/OTS_BETA/real/.

  3. 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
    
  4. The corresponding dehazed result can be found in the folder ./dataset/OTS_BETA/real_output/.

Results

Quantitative Results

numeric

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 Results

visual

Visual comparison with some state-of-the-art dehazing methods on real hazy images.

Citation

@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}
}

Acknowledgements

This code is built on RESCAN and TernausNet. We are particularly grateful to Xia Li for the support.

tfn-dehazing's People

Contributors

nicholasly avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.