Presented at CVPR 2021, CLCC (Contrastive Learning for Color Constancy) introduces a framework designed to enhance how cameras interpret lighting conditions. By fundamentally rethinking the application of contrastive learning to low-level vision tasks, the authors achieve state-of-the-art results using significantly smaller models than previous approaches.
Abstract
Color constancy is a critical low-level vision task that enables digital cameras to estimate and remove the influence of an illuminant, producing natural-looking images. Traditional deep learning models often fail by learning spurious correlations between scene content and lighting. CLCC addresses this by employing a supervised contrastive learning framework that isolates illuminant-dependent features. Through a novel raw-domain color augmentation technique, CLCC achieves a 17.5% improvement over strong baselines and significantly reduces errors in rare lighting conditions while maintaining high efficiency.
The Challenge of Spurious Correlations
Color constancy is an "ill-posed" problem because a single image can be the result of many different combinations of scene reflectance and illuminant color. Humans have a natural "white balance" system, but digital sensors must computationally estimate the light source to "cancel it out."
Deep learning models often take shortcuts by memorizing scene content. For instance, if a training set frequently features forest scenes under daylight, a model may incorrectly guess "daylight" for any forest scene, even if it is lit by a sunset. Standard self-supervised contrastive learning typically aims for illuminant-invariant features (e.g., identifying a cat regardless of lighting), which is counterproductive for color constancy where the lighting is the signal of interest.
Methodology
1. The Contrastive Twist
CLCC proposes a fully supervised contrastive learning framework that seeks to learn representations that are scene-invariant but illuminant-dependent. This is a deliberate reversal of standard contrastive objectives:
- Positive Pairs: Different scenes captured under the same illuminant are forced to have similar representations.
- Negative Pairs: The same scene captured under different illuminants are forced to have distinct representations.
2. Raw-Domain Color Augmentation
To facilitate this learning, the authors developed a specialized augmentation technique for raw sensor data. This involves Illuminant Swapping, where color checkers from two different images are used to map the lighting of one image onto the content of another.
Furthermore, the framework utilizes Novel Illuminant Synthesis. By interpolating or extrapolating between known light sources, the system generates synthetic lighting conditions. This helps the model generalize to the "long tail" of rare lighting conditions that are often missing from standard training sets.
Experimental Results
The model was evaluated on the NUS-8 (1,736 images) and Gehler (568 images) datasets, which are gold-standard benchmarks for color constancy.
- Performance: On the NUS-8 dataset, CLCC achieved a 17.5% relative improvement in mean angular error over the SqueezeNet-FC4 baseline, reducing the error from 2.23 to 1.84.
- Efficiency: On the Gehler dataset, CLCC matched the performance of top-tier models like C4 while using 3x fewer parameters, making it highly suitable for mobile and embedded deployment.
- Robustness: The framework specifically addressed "data-sparse" regions, reducing the worst-case error (the most difficult 25% of cases) by 28.7%.
Conclusion and Future Work
CLCC demonstrates that focusing on illuminant-dependent features through contrastive learning can significantly improve color constancy. While the most advanced version of the augmentation requires color checkers for training, the framework remains robust even with simpler fallback methods. Future work may explore multi-sensor training to allow a single model to generalize across different camera hardware without the need for sensor-specific fine-tuning.
Summary updated