Comparison of Color Space Performance for Colorimetric Detection of Heavy Metals in Drinking Water Using Image Processing and Convolutional Neural Networks
Main Article Content
Abstract
Heavy metal contamination in drinking water, including arsenic, lead, cadmium, iron, copper, and manganese, is an environmental issue that adversely affects human health and ecosystems. Although standard laboratory methods provide high accuracy, they are limited by cost, time, and operational complexity. This study aimed to develop and compare the performance of eight color spaces (RGB, RGBA, Grayscale, GrayscaleA, CIE LAB, CIE LABA, HSV, HSVA) for classifying heavy metal concentration levels from microplate images using image processing techniques combined with a Convolutional Neural Network (CNN), and to select the optimal color space using the Weighted Sum Model. The dataset comprised images of six types of heavy metals, with 368,000 images after preprocessing and data augmentation. The model was trained using K-Fold Cross Validation (K=5). Experimental results showed that the HSVA color space achieved the best performance (Accuracy 99.65%, Loss 0.01382, Training Time 1,606 seconds). When tested on a separate set of 920 images, the model maintained an accuracy of 99.0%, indicating stability and strong practical applicability. The findings confirm that selecting an appropriate color space in conjunction with a CNN significantly improves the accuracy of heavy metal analysis on test datasets and has strong potential for further development into a portable, low-cost analytical tool for field applications.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
References
Yang, Y.; Li, Y.; Wang, X.; Li, J.; Chen, W. The Gut Microbiota and Chronic Inflammation Induced by Heavy Metals: A Review. Ecotoxicol. Environ. Saf. 2023, 254, 114720. https://doi.org/10.1016/j.ecoenv.2023.114720
Jaishankar, M.; Tseten, T.; Anbalagan, N.; Mathew, B. B.; Beeregowda, K. N. Toxicity, Mechanism and Health Effects of Some Heavy Metals. Interdiscip. Toxicol. 2014, 7(2), 60–72. https://doi.org/10.2478/intox-2014-0009
Bansod, B. K.; Kumar, T.; Thakur, R.; Rana, S.; Singh, I. A Review on Various Electrochemical Techniques for Heavy Metal Ions Detection with Different Sensing Platforms. Microchem. J. 2017, 133, 502–512. https://doi.org/10.1016/j.microc.2017.03.025
Fakayode, S. O.; Walgama, C.; Fernand Narcisse, V. E.; Grant, C. Electrochemical and Colorimetric Nanosensors for Detection of Heavy Metal Ions: A Review. Sensors 2023, 23(22), 9080. https://doi.org/10.3390/s23229080
Taithong, P.; Wichai, S.; Waranusast, R.; Riyamongkol, P. Image-Based Automatic Counting of Bacillus cereus Colonies Using Smartphone. Int. J. Adv. Comput. Sci. Appl. 2022, 13(2), 627–634. http://dx.doi.org/10.14569/IJACSA.2022.0130274
Chunta, S.; Phongthai, S.; Jarujamrus, P. Simple Colorimetric Assay Using Pectin Hydrogel Reagent Coupled with Camera-Based Photometry for Trace Arsenic Determination. Anal. Bioanal. Chem. 2023, 415, 4603–4614. https://doi.org/10.1007/s00216-023-04762-z
Ahmad, N.; Singh, S.; AlAjmi, M. F.; Hussain, A.; Raza, K. CropGCNN: Color Space-Based Crop Disease Classification Using Group Convolutional Neural Network. PeerJ Comput. Sci. 2024, 10, e2136. https://doi.org/10.7717/peerj-cs.2136
Aydın Atasoy, N.; Kura, İ. Classification of X-ray and CT Images in Different Color Spaces Using Robust CNN. J. Eng. Sci. Des. 2024, 12(3), 505–516. https://doi.org/10.21923/jesd.1415150
Haikal, A. L. A.; Yudistira, N.; Ridok, A. Comprehensive Mixed-Based Data Augmentation for Detection of Rice Leaf Disease in the Wild. SSRN 2024. https://doi.org/10.2139/ssrn.4705403
Liu, X. Evaluating the Impact of Data Augmentation on Explainable AI in Medical Image Analysis; Master’s Thesis, Eindhoven University of Technology, Eindhoven, The Netherlands, 2024.
Taha, M.; Safaa, M. Impact of Colour Space Transformation on Smoke Detection Accuracy Using ResNet50. Infotech Spectrum: Iraqi J. Data Sci. 2025, 2(1), 37–49.
Xian, Z.; Huang, R.; Towey, D.; Yue, C. Convolutional Neural Network Image Classification Based on Different Color Spaces. Tsinghua Sci. Technol. 2025, 30(1), 402–417. https://doi.org/10.26599/TST.2024.9010001
Satrya, G. B.; Ramatryana, I. N. A.; Shin, S. Y. Compressive Sensing of Medical Images Based on HSV Color Space. Sensors 2023, 23, 2616. https://doi.org/10.3390/s23052616.
Frincu, R. M. Artificial Intelligence in Water Quality Monitoring: A Review of Water Quality Assessment Applications. Water Qual. Res. J. 2025, 60(1), 164–176. https://doi.org/10.2166/wqrj.2024.049
Olawade, D. B.; Wada, O. Z.; Ige, A. O.; Egbewole, B. I.; Olojo, A.; Oladapo, B. I. Artificial Intelligence in Environmental Monitoring: Advancements, Challenges, and Future Directions. Hyg. Environ. Health Adv. 2024, 12, 100114. https://doi.org/10.1016/j.heha.2024.100114
Budiharjo; Windarto, A. P.; Muhammad, A. Comparison of Weighted Sum Model and Multi Attribute Decision Making Weighted Product Methods in Selecting the Best Elementary School in Indonesia. Int. J. Softw. Eng. Its Appl. 2017, 11(4), 69–90. http://dx.doi.org/10.14257/ijseia.2017.11.4.06.
Ouchra, H.; Belangour, A. Object Detection Approaches in Images: A Weighted Scoring Model Based Comparative Study. Int. J. Adv. Comput. Sci. Appl. 2021, 12(8), 268–275. http://dx.doi.org/10.14569/IJACSA.2021.0120831
Chunta, S. Development of the Hydrogel-Based Reagent Field Test Kit for Screening Heavy Metal in Water Coupled with Smartphone-Based Colorimetric Analyzer; Research Report, Agricultural Research Development Agency (Public Organization): Bangkok, Thailand, 2021.
Nasritha, K.; Kerdprasop, K.; Kerdprasop, N. Comparison of Sampling Techniques for Imbalanced Data Classification. J. Appl. Inform. Technol. 2018, 1(1), 20–37. https://doi.org/10.14456/jait.2018.2