Machine learning–driven groundwater quality classification using physicochemical parameters and regulatory thresholds
摘要
Groundwater contamination poses a critical challenge to public health and environmental sustainability, particularly in rapidly urbanizing regions. Ensuring safe groundwater access is central to global sustainable development priorities; however, conventional laboratory-based assessments are often time-consuming and resource-intensive. This study presents a machine learning–driven framework for rapid groundwater quality classification based on physicochemical parameters. Unlike existing studies that primarily emphasize predictive modeling, the proposed approach introduces an end-to-end, regulation-driven decision-support framework integrating guideline-based labeling, machine learning classification, and real-time deployment with treatment recommendations. The analysis utilized 5006 groundwater records obtained from the National Water Quality Monitoring Programme (NWMP) of the Central Pollution Control Board (CPCB), India, covering 2018–2022 and representing diverse urban and rural hydrogeological settings across multiple Indian states. Key water quality indicators—pH, total dissolved solids (TDS), nitrate, biological oxygen demand (BOD), and total coliform counts—were selected based on drinking-water regulatory relevance. Samples were categorized into Acceptable, Needs Treatment, and Hazardous classes using CPCB guideline thresholds. Exploratory data analysis identified dominant factors influencing groundwater quality. Multiple supervised learning algorithms, including XGBoost, Random Forest, Support Vector Machines, and Logistic Regression, were evaluated. XGBoost achieved the best performance, with an accuracy of 99.40%, an F1-score of 0.994, and a ROC-AUC of 0.9998. Model robustness was assessed through cross-validation and class-wise performance analysis, confirming stable predictions under varying hydrochemical conditions. A Gradio-based web interface enables real-time groundwater quality classification and treatment guidance. Overall, the proposed workflow provides a scalable and user-friendly tool to support sustainable groundwater governance and water security initiatives.