Domain Adversarial Learning for Color Constancy

Zhifeng Zhang, Xuejing Kang, Anlong Ming

Color Constancy (CC) is a fundamental computer vision task aimed at estimating and removing the color cast introduced by scene illumination. While deep learning has significantly advanced this field, models often struggle with the "sensor domain gap"—the performance drop when a model trained on one camera sensor is applied to another. This paper, presented at IJCAI-22, introduces DALCC (Domain Adversarial Learning for Color Constancy), a framework designed to learn camera-independent features while maintaining high estimation accuracy.

The Challenge: Data Scarcity and Sensor Diversity

Robust CC models require extensive RAW image datasets. However, images from different sensors (e.g., Sony vs. Canon) exhibit unique spectral sensitivities. Mixing these datasets often confuses standard networks, as they fail to distinguish between variations caused by lighting and those caused by the sensor itself. Additionally, "Non-Primary Illuminant" (NPI) regions—such as shadows or secondary reflections—can mislead global estimation models by introducing conflicting color information.

The DALCC Framework

The proposed DALCC architecture addresses these issues through two primary modules:

1. Domain Adversarial Learning Branch (DALB)

The DALB aims to extract features that are invariant to the specific camera sensor. It employs a Camera Domain Classifier (CDC) in an adversarial setup: the classifier attempts to identify the source camera, while the feature extractor is trained to "fool" it.

However, making features entirely domain-invariant removes the color-space information necessary for final regression. To solve this, the Illuminant Transformation Module (ITM) acts as a bridge, learning a Color Space Transfer Matrix (CSTM) to map these universal features back into the target camera's specific color space.

2. Feature Reweighting Module (FRM)

To mitigate the impact of NPI regions, the FRM utilizes a spatial attention mechanism. By calculating feature similarity across the image, it identifies and down-weights outlier regions that likely contain secondary light sources, focusing the model on the primary illuminant.

Visualizing Domain Alignment

t-SNE visualizations and sample images demonstrating the effect of Domain Adversarial Learning (CDC) on feature distribution alignment across different camera sensors.

As shown in the t-SNE visualizations above, standard models (e.g., AlexNet or SqueezeNet) tend to cluster features based on the camera sensor (rows 2 and 3, columns c-h). By introducing the CDC, DALCC effectively "melts" these clusters together (rows 2 and 3, columns i-l), proving that the extracted features have become truly domain-invariant.

Key Results and Efficiency

Evaluated on the NUS-8 multi-camera dataset, DALCC achieved a state-of-the-art Mean Angular Error improvement of 11.2% over previous methods. Notably, this performance gain comes with minimal overhead; the model requires only 2.3% more parameters (3.00M vs 2.93M) than the baseline FC4-Alexnet, making it highly efficient for real-world deployment.

Ablation studies highlighted the necessity of the ITM. Removing the transformation module while keeping the adversarial classifier caused the mean error to jump from 1.42 to 2.20, confirming that the "bridge" between common and camera-specific spaces is vital for accurate color regression.

Conclusion and Future Work

DALCC provides a robust solution for multi-sensor color constancy by balancing domain invariance with camera-specific transformation. While the model currently requires camera labels during training and assumes a single primary illuminant, it sets a new benchmark for efficiency and accuracy in cross-sensor applications. Future work may extend this framework to "in-the-wild" data where sensor types are unknown or to complex scenes with multiple light sources.

Summary updated

BibTeX
@inproceedings{zhang2022domain,
  author = {Zhifeng Zhang and Xuejing Kang and Anlong Ming},
  title = {{Domain Adversarial Learning for Color Constancy}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.24963/ijcai.2022/236},
}
Figure