Introduction to PyDIff: Pyramid Diffusion Models for Low-Light Image Enhancement
PyDIff is an advanced project focused on enhancing low-light images using innovative pyramid diffusion models. This project was presented as an oral talk at IJCAI 2023 and is designed to significantly improve the quality of low-light images, making them clearer and more detailed than other existing methods.
Overview
At its core, PyDIff utilizes a pyramid diffusion approach, which is a hierarchical structure that processes images at multiple levels of detail. This technique helps in enhancing features from various scales, improving the overall image quality more effectively compared to other traditional methods.
Evaluation Results
When tested on the standard LOL dataset, PyDIff outperforms several other methods in enhancing low-light images. The table below presents a comparison of PyDIff's performance with other methods:
Method | PSNR | SSIM | LPIPS |
---|---|---|---|
KIND | 20.87 | 0.80 | 0.17 |
KIND++ | 21.30 | 0.82 | 0.16 |
Bread | 22.96 | 0.84 | 0.16 |
IAT | 23.38 | 0.81 | 0.26 |
HWMNet | 24.24 | 0.85 | 0.12 |
LLFLOW | 24.99 | 0.92 | 0.11 |
PyDIff | 27.09 | 0.93 | 0.10 |
These metrics — PSNR, SSIM, and LPIPS — indicate that PyDIff offers superior performance, providing more accurate and visually pleasing results.
Installation and Dependencies
For those interested in experimenting or contributing to PyDIff, here’s how to get started:
git clone https://github.com/limuloo/PyDIff.git
cd PyDiff
conda create -n PyDiff python=3.7
conda activate PyDiff
conda install pytorch==1.7.0 torchvision torchaudio cudatoolkit=11.0 -c pytorch
cd BasicSR-light
pip install -r requirements.txt
BASICSR_EXT=True sudo $(which python) setup.py develop
cd ../PyDiff
pip install -r requirements.txt
BASICSR_EXT=True sudo $(which python) setup.py develop
Dataset
PyDIff employs the LOL dataset for its training and evaluation stages, which can be downloaded and organized as follows:
PyDiff/
BasicSR-light/
PyDiff/
dataset/
LOLdataset/
our485/
eval15/
Pretrained Model
A pretrained model is available to facilitate quick tests and further improvements.
PyDiff/
BasicSR-light/
PyDiff/
pretrained_models/
LOLweights.pth
Testing and Training
To test the model, one can execute:
cd PyDiff/
CUDA_VISIBLE_DEVICES=0 python pydiff/train.py -opt options/infer.yaml
For training, both single and multi-GPU options are available, supporting 24GB or higher memory configurations.
Multi-GPU Training:
cd PyDiff/
CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 --master_port=22666 pydiff/train.py -opt options/train_v1.yaml --launcher pytorch
Single-GPU Training:
cd PyDiff/
CUDA_VISIBLE_DEVICES=0 python -m torch.distributed.launch --nproc_per_node=1 --master_port=22666 pydiff/train.py -opt options/train_v2.yaml --launcher pytorch
PyDIff also provides customization for training on your own datasets, allowing modifications in configuration files to suit specific needs.
Citations
For those using PyDIff in academic research or development, you can credit the work as follows:
@article{zhou2023pyramid,
title={Pyramid Diffusion Models For Low-light Image Enhancement},
author={Zhou, Dewei and Yang, Zongxin and Yang, Yi},
journal={arXiv preprint arXiv:2305.10028},
year={2023}
}
Acknowledgement
PyDIff acknowledges the foundational work provided by BasicSR, highlighting the collaborative effort in advancing image processing technologies.
In summary, PyDIff represents a significant step forward in low-light image enhancement, offering improved results and a comprehensive framework for further research and development.