Water supplies contaminated by heavy metals pose a serious threat to human health, especially in areas without access to centralized testing facilities. While copper is a necessary heavy metal in trace levels, high concentrations can have detrimental effects on health, such as oxidative stress, cognitive impairment, and liver damage. Due to their expense, complexity, and reliance on laboratories, conventional detection tech-niques are accurate but unsuitable for real-time, dispersed deployment. Machine learning offers a potent solution to these constraints by facilitating the automatic, pre-cise, and quick interpretation of complicated sensor data. It makes it possible to make decisions in real time without requiring a large laboratory infrastructure.
In this work a dual-mode optical sensor was developed using the colorimetry and fluorometry images of carbon dots embedded in hydrogels with the Cu2+ concentration of 0, 20, 50, 100, 200, and 500 μM. Data augmentation was used to expand the RGB picture dataset for each modality, and these data were interpolated to provide re-sponses at 1 µM intervals (0–500 µM). We trained a comprehensive set of supervised machine learning models including Logistic Regression, Support Vector Machines, Random Forest, and XGBoost to categorize water samples into five risk-informed quality levels. The system achieved classification accuracies exceeding 96%. Further-more, we built a simple user interface to make the system practically deployable in mobile phone. Together, these results demonstrate a scalable, interpretable, cost-effective, and quick solution for real-time water quality monitoring in re-source-constrained environments.