Preprint
Article

This version is not peer-reviewed.

Color-in-Context: A 12K-Image Dataset for Color Recognition Under Varied Illumination

  † These authors contributed equally to this work.

Submitted:

04 April 2026

Posted:

08 April 2026

You are already at the latest version

Abstract
We present Color-in-Context, a dataset of 12,086 photographs annotated along two complementary dimensions: color (Black, Blue, Gray, Orange, Pink, Purple, Skyblue, White, Yellow) and illumination (fluorescentLight, indoor, indoorNight, sunLight). The dataset is organized into 36 joint categories (9 colors × 4 illumination conditions) using a consistent folder hierarchy and normalized labels. We provide summary counts across colors, illuminations, and selected joint buckets, and an optional manifest file to support deterministic indexing and integrity checking. This Data Descriptor documents dataset construction, label normalization, duplicate screening, and file-integrity checks, and provides usage guidance for split generation and reporting under varied illumination.
Keywords: 
;  ;  ;  ;  ;  

1. Introduction

Perceived color depends on surface reflectance, scene illumination, and sensor characteristics. Although large-scale benchmarks (e.g., ImageNet, COCO) have advanced general-purpose computer vision, illumination is rarely encoded as an explicit, controllable factor [1,2]. This can complicate the study of color recognition in settings where lighting conditions vary across capture environments.
Color constancy research seeks to offset the effects of scene illumination so that the perceived appearance of objects remains consistent across lighting conditions. Widely used benchmark resources—such as the reprocessed Gehler–Shi (ColorChecker) dataset, the NUS 8-Camera dataset, and Intel-TUT—provide calibrated images and standardized evaluation protocols for estimating the illuminant [3,4,5]. However, these datasets primarily target illuminant estimation and classical color-constancy objectives, rather than supervised recognition tasks defined over an explicit joint label space of color × illumination.
A related and persistent concern in computer vision is robustness under distribution shift. Benchmarks such as ImageNet-C and ImageNet-P quantify performance degradation under common corruptions and perturbations [6], while domain generalization literature surveys augmentation- and alignment-based approaches aimed at improving transfer to unseen conditions [7,8]. Because illumination changes are among the most prevalent sources of real-world shift, datasets that treat lighting variation as a first-class annotation are especially valuable for systematic evaluation.
Color-in-Context addresses this need by organizing images into 36 categories (9 colors × 4 illumination conditions). The dataset contributes: (i) a clear directory structure with standardized labels, (ii) dataset-level distribution statistics, (iii) recommended procedures for generating train/validation/test splits over the joint label space, and (iv) reference settings for baseline training and reporting.

3. Dataset Design

3.1. Label Space

Colors (9): Black, Blue, Gray, Orange, Pink, Purple, Skyblue, White, Yellow.
Illuminations (4): fluorescentLight, indoor, indoorNight, sunLight.
Labels are encoded as <Color>/<Illumination>/filename (Figure 1).

3.2. Rationale

The illumination categories reflect common capture environments: typical indoor lighting, fluorescent lighting, indoor scenes at night, and outdoor scenes under sunlight. The color categories are frequent and practically useful; “Skyblue” is retained as a distinct label to match common usage in collected annotations.

3.3. Quality Controls

We applied vocabulary and case validation, perceptual-hash screening for near-duplicate detection, and optional EXIF capture when present. Images are treated as sRGB unless otherwise specified; any color-space conversions should be documented because they may affect chromaticity.

4. Data Summary and Distribution

The dataset exhibits non-uniform sampling across both annotation axes. Table 1 summarizes counts by illumination, Table 2 summarizes counts by color, and Table 3 lists selected joint buckets with notable counts. These summaries document dataset composition and support controlled sampling decisions (e.g., stratified splits) during downstream use. Figure 2 shows example images for each color category under each illumination condition.

5. Data Records

5.1. Access and Organization

The dataset is distributed via Kaggle as a versioned release (v2) at https://www.kaggle.com/datasets/nizamuddinmaitlo/different-colors-in-challenging-lightening-v2. Images are organized using the directory structure <Color>/<Illumination>/filename. Each file belongs to exactly one of the 36 joint categories defined by the cross-product of the nine color labels and four illumination labels.

5.2. Manifest and Metadata

The release may include an optional manifest file (e.g., manifest.csv) listing, for each image, its relative path and labels. Where available, additional fields may include file size and a cryptographic checksum (e.g., SHA-256) to support integrity verification. Optional fields such as image width and height may be included when generated during curation.

5.3. Versioning and Label Normalization

This manuscript describes the Kaggle dataset release labeled v2. A minor label inconsistency was normalized during curation (e.g., sunlight to sunLight); any future changes are tracked through Kaggle’s versioning mechanism and documented on the dataset page.

6. Technical Validation

We performed validation steps focused on label consistency, file integrity, and reduction of near-duplicate content.

6.1. Label Consistency Checks

Directory names and labels were normalized to a fixed vocabulary and case convention. Automated checks verified that each image path matches the expected <Color>/<Illumination>/ pattern and that labels belong to the predefined sets. Deviations (e.g., misspellings, mixed case) were corrected during normalization.

6.2. Duplicate and Near-Duplicate Screening

We applied perceptual-hash screening to identify exact and near-duplicate images within and across buckets. Candidate duplicates were reviewed and removed when appropriate, retaining a single representative instance per duplicated group.

6.3. File Integrity

Where available, checksums provided in the manifest can be used to verify integrity after download. We additionally checked that images are readable and decodable using standard image libraries; files failing decoding or exhibiting corruption were removed or replaced before release.

6.4. Manual Inspection

A manual inspection pass was conducted on a small, randomly sampled subset drawn across multiple buckets to confirm that directory labels correspond to the intended color and illumination tags and to identify obvious annotation errors. Identified inconsistencies were corrected during curation.

7. Usage Notes

7.1. Recommended Splits

For supervised learning experiments, we recommend generating splits stratified over the joint label (color × illumination) to preserve bucket proportions. A practical default is 70/15/15 train/validation/test, with minimum per-bucket counts enforced in validation and test. For illumination-transfer evaluation, users may construct splits that hold out one or more illumination conditions during training (e.g., train on indoor+fluorescentLight and evaluate on sunLight+indoorNight), ensuring that held-out conditions are not used for model selection.

7.2. Metrics and Reporting

We recommend macro-averaged metrics (macro-accuracy and macro-F1) across all 36 buckets, along with per-illumination and per-color breakdowns. Confusion matrices stratified by illumination can be reported. If probabilistic outputs are used, calibration measures such as expected calibration error (ECE) may be included.

7.3. Imbalance-Aware Training

Because bucket counts are not uniform (Table 3), users may consider imbalance-handling strategies such as inverse-frequency weighting at the bucket level, focal loss, or controlled resampling. Any resampling strategy should be documented to preserve reproducibility.

7.4. Data Augmentation Considerations

Geometric augmentation (e.g., flips and crops) is generally compatible with the label space. Photometric augmentation should be used conservatively because strong color jitter can directly alter the target label. If photometric augmentation is applied, users should document parameter ranges and verify that augmentations do not systematically change perceived color categories.

7.5. Reference Model Configurations

Users may evaluate standard architectures such as MobileNetV3, ResNet-18, and ViT-Tiny using ImageNet-pretrained initialization and 224 × 224 inputs. Common regularization choices include early stopping based on a validation metric (e.g., macro-F1) and weight decay in the range 1 × 10 4 to 5 × 10 4 . If class weights are used, bucket-level inverse-frequency weighting is a simple baseline. Augmentation should remain conservative with respect to color labels.

7.6. Reproducible Data Access

We recommend using the provided folder structure and (if present) the manifest file to load data deterministically. When creating derived subsets or splits, saving the corresponding file lists and random seeds supports reproducible experimentation.

8. Ethical Considerations

Perceived color can vary across sensors, devices, and display settings; users should document preprocessing and color-space assumptions. The dataset should be curated to avoid personally identifiable information. Downstream users are encouraged to assess potential contextual leakage (e.g., background correlations) and to document label definitions, noting that color naming may vary across contexts; “Skyblue” is retained as a practical descriptor aligned with collected annotations.

9. Limitations and Future Work

The dataset covers four illumination types and nine color categories, but it does not explicitly control for material properties (e.g., matte vs. glossy), cast shadows, or complex outdoor lighting. Future releases may expand coverage for sunLight, diversify materials and textures, and include additional annotations (e.g., object masks) where feasible.

Code Availability

No additional code is required to use the dataset beyond standard data-loading utilities. The optional manifest file (when included in the release) enables deterministic indexing and integrity verification.

Data Availability Statement

The Color-in-Context dataset is publicly available on Kaggle at https://www.kaggle.com/datasets/nizamuddinmaitlo/different-colors-in-challenging-lightening-v2. The release contains 12,086 RGB images organized by the directory structure <Color>/<Illumination>/filename. Kaggle versioning is used to track updates to the dataset release.

Conflicts of Interest

Not applicable. No funding was received to support this research.

References

  1. Deng, J.; Dong, W.; Socher, R.; Li, L.; Li, K.; Fei-Fei, L. ImageNet: A Large-Scale Hierarchical Image Database. In Proceedings of the Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009. [Google Scholar] [CrossRef]
  2. Lin, T.; Maire, M.; Belongie, S.; Hays, J.; Perona, P.; Ramanan, D.; Dollár, P.; Zitnick, C.L. Microsoft COCO: Common Objects in Context. In Proceedings of the European Conference on Computer Vision (ECCV), 2014. [Google Scholar] [CrossRef]
  3. Shi, L.; Funt, B. Re-processed Version of the Gehler Color Constancy Dataset. Online dataset/technical note 2011. [Google Scholar]
  4. Cheng, D.; Prasad, D.K.; Brown, M.S. The NUS 8-Camera Dataset for Color Constancy. In Proceedings of the Proceedings of the IS&T Color and Imaging Conference (CIC), 2014. [Google Scholar]
  5. Maitlo, N.; Noonari, N.; Ghanghro, S.A.; Duraisamy, S.; Ahmed, F. Color Recognition in Challenging Lighting Environments: CNN Approach. In Proceedings of the 2024 IEEE 9th International Conference for Convergence in Technology (I2CT), 2024; pp. 1–7. [Google Scholar] [CrossRef]
  6. Hendrycks, D.; Dietterich, T. Benchmarking Neural Network Robustness to Common Corruptions and Perturbations. In Proceedings of the International Conference on Learning Representations (ICLR), 2019; p. 1903.12261. [Google Scholar]
  7. Zhou, K.; Yang, Y.; Qiao, Y.; Xiang, T. Domain Generalization: A Survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022. [Google Scholar] [CrossRef]
  8. Wang, J.; Lan, C.; Liu, C.; Ouyang, W.; Qin, T.; Lu, W.; Liu, Z.; Wei, Y. Generalizing from a Few Environments in Domain Generalization. In Proceedings of the International Conference on Machine Learning (ICML), 2021; p. 2107.01636. [Google Scholar]
  9. Buchsbaum, G. A Spatial Processor Model for Object Colour Perception. In Journal of the Franklin Institute; 1980. [Google Scholar] [CrossRef]
  10. Land, E.; McCann, J. Lightness and Retinex Theory. Journal of the Optical Society of America 1971. [Google Scholar] [CrossRef] [PubMed]
  11. Finlayson, G.D.; Trezzi, E. Shades of Gray and Colour Constancy. In Proceedings of the Proc. IS&T Color and Imaging Conference (CIC), Society for Imaging Science and Technology (IS&T), 2004; pp. 37–41. [Google Scholar]
  12. Gershon, R.; Jepson, A.; Tsotsos, J.K. Color Constancy Using Spatio-Temporal Cues. Journal of the Optical Society of America A 1987. [Google Scholar] [CrossRef]
  13. Hu, Y.; Wang, B.; Lin, S. FC4: Fully Convolutional Color Constancy with Confidence-Weighted Pooling. In Proceedings of the Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017; pp. 4085–4094. [Google Scholar]
  14. Lou, Z.; Gevers, T.; Hu, N.; Lucassen, M.P. Color Constancy by Deep Learning. In Proceedings of the Proceedings of the British Machine Vision Conference (BMVC), 2015; pp. 76.1–76.12. [Google Scholar] [CrossRef]
  15. Yendrikhovskij, S.N. Computational Color Categorization. Color Research & Application 2001. [Google Scholar] [CrossRef]
  16. Berlin, B.; Kay, P. Basic Color Terms: Their Universality and Evolution; University of California Press: Berkeley, CA, 1991. [Google Scholar]
  17. Cubuk, E.D.; Zoph, B.; Shlens, J.; Le, Q.V. RandAugment: Practical Automated Data Augmentation with a Reduced Search Space. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), 2020; p. 1909.13719. [Google Scholar]
  18. Hendrycks, D.; Mu, N.; Cubuk, E.D.; Zoph, B.; Gilmer, J.; Lakshminarayanan, B. AugMix: A Simple Data Processing Method to Improve Robustness and Uncertainty. In Proceedings of the International Conference on Learning Representations (ICLR), 2020; p. 1912.02781. [Google Scholar]
  19. Sun, Y.; Wang, X.; Liu, Z.; Miller, J.; Efros, A.A.; Hardt, M. Test-Time Training with Self-Supervision for Generalization under Distribution Shifts. In Proceedings of the Proceedings of the 37th International Conference on Machine Learning (ICML), Online. Vol. 119, pp. 9229–9248.
  20. Ganin, Y.; Lempitsky, V. Unsupervised Domain Adaptation by Backpropagation. Proceedings of the Proceedings of the 32nd International Conference on Machine Learning (ICML), Online. 2015; Vol. 37, pp. 1180–1189. [Google Scholar]
  21. Lee, D. Pseudo-Label: The Simple and Efficient Semi-Supervised Learning Method. In Proceedings of the ICML Workshop on Challenges in Representation Learning, 2013. [Google Scholar]
  22. Sagawa, S.; Koh, P.W.; Hashimoto, T.B.; Liang, P. Distributionally Robust Neural Networks for Group Shifts. In Proceedings of the International Conference on Learning Representations (ICLR), 2020; p. 1911.08731. [Google Scholar]
  23. Guo, C.; Pleiss, G.; Sun, Y.; Weinberger, K.Q. On Calibration of Modern Neural Networks. In Proceedings of the International Conference on Machine Learning (ICML), 2017; p. 1706.04599. [Google Scholar]
  24. Kumar, A.; Sarawgi, U.; Levine, A.; Finn, C.; Liang, P. Verified Uncertainty Calibration. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), 2019; p. 1909.10155. [Google Scholar]
  25. Lin, T.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal Loss for Dense Object Detection. In Proceedings of the Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2017. [Google Scholar] [CrossRef]
  26. Cui, Y.; Jia, M.; Lin, T.; Song, Y.; Belongie, S. Class-Balanced Loss Based on Effective Number of Samples. In Proceedings of the Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019; p. 1901.05555. [Google Scholar] [CrossRef]
Figure 1. Folder hierarchy used to encode the joint label space. Each image belongs to exactly one <Color>/<Illumination> bucket.
Figure 1. Folder hierarchy used to encode the joint label space. Each image belongs to exactly one <Color>/<Illumination> bucket.
Preprints 206629 g001
Figure 2. (a: fluorescentLight, b: indoor, c: indoorNight, d: sunLight): example images for all nine color categories under four illumination conditions.
Figure 2. (a: fluorescentLight, b: indoor, c: indoorNight, d: sunLight): example images for all nine color categories under four illumination conditions.
Preprints 206629 g002
Table 1. Counts by illumination condition.
Table 1. Counts by illumination condition.
Illumination Count Percent
indoor 3,342 27.65%
indoorNight 3,337 27.61%
fluorescentLight 2,985 24.70%
sunLight 2,422 20.04%
Table 2. Counts by color.
Table 2. Counts by color.
Color Count Percent
Orange 2,323 19.22%
Pink 1,995 16.51%
Black 1,674 13.85%
Blue 1,205 9.97%
Purple 1,194 9.88%
Gray 1,128 9.33%
White 882 7.30%
Yellow 845 6.99%
Skyblue 840 6.95%
Table 3. Selected bucket counts (color × illumination).
Table 3. Selected bucket counts (color × illumination).
Bucket Count Note
Orange / indoorNight 1,237 Largest Orange subset
Pink / indoor 912 Large indoor subset
Gray / sunLight 461 Relatively high sunLight subset
Skyblue / (all) 210 each Approximately uniform across conditions
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2026 MDPI (Basel, Switzerland) unless otherwise stated