Home

Awesome

Semantic-Guided-Low-Light-Image-Enhancement

This is the official Pytorch implementation for our paper "Semantic-Guided Zero-Shot Learning for Low-Light Image/Video Enhancement"

Updates

Abstract

Low-light images challenge both human perceptions and computer vision algorithms. It is crucial to make algorithms robust to enlighten low-light images for computational photography and computer vision applications such as real-time detection and segmentation tasks. This paper proposes a semantic-guided zero-shot low-light enhancement network which is trained in the absence of paired images, unpaired datasets, and segmentation annotation. Firstly, we design an efficient enhancement factor extraction network using depthwise separable convolution. Secondly, we propose a recurrent image enhancement network for progressively enhancing the low-light image. Finally, we introduce an unsupervised semantic segmentation network for preserving the semantic information. Extensive experiments on various benchmark datasets and a low-light video demonstrate that our model outperforms the previous state-of-the-art qualitatively and quantitatively. We further discuss the benefits of the proposed method for low-light detection and segmentation.

Model Architecture

Click the following link to see the model architecture in pdf format.

Model Architecture

Sample Results

1. Low-Light Video Frames

From left to right, and from top to bottom: Dark, Retinex [1], KinD [2], EnlightenGAN [3], Zero-DCE [4], Ours.

<p float="left"> <p align="middle"> <img src="Samples/F1.png" width="250" /> <img src="Samples/retinex_net.png" width="250" /> <img src="Samples/kind.png" width="250" /> <img src="Samples/enlighten_gan.png" width="250" /> <img src="Samples/zero_dce.png" width="250" /> <img src="Samples/F1Crop.png" width="250" /> </p>

2. Low-Light Images (Real-World)

From left to right, and from top to bottom: Dark, PIE [5], LIME [6], Retinex [1], MBLLEN [7], KinD [2] , Zero-DCE [4], Ours

<p float="left"> <p align="middle"> <img src="Samples/Dark7.jpg" width="200" /> <img src="Samples/PIE7.jpg" width="200" /> <img src="Samples/LIME7.jpg" width="200" /> <img src="Samples/Retinex7.jpg" width="200" /> <img src="Samples/mbllen7.jpg" width="200" /> <img src="Samples/KinD7.jpg" width="200" /> <img src="Samples/ZeroDCE7.jpg" width="200" /> <img src="Samples/Ours7.jpg" width="200" /> </p>

Get Started

1. Requirements

2. Prepare Datasets

Testing Dataset

Training Dataset

NOTE: If you don't have BaiduYun account, you can download both the training and the testing dataset via Google Drive

3. Training

For model training, run in terminal:

python train.py --snapshots_folder weight_folder --pretrain_dir pretrained_weight_file

For example, if your folder to save weights are weight, and your most recent weight file are atweight/Epoch99.pth, run in terminal:

python train.py --snapshots_folder weight/ --pretrain_dir weight/Epoch99.pth

4. Testing

NOTE: Please delete all readme.txt in the data folder to avoid model inference error.

For model testing, run in terminal

python test.py --input_dir your_input_folder --weight_dir pretrained_weight_file --test_dir your_output_folder 

For example, if your input folder is named test_dataset, pretrained weight is at weight/Epoch99.pth, and your result image will be saved in test_output, you can run in terminal:

python test.py --input_dir test_dataset --weight_dir weight/Epoch99.pth --test_dir test_output

5. Testing on Videos

For model testing on videos (MP4 format), run in terminal:

bash test_video.sh

There are five hyperparameters in demo/make_video.pyfor video testing. See the following explanation.

Hyperparameters

NameTypeDefault
lowlight_images_pathstrdata/train_data/
lrfloat1e-3
weight_decayfloat1e-3
grad_clip_normfloat0.1
num_epochsint100
train_batch_sizeint6
val_batch_sizeint8
num_workersint4
display_iterint10
snapshot_iterint10
scale_factorint1
snapshots_folderstrweight/
load_pretrainboolFalse
pretrain_dirstrweight/Epoch99.pth
num_of_SegClassint21
conv_typestrdsc
patch_sizeint4
exp_levelfloat0.6

TODO List

Others

Please reach zhengsh@kean.edu if you have any questions. This repository is heavily based upon Zero-DCE. Thanks for sharing the code!

Citations

Please cite the following paper if you find this repository helpful.

@inproceedings{zheng2022semantic,
  title={Semantic-guided zero-shot learning for low-light image/video enhancement},
  author={Zheng, Shen and Gupta, Gaurav},
  booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision},
  pages={581--590},
  year={2022}
}

References

[1] Wei, Chen, et al. "Deep retinex decomposition for low-light enhancement." arXiv preprint arXiv:1808.04560 (2018).

[2] Zhang, Yonghua, Jiawan Zhang, and Xiaojie Guo. "Kindling the darkness: A practical low-light image enhancer." Proceedings of the 27th ACM international conference on multimedia. 2019.

[3] Jiang, Yifan, et al. "Enlightengan: Deep light enhancement without paired supervision." IEEE Transactions on Image Processing 30 (2021): 2340-2349.

[4] Guo, Chunle, et al. "Zero-reference deep curve estimation for low-light image enhancement." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020.

[5] Fu, Xueyang, et al. "A probabilistic method for image enhancement with simultaneous illumination and reflectance estimation." IEEE Transactions on Image Processing 24.12 (2015): 4965-4977.

[6] Guo, Xiaojie, Yu Li, and Haibin Ling. "LIME: Low-light image enhancement via illumination map estimation." IEEE Transactions on image processing 26.2 (2016): 982-993.

[7] Lv, Feifan, et al. "MBLLEN: Low-Light Image/Video Enhancement Using CNNs." BMVC. 2018.