Skip to content

TaoWangzj/LLFormerV2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLFormer V2: Illumination-Aware Transformer with Semantic Fusion for UHD Low-Light Image Enhancement and Beyond

Abstract: With the proliferation of ultra-high-definition (UHD) imaging devices, low-light image enhancement (LLIE) faces new challenges in both visual fidelity and computational efficiency. In this work, we introduce a large-scale UHD-LLIE benchmark, UHD-LOL, containing paired 4K and 8K low-light and reference images, and systematically evaluate existing LLIE algorithms under UHD settings. Building upon this benchmark, we propose LLFormer V2, a physically guided Transformer architecture that incorporates Illumination Prior Regularization (IPR) to explicitly embed multi-scale illumination cues into both the self-attention and feed-forward pathways. This physically informed design allows the model to disentangle illumination from reflectance, resulting in natural brightness recovery, robust color constancy, and improved perceptual consistency. To further enhance efficiency and representational power, we redesign the Axis-based Transformer Block into ATB V2, which employs a clustering–dispatching mechanism to adaptively fuse local and global features while maintaining computational tractability. Furthermore, we extend the framework to LLFormer V2-T, integrating high-level semantic priors from a frozen pre-trained Large Language Model into the bottleneck to facilitate global contextual reasoning. Experimental results across diverse benchmarks demonstrate that the LLFormer V2 series achieve state-of-the-art performance in multiple tasks, such as UHD low-light image enhancement, UHD image deblurring, and UHD image deraining.

News

  • Dec 11, 2025: Pre-trained models are released!
  • Dec 11, 2025: Codes is released!

UHDLOL Benchmark for Image Enhancement

We create a new large-scale UHD-LLIE dataset called UHDLOL to benchmark the performance of existing LLIE methods and explore the UHD-LLIE problem. It consists of two subsets: UHD-LOL4K and UHD-LOL8K. The UHD-LOL4K subset contains 8, 099 pairs of 4K low-light/normal-light images. Among them, 5, 999 pairs of images are used for training and 2, 100 for testing. The UHD-LOL8K subset includes 2, 966 pairs of 8K low-light/normal-light images, which are split into 2, 029 pairs for training and 937 for testing.

Network Architecture

We propose LLFormer V2, an advanced Transformer-based framework for Ultra-High-Definition Low-Light Image Enhancement. At its core, the model employs a Axis-based Transformer Block V2, which enhances the original axis-based multi-head self-attention mechanism with a novel clustering-dispatching strategy​ to efficiently fuse local and global features while maintaining computational tractability. The framework also incorporates Illumination Prior Regularization, a physically-guided module that explicitly embeds multi-scale illumination cues into both the self-attention and feed-forward pathways, enabling more natural illumination recovery and robust color consistency. Furthermore, an extended version named LLFormer V2-T integrates a frozen pre-trained Large Language Model (LLM) into the bottleneck stage, injecting high-level semantic priors to enhance global contextual reasoning without additional training overhead.

Quantitative results

Results on UHD-LOL

Results on LOL and MIT-Adobe FiveK

Results on UHDBlur

Results on 4K-Rain13k

Get Started

Dependencies and Installation

  1. Clone Repo
git clone https://github.com/TaoWangzj/LLFormerV2.git
cd LLFormerv2
  1. Create Conda Environment
conda create -n LLFormerv2 python=3.8
conda activate LLFormerv2
pip install -r requirements.txt

Dataset

You can use the following links to download the datasets

  1. UHD-LOL4K [OneDrive | Baidu drive]
  2. UHD-LOL8K [OneDrive | Baidu drive]
  3. LOL [Link]
  4. MIT-Adobe FiveK [Google drive | Baidu drive]
  5. UHDBlur [Link]
  6. 4K-Rain13k [Link]

Pretrained Model

We provide the pre-trained models under different datasets:

Visual comparison results

We provide the compared visual results. You can download from [Baidu drive].

Test

You can directly test the pre-trained model as follows

  • Modify the --option in test.sh to options/test/LLFormerv2.yml if you want to test LLFormerv2, or to options/test/LLFormerv2+.yml if you want to test LLFormerV2-T.
  • Specify the data path dataroot_gt, dataroot_lq, and model path pretrain_network_g in corresponding config files. Then run
sh test.sh

To calculate metrics for the test results

  • Modify the data path input and gt in measure.py to the path of the test results and ground truth images, respectively. Then run
# test on rgb channel
python measure.py
# test on y channel
python measure.py --y

Train

  1. To download training and testing datasets

  2. Train the model for non-UHD datasets (LOL and MIT-Adobe FiveK)

  • Modify the --option in train.sh to options/train/LLFormerv2.yml or options/train/LLFormerv2+.yml, depending on the model you want to train.
  • Change --nproc_per_node in train.sh to the number of GPUs you want to use (default is 1).
  • Specify the data path in the corresponding config files. Then run
sh train.sh
  1. Train the model for UHD dataset (UHD-LOL4K, UHD-LOL8K, UHDBlur, 4K-Rain13k)
  • Modify the --option in train.sh to options/train/LLFormerv2_UHD.yml or options/train/LLFormerv2+_UHD.yml, depending on the model you want to train.
  • Change --nproc_per_node in train.sh to the number of GPUs you want to use (default is 2).
  • Specify the data path in the corresponding config files. Then run
sh train.sh

Citations

If UHDLOL benchmark and LLFormer V2 help your research or work, please consider citing:

@inproceedings{wang2023ultra,
  title={Ultra-high-definition low-light image enhancement: A benchmark and transformer-based method},
  author={Wang, Tao and Zhang, Kaihao and Shen, Tianrun and Luo, Wenhan and Stenger, Bjorn and Lu, Tong},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={37},
  number={3},
  pages={2654--2662},
  year={2023}
}
@inproceedings{zhang2021benchmarking,
  title={Benchmarking ultra-high-definition image super-resolution},
  author={Zhang, Kaihao and Li, Dongxu and Luo, Wenhan and Ren, Wenqi and Stenger, Bjorn and Liu, Wei and Li, Hongdong and Yang, Ming-Hsuan},
  booktitle={ICCV},
  pages={14769--14778},
  year={2021}
}

Contact

If you have any questions, please contact taowangzj@gmail.com


Our Related Works

  • Ultra-High-Definition Low-Light Image Enhancement: A Benchmark and Transformer-Based Method, AAAI 2023. Paper | Code
  • Benchmarking Ultra-High-Definition Image Super-resolution, ICCV 2021. Paper | Code
  • MC-Blur: A Comprehensive Benchmark for Image Deblurring, arXiv 2022. Paper | Code

Reference Repositories

This implementation is based on / inspired by:

statistics

visitors

About

The code release of paper "LLFormer V2: Illumination-Aware Transformer with Semantic Fusion for UHD Low-Light Image Enhancement and Beyond"

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors