Most cameras correct color by assuming one light source illuminates the whole scene. Real scenes break this all the time: a room lit by a tungsten lamp with daylight coming through a window, or a street where shadows are lit only by blue skylight. Networks that estimate a separate illuminant color at every pixel are the usual fix. Their weakness is that a pixel can only learn from nearby pixels. Two warm lamps on opposite sides of a daylight-filled room are estimated independently, so they drift apart in color even though they are the same kind of light. The obvious repair is to attach a global-context module, such as self-attention or a state space model, to the estimator. That repair connects every pixel to every other pixel based on position or appearance. That is the wrong notion of "related" for this problem.
We propose a layer that connects pixels by what light they appear to be lit by. Each pixel deposits its features into a small two-dimensional grid indexed by its current estimate of illuminant chromaticity, which is the illuminant's color with brightness removed. The network processes that grid with a convolution and reads the result back out at each pixel's location in the grid. The layer is global in image space: every pixel lit by "the same" light shares evidence, wherever it sits. It is local in illuminant space. It costs time linear in the number of pixels and puts no fixed cap on how many lights a scene may contain. Alternating this layer with ordinary convolutions lets illuminant estimates and evidence pooling refine each other.
Core Claim
For spatially varying white balance, the useful long-range context is the context among pixels sharing an illuminant. A layer that pools features in illuminant-chromaticity space will beat generic global context (criss-cross attention, global pooling) and fixed-capacity slot decomposition at matched compute. The gains should concentrate in scenes where same-illuminant regions are spatially disjoint, and in scenes with more distinct lights than a slot model allows.
The mechanism is a learned, differentiable version of the chromaticity histogram from Fourier color constancy, keyed on the network's own illuminant estimate rather than on raw pixel color. Let $f_i$ be the feature vector at pixel $i$, and $\hat{u}_i$ its current estimate of illuminant log-chrominance. Log-chrominance is a two-dimensional color coordinate in which a change of light color becomes a shift. Let $k(\cdot)$ be a smooth bilinear splatting kernel over grid cells $b$. The layer computes
$$G(b) = \frac{\sum_i k(\hat{u}_i - b)\, f_i}{\sum_i k(\hat{u}_i - b) + \epsilon}, \qquad f_i' = \sum_b k(\hat{u}_i - b)\, (\phi * G)(b),$$
where $\phi$ is a learned convolution over the grid. Because a global change of light color is a translation in log-chrominance, convolving over the grid is equivariant to that change. This is the same reason Fourier color constancy filters histograms with convolutions. The grid can optionally carry a coarse spatial axis (for example $4\times4$ image blocks), so that two physically different lights with similar chromaticity are not forced together. Whether that spatial axis helps is an ablation, not an assumption.
Relation to Prior Work
Several papers motivate the gap. Detecting Illumination in Images documents that a single global correction forces a bad compromise between indoor and window light. Domain Adversarial Learning for Color Constancy reports that unconstrained networks tend to suppress secondary lights or blend conflicting chromatic signals into muddy averages. Pixel-Wise Color Constancy via Smoothness Techniques in Multi-Illuminant Scenes (PWCC) shows that convolutional per-pixel estimators produce patchy maps. It fixes them with a smoothness penalty (total variation loss), label smoothing, and a post-hoc bilateral filter. Spatial context in PWCC still comes only from the U-Net's local hierarchy, and that limitation is what our layer targets.
The closest work is Attentive Illumination Decomposition Model for Multi-Illuminant White Balancing (AID). AID lets $K=7$ learned slots compete across a U-Net feature map. Each slot emits one illuminant color and one weight map, which guarantees the physically correct weighted-sum form of mixed lighting. AID already has a form of global grouping. Our layer differs in three ways. Its grouping lives in a continuous chromaticity grid rather than a fixed set of slots. It needs no pre-computed training-set color centroids. And it is interleaved throughout the encoder rather than applied once after a convolutional encoder. We also keep AID's physical output form as an option, so this comparison isolates the routing mechanism.
Two papers supply method. Integral Fast Fourier Color Constancy (IFFCC) supplies the chromaticity-histogram-plus-convolution idea, which it applies to fixed rectangular windows that are processed independently and then blended with a guided filter. That pipeline is the cross-region blindness we remove. CCNet: Criss-Cross Attention for Semantic Segmentation and Broadcasting Convolutional Network for Visual Relational Reasoning supply the generic global-context modules we compare against. CCNet attends along each pixel's row and column. The broadcasting network pools a global vector and copies it back to every pixel with coordinate channels.
One paper constrains the design. D2-Mamba: Dual-Scale Fusion and Dual-Path Scanning with SSMs for Shadow Removal routes information within homogeneous lighting zones using a state space model, a sequence model scanned across the image. Its scan paths require a binary shadow mask, which continuous multi-light scenes do not have. Our layer is in effect a mask-free, soft version of "route within the same lighting zone." The zone membership is the network's own continuous illuminant estimate.
The sRGB fusion line, Auto White-Balance Correction for Mixed-Illuminant Scenes and Revisiting Image Fusion for Multi-Illuminnat White-Balance Correction, works on rendered camera presets rather than raw data. We treat it as a secondary setting rather than the main target.
Research Program
The base estimator is the LSMI-style U-Net used by PWCC, predicting per-pixel log-chrominance from raw images. We insert the illuminant-routing layer at two or three encoder and decoder scales. At each insertion point, a lightweight head produces $\hat{u}_i$, the features are splatted into a $64\times64$ grid over the log-chrominance range seen in training, and the result is convolved and sliced back as a residual. Splatting weights are soft, so gradients reach both the features and the illuminant estimates that position them.
We build two output variants. One regresses the per-pixel map directly. The other reads illuminant colors from the peaks of the final grid and weight maps from the slice weights, which recovers AID's physically constrained weighted-sum form without a fixed $K$. We will analyze three things: how many grid peaks the model forms as a function of the true number of lights; whether same-illuminant regions far apart converge to the same estimate; and failure cases where two different lights have near-identical chromaticity, which the coarse spatial axis is meant to handle.
Baselines
The naive reference point is a single global illuminant estimate applied to the whole image, using the same backbone with global average pooling of the output. It measures how much the multi-light benchmarks actually penalize the uniform assumption.
The plain per-pixel reference is PWCC v2, the U-Net with total variation loss, label smoothing and bilateral filtering. PWCC reports a mean angular error of 2.0 against 2.31 for the LSMI U-Net on the Galaxy Note 20 dual-light subset, with worst-25% error falling from 4.24 to 3.8 (Pixel-Wise Color Constancy via Smoothness Techniques in Multi-Illuminant Scenes). We retrain it on our splits with the same augmentation and the same number of hyperparameter trials as our model.
The strongest existing method is AID, which reports mean angular error 2.04 on LSMI (versus 2.31 for the prior best) and 2.46 on MIIW (versus 4.28) (Attentive Illumination Decomposition Model for Multi-Illuminant White Balancing). PWCC's 2.0 is on one camera subset and AID's 2.04 is on LSMI as a whole, so we will not compare these two numbers directly. Instead we rerun both on identical splits. Beating AID means lower mean and worst-25% angular error on LSMI and MIIW across three seeds at no more than AID's parameter count and FLOPs. On the more-than-seven-lights stress test described below, we expect a margin larger than seed variance.
The generic global-context baselines are recurrent criss-cross attention and global pooling with coordinate broadcasting, both inserted at the same locations as our layer with FLOPs matched to within 10%. There is no reported result found on Lacuna for criss-cross attention or broadcasting networks on any color constancy benchmark, so these runs are new.
Two ablations isolate the key ingredient. In the first, the layer's grid is keyed on the input pixel's raw chromaticity rather than the estimated illuminant. This groups pixels by surface color plus light, which is essentially a learned bilateral grid. In the second, the key is a random fixed projection of the features. If either matches the illuminant-keyed version, the claim that routing by illuminant identity matters is false.
Why not just…?
Why not just add standard global attention to the U-Net? Generic global context lets every pixel see everything but gives it no prior about which distant pixels share a light. The file reports no white-balance result for such modules, and PWCC's gains came from smoothness priors, not context range. This is a real threat if what matters is any global context at all, so the FLOP-matched criss-cross and broadcast baselines are central. The disjoint-illuminant test below is where the difference should appear or fail to appear.
Why not just raise AID's slot count? A larger $K$ addresses capacity, but AID still relies on fixed training-set centroids and a single competition after a convolutional encoder. We will train AID with $K=12$ and $K=16$. If that closes the gap on the stress test, our capacity argument collapses and the remaining claim must rest on accuracy at matched cost.
Why not just cluster the U-Net's predicted map at test time and average within clusters? This post-hoc grouping is the cheapest version of our idea and is a genuine competitor. It is not learned, and it uses hard assignments that can merge lights across soft transitions. We run k-means with $K$ chosen by silhouette score on PWCC outputs, followed by per-cluster averaging and the same bilateral filter. If it matches us, the contribution reduces to a post-processing trick.
Why not just use IFFCC? IFFCC is far cheaper, running in 5.8 ms on CPU with a mean angular error of 2.19 on the Shadow Dataset (Integral Fast Fourier Color Constancy). However, its windows never share evidence. We include it on LSMI to measure what learned cross-region pooling buys over independent windows, and we report runtime alongside error.
Proposed Experiments
The main evaluation trains on LSMI raw images and tests on held-out LSMI scenes for each camera, reporting mean, median and worst-25% angular error. We then test cross-dataset on MIIW without fine-tuning, plus NUS-8 to confirm that single-light accuracy does not regress (AID reports 1.57 there).
The first decisive check is a disjoint-illuminant analysis. Using LSMI's per-pixel mixing coefficients, we label pixels whose dominant illuminant also dominates a region at least a quarter of the image width away, with a different dominant illuminant in between. We then measure the gap in illuminant estimates between such paired regions and the error on those pixels. Our layer should shrink both relative to PWCC and the criss-cross baseline. If it does not, the core claim fails.
The second decisive check is a capacity stress test. Starting from LSMI raw images neutralized with their ground-truth per-pixel illuminant, we re-light them in linear raw space with 1 to 12 illuminants. Illuminant colors are drawn along and off the daylight locus, and smooth random weight maps follow the tinting approach of Conditional GANs for Multi-Illuminant Color Constancy: Revolution or yet Another Approach?. Error is plotted against the number of lights for AID at three slot counts and for our model. We also report peak counts from the physically constrained variant.
The third check is a transfer test into the sRGB preset-fusion setting. We insert the layer into the transposed-attention fusion network and evaluate on the combined Sony/Nikon benchmark. The reported baseline there is $\Delta E2000$ 4.55 versus 9.31 for MixedWB (Revisiting Image Fusion for Multi-Illuminnat White-Balance Correction). This tests whether illuminant routing helps a network that currently has only $3\times3$ spatial context.
Across all experiments we report parameters, FLOPs and runtime at full resolution, three seeds, and the two keying ablations. A positive result requires all three of the following: illuminant keying beats appearance keying, the disjoint-region gap shrinks, and AID with more slots does not erase the capacity advantage.
References
- Detecting Illumination in Images
- Domain Adversarial Learning for Color Constancy
- Pixel-Wise Color Constancy Via Smoothness Techniques In Multi-Illuminant Scenes
- Attentive Illumination Decomposition Model for Multi-Illuminant White Balancing
- Integral Fast Fourier Color Constancy
- CCNet: Criss-Cross Attention for Semantic Segmentation
- Broadcasting Convolutional Network for Visual Relational Reasoning
- D2-Mamba: Dual-Scale Fusion and Dual-Path Scanning with SSMs for Shadow Removal
- Auto White-Balance Correction for Mixed-Illuminant Scenes
- Revisiting Image Fusion for Multi-Illuminnat White-Balance Correction
- Conditional GANs for Multi-Illuminant Color Constancy: Revolution or yet Another Approach?