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.
CHEN YUJIE, A Study on Deep Learning-Based Low-Light Image Enhancement
- RISS record: https://www.riss.kr/search/detail/DetailView.do?p_mat_type=be54d9b8bc7cdb09&control_no=fc10205106f224aeffe0bdc3ef48d419
- UCI:
I804:48026-200001036653
The RISS record is the authoritative bibliographic entry for the thesis associated with this code archive.
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.
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_macOn Windows, activate the environment with .venv\Scripts\activate.
Place low-light training images in one directory and run:
python lowlight_train_mac.py \
--lowlight_images_path data/train_data \
--snapshots_folder snapshotsThe 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 0The 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.
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_dataEvery model script accepts --device auto, cuda, mps, or cpu. auto
selects CUDA first, then Apple Metal, then CPU.
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_truthNo-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_dataFiles are paired by identical basename. The scripts fail clearly when a pair is missing or the two images have different dimensions.
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.
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.