Skip to content

About

Low-light image enhancement: two custom exposure-aware losses on the Zero-DCE framework, benchmarked against Retinexformer and RUAS.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

Thesis Zero-DCE Code Archive

This repository preserves the code used in an earlier thesis project on low-light image enhancement. It contains a macOS-oriented Zero-DCE adaptation, the thesis loss extensions, inference and speed-test scripts, and the image-quality metrics used with the project.

This is a historical code archive. New research experiments and future models are maintained in a separate repository so that their evidence and conclusions do not become mixed with this project.

Related thesis

CHEN YUJIE, A Study on Deep Learning-Based Low-Light Image Enhancement

The RISS record is the authoritative bibliographic entry for the thesis associated with this code archive.

Included

  • Zero-DCE_code_mac/model_mac.py: DCE-Net model.
  • Zero-DCE_code_mac/Myloss_light_mac.py: original Zero-DCE losses plus the dark-region exposure loss and an optional highlight-preservation loss.
  • Zero-DCE_code_mac/lowlight_train_mac.py: training entry point.
  • Zero-DCE_code_mac/lowlight_test_mac.py: batch inference entry point.
  • Zero-DCE_code_mac/speed_test.py: inference-time benchmark.
  • Zero-DCE_code_mac/metrics/: PSNR, SSIM, LPIPS, NIQE, BRISQUE, and LOE scripts.

Datasets, generated images, checkpoints, virtual environments, IDE files, and third-party reproduction repositories are intentionally excluded.

Setup

Python 3.9 or later is recommended for this cleaned archive.

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd Zero-DCE_code_mac

On Windows, activate the environment with .venv\Scripts\activate.

Training

Place low-light training images in one directory and run:

python lowlight_train_mac.py \
  --lowlight_images_path data/train_data \
  --snapshots_folder snapshots

The default thesis configuration adds the dark-region exposure term with weight 3.0 and disables the exploratory highlight-preservation term. To train the original Zero-DCE objective without either extension, use:

python lowlight_train_mac.py \
  --lowlight_images_path data/train_data \
  --snapshots_folder snapshots_baseline \
  --dark_loss_weight 0 \
  --highlight_loss_weight 0

The highlight-preservation implementation remains available for historical completeness. Enable it explicitly with --highlight_loss_weight VALUE. The archived sources did not provide one unambiguous final weight for that exploratory variant, so this repository does not declare a canonical preset for it.

Inference and benchmark

python lowlight_test_mac.py \
  --checkpoint snapshots/Epoch10.pth \
  --input_dir data/test_data \
  --output_dir results

python speed_test.py \
  --ckpt snapshots/Epoch10.pth \
  --data_path data/test_data

Every model script accepts --device auto, cuda, mps, or cpu. auto selects CUDA first, then Apple Metal, then CPU.

Metrics

Full-reference metrics require enhanced images and matching ground-truth filenames:

python metrics/calc_psnr_ssim.py --pred_dir results --gt_dir data/ground_truth
python metrics/calc_lpips.py --pred_dir results --gt_dir data/ground_truth

No-reference metrics require enhanced images; LOE also compares them with the matching original low-light inputs:

python metrics/calc_niqe_brisque_loe.py \
  --pred_dir results \
  --input_dir data/test_data

Files are paired by identical basename. The scripts fail clearly when a pair is missing or the two images have different dimensions.

Reproducibility scope

This cleanup removes machine-specific paths, conversational development notes, cached environments, data, checkpoints, and generated results. The network and loss formulas are preserved. Because the historical archive did not include a complete dependency lock, checkpoints, or all datasets, this repository should not be treated as a claim that every number in the thesis can be reproduced from the repository alone.

Attribution and license

This work is derived from the official Zero-DCE implementation associated with the CVPR 2020 paper, Zero-Reference Deep Curve Estimation for Low-Light Image Enhancement. The upstream project states that its implementation is for academic research and non-commercial use under the Creative Commons Attribution- NonCommercial 4.0 International license. See NOTICE.md before use or redistribution.

About

Low-light image enhancement: two custom exposure-aware losses on the Zero-DCE framework, benchmarked against Retinexformer and RUAS.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages