Time-Aware Auto White Balance in Mobile Photography

Mahmoud Afifi, Luxi Zhao, Abhijith Punnappurath, Mohammed A. Abdelsalam, Ran Zhang, Michael S. Brown

TL;DR

Traditional Auto White Balance (AWB) algorithms rely solely on image pixels, often struggling to distinguish between ambiguous lighting conditions like a warm sunset versus warm indoor lighting. This paper introduces an ultra-lightweight neural network (~5K parameters) that leverages smartphone metadata—specifically timestamp, geolocation, and camera settings—to drastically narrow down illumination possibilities. Alongside this method, the authors introduce a new dataset of over 3,200 smartphone images complete with rich metadata and user-preference ground truths.

What Problem Does This Paper Address?

Auto White Balance (AWB) is a fundamental camera pipeline step responsible for removing unrealistic color casts caused by ambient lighting. Most modern approaches treat this strictly as a computer vision problem, analyzing raw pixel values or color histograms to estimate the scene's global illuminant.

However, color alone is inherently ambiguous. A camera can easily confuse a naturally warm sunset with incandescent indoor lighting. While mobile phones capture rich contextual metadata (such as when and where a photo was taken, alongside camera settings like ISO and shutter speed), existing AWB algorithms completely ignore this information. Furthermore, standard AWB datasets were collected using DSLR cameras that lack built-in GPS or accurate timestamps, leaving a significant gap in research for time-aware mobile photography.

Methods

The authors propose a dual-branch, ultra-lightweight neural network containing only around 5,000 parameters:

  • Time-Capture Branch: Instead of feeding raw clock time directly (which fails to generalize across time zones), the model uses geolocation and timestamps to compute the absolute probability of solar events (dawn, sunrise, noon, sunset, dusk, midnight) via standard astronomical algorithms. This is combined with camera metadata (ISO, shutter speed, flash status) and simulated noise statistics to help the model differentiate between indoor and outdoor environments.
  • Color Histogram Branch: The model processes a 2D chromaticity histogram (R/G and B/G channels) of both the image colors and its edges, augmented with spatial coordinate channels.

Features from both branches are projected into 16-dimensional latent spaces, concatenated, and passed through a tiny Multi-Layer Perceptron (MLP) to predict the final illuminant chromaticity.

Model Architecture

Datasets

  • New Smartphone Dataset: The authors collected 3,224 linear raw images using a Samsung S24 Ultra. Crucially, every image includes accurate contextual metadata (timestamp, geolocation) and capture settings, covering diverse weather conditions, times of day, and artificial/natural light sources.
  • Dual Ground Truths: For each scene, the dataset provides a standard neutral ground truth (calculated via a physical calibration color chart) and a user-preferred ground truth (manually adjusted by an expert photographer for aesthetic appeal and validated via a 20-participant user study).
  • Simple Cube++: A standard DSLR dataset used to evaluate the model's performance when geolocation metadata is missing, relying only on camera settings (ISO, exposure time).

Key Insights and Ideas

  • Context Constrains Color: Knowing the time and location provides a strong prior for outdoor scene illumination. For instance, natural light at noon has a completely different Correlated Color Temperature (CCT) range than light at sunset or sunrise.
  • Astronomy as a Feature Engineering Tool: Converting raw timestamps into solar event probabilities makes the model entirely location- and timezone-independent, preventing it from overfitting to specific geographical coordinates.
  • Metadata Enables Micro-Models: By injecting high-level contextual cues, a tiny 5K-parameter model can match or outperform deep learning models that are orders of magnitude larger, making it ideal for deployment on mobile Digital Signal Processors (DSPs).
  • Aesthetics vs. Neutrality: User-preferred white balance tends to have a tighter distribution near the Planckian locus compared to strict neutral white balance, reflecting human preference for warmer or cooler tones depending on the context (e.g., keeping the warm glow of a sunset).

Key Results

  • State-of-the-Art Efficiency: The proposed model achieves top-tier accuracy while using only ~5K parameters. It runs in just 0.25 ms on a flagship mobile DSP and 0.80 ms on a mobile CPU.
  • Quantitative Gains: On the new dataset, incorporating time and capture metadata significantly reduced the mean angular error compared to using color features alone (dropping from 2.03° to 1.66° on the validation set).
  • The model outperformed larger established models (like FC4, C4, and FFCC) across most standard evaluation metrics on both the new smartphone dataset and the Simple Cube++ benchmark.
Visual comparison of AWB results

Limitations and Future Work

  • Metadata Dependency: The model's optimal performance relies on geolocation data, which is typically unavailable on standard DSLR cameras.
  • Camera Specificity: Because the model incorporates hardware-dependent capture settings (ISO, shutter speed, and sensor noise profiles), it cannot seamlessly generalize to a new smartphone sensor without fine-tuning or explicit cross-camera color calibration. The authors suggest exploring pre-processing mapping techniques to mitigate this in future work.

Summary updated

Abstract

Cameras rely on auto white balance (AWB) to correct undesirable color casts caused by scene illumination and the camera's spectral sensitivity. This is typically achieved using an illuminant estimator that determines the global color cast solely from the color information in the camera's raw sensor image. Mobile devices provide valuable additional metadata-such as capture timestamp and geolocation-that offers strong contextual clues to help narrow down the possible illumination solutions. This paper proposes a lightweight illuminant estimation method that incorporates such contextual metadata, along with additional capture information and image colors, into a compact model (~5K parameters), achieving promising results, matching or surpassing larger models. To validate our method, we introduce a dataset of 3,224 smartphone images with contextual metadata collected at various times of day and under diverse lighting conditions. The dataset includes ground-truth illuminant colors, determined using a color chart, and user-preferred illuminants validated through a user study, providing a comprehensive benchmark for AWB evaluation.
BibTeX
@inproceedings{afifi2025time,
  author = {Mahmoud Afifi and Luxi Zhao and Abhijith Punnappurath and Mohammed A. Abdelsalam and Ran Zhang and Michael S. Brown},
  title = {{Time-Aware Auto White Balance in Mobile Photography}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure