AttentionLUT: Attention Fusion-Based Canonical Polyadic LUT for Real-Time Image Enhancement

Kang Fu, Yicong Peng, Zicheng Zhang, Qihang Xu, Xiaohong Liu, Jia Wang, Guangtao Zhai

Introduction

In real-time photo editing, 3D Lookup Tables (3DLUTs) are essential for mapping input RGB colors to enhanced output colors. While effective, static 3DLUTs cannot adapt to varying lighting conditions. Current "image-adaptive" methods typically use a neural network to predict weights for a linear combination of basis LUTs. However, this linear approach often fails to capture complex color transformations and lacks generalization. Furthermore, the cubic growth ($N^3$) of 3DLUT parameters with resolution poses significant memory challenges for mobile deployment.

AttentionLut addresses these limitations by introducing a framework that combines a multi-head attention mechanism with Canonical Polyadic (CP) tensor decomposition. This approach generates precise, image-adaptive 3DLUTs that are both computationally efficient and capable of representing non-linear color relationships.

Methodology

The AttentionLut pipeline consists of three primary modules designed to create a flexible and lightweight enhancement tool.

The AttentionLut architecture overview, illustrating the flow from input image to the final enhancement residual via GICF, AF, and CPR modules.

1. Global Image Context Feature (GICF) Module

A lightweight CNN processes a downsampled ($256 \times 256$) version of the input image. This module extracts a global "style" or context feature that informs the subsequent color transformation stages.

2. Attention Fusion (AF) Module

The AF module is the core innovation of the framework. Rather than relying on simple linear weighting, it employs a multi-head attention mechanism. This module fuses learned "priori" information with specific image features to generate image-adaptive CP tensors. This allows the model to capture complex, non-linear relationships between image content and the required color correction.

3. Canonical Polyadic Reconstruction (CPR) Module

To maintain efficiency, AttentionLut avoids predicting a full 3D grid directly. Instead, it utilizes CP decomposition, representing a 3D tensor as a sum of outer products of 1D vectors. This "compresses" the 3DLUT, reducing the parameter count from $N^3$ to $3 \times X \times N$ (where $X$ is the rank), facilitating deployment on resource-constrained devices. The final output is an "enhancement residual" added back to the original input.

Experimental Results

The model was evaluated on the MIT-Adobe FiveK dataset, using 4,500 image pairs for training and 500 for testing, with "Expert C" retouches as the ground truth.

Quantitative performance comparison on the MIT-Adobe FiveK dataset. AttentionLut achieves superior PSNR and SSIM while maintaining a competitive parameter count.

AttentionLut outperformed several state-of-the-art (SOTA) methods across key metrics:

  • Accuracy: It achieved a PSNR of 25.56 dB, surpassing the baseline 3DLUT (25.23 dB) and SepLUT (25.47 dB).
  • Perceptual Quality: The model reached the highest SSIM (0.926) and a low color error ($\Delta E$ of 7.53), indicating high structural and chromatic fidelity.
  • Efficiency: Despite the complexity of the attention mechanism, the CPR module keeps the parameter count at approximately 593k, making it comparable to simpler models in size while delivering superior performance.

Discussion and Key Insights

The success of AttentionLut stems from two primary insights:

  1. Non-linear Fusion: The relationship between image content and color correction is inherently non-linear. By using attention to "query" learned color priors, the model achieves more accurate retouching than traditional linear mixing.
  2. Tensor Decomposition for Efficiency: Treating the 3DLUT as a combination of 1D vectors significantly reduces memory overhead without sacrificing precision.

Limitations

While effective, the current model relies on global context, which may struggle with images requiring spatially varying enhancements (e.g., localized brightening). Additionally, while the parameter count is low, further hardware-specific optimization and rank selection ($X$) are necessary to maximize real-time performance on diverse mobile chipsets.

Summary updated

BibTeX
@inproceedings{fu2024attentionlut,
  author = {Kang Fu and Yicong Peng and Zicheng Zhang and Qihang Xu and Xiaohong Liu and Jia Wang and Guangtao Zhai},
  title = {{AttentionLUT: Attention Fusion-Based Canonical Polyadic LUT for Real-Time Image Enhancement}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  url = {https://openreview.net/forum?id=R7LferKwEe},
}
Figure