Abstract
Achieving accurate color constancy—the ability to perceive true colors regardless of illumination—remains a challenge for digital cameras due to sensor-specific biases and complex lighting. We present Generative Color Constancy (GCC), a method that utilizes the internal "world knowledge" of pre-trained diffusion models to estimate scene lighting. By inpainting a virtual Macbeth color checker into a scene, GCC acts as a sensor-independent light probe. Our approach employs Laplacian decomposition to preserve structural integrity and a single-step deterministic inference for speed. GCC achieves state-of-the-art generalization on standard benchmarks, processing images in 0.18 seconds.
Introduction
Color constancy is fundamental to computer vision, yet cameras often struggle with "color casts" where white objects appear tinted by the light source. While humans adjust for this naturally, most deep-learning solutions are tied to specific camera sensors, failing when applied to new hardware. Traditional statistical methods like "Gray World" are faster but often fail in monochromatic or complex scenes. GCC addresses these limitations by leveraging foundation models as universal light estimators that understand the physics of lighting through vast visual training data.
Methods
The GCC pipeline treats color constancy as a specialized inpainting task built upon Stable Diffusion 2.
The Virtual Probe and Laplacian Decomposition
Instead of direct regression of light parameters, GCC "paints" a standard Macbeth color checker into the image. To ensure the inpainted checker maintains its physical grid structure while adopting the scene's lighting, the authors use Laplacian decomposition. This technique separates high-frequency structural details (the grid) from low-frequency color information, allowing the model to adapt the checker's color to the environment without distorting its shape.
Efficient and Consistent Inference
To overcome the slow and stochastic nature of standard diffusion, the model is fine-tuned for deterministic single-step inference. This ensures that the same input image always yields the same light estimate and reduces processing time to just 180ms. Additionally, mask color jittering is used during training to force the model to reconstruct the checker based solely on surrounding environmental cues rather than existing pixel data.
Key Results
GCC was evaluated on the NUS-8, Gehler, and LSMI datasets, focusing on its ability to generalize across different camera sensors.
- Superior Generalization: In cross-camera benchmarks, GCC outperformed previous state-of-the-art methods. For instance, when trained on NUS-8 and tested on the Gehler dataset, it achieved a mean angular error of 2.35°, surpassing the 2.73° error of the previous leader, C4.
- Real-time Performance: The single-step inference allows GCC to process 512x512 images in 0.18 seconds on an NVIDIA RTX 4090, making it roughly 100 times faster than multi-step diffusion approaches.
- Spatially Varying Illumination: By placing multiple virtual checkers across a scene, GCC can handle multi-illuminant environments, creating a comprehensive light map for complex white balancing.
Discussion and Conclusion
GCC demonstrates that generative foundation models can serve as powerful, sensor-independent light probes. By querying the model's internal understanding of how neutral objects should look under specific lighting, the system bypasses the need for physical calibration tools.
While highly effective, the model is currently limited by the 512x512 resolution of its base architecture and requires significant GPU resources. Future work will focus on model distillation for mobile deployment and improving robustness in extreme, monochromatic lighting conditions. Overall, GCC represents a significant step toward universal, hardware-agnostic color constancy.
Summary updated