Water quality assessment is essential for determining whether water is suitable for human consumption and enabling informed decision-making regarding water resources. Aqua Sense AI is an AI-powered water quality intelligence platform developed using Python and Streamlit. The system provides a preliminary classification of water samples as Safe (Potable) or Unsafe (Non-Potable) based on nine physicochemical parameters: pH, Hardness, Total Dissolved Solids (TDS), Chloramines, Sulfate, Conductivity, Organic Carbon, Trihalomethanes, and Turbidity.
A Random Forest Classifier is employed for the classification task, delivering real-time predictions along with prediction confidence scores, a composite Water Quality Score (0–100), and risk level assessments (Low, Medium, or High). Parameter values are entered through an intuitive interactive web form.
The platform features an Analytics Dashboard powered by interactive Plotly visualizations, Explainable Artificial Intelligence (XAI) providing feature importance rankings and natural language reasoning, dynamic parameter-specific water treatment recommendations, and session-based prediction history tracking. Designed in alignment with UN Sustainable Development Goal 6 (Clean Water and Sanitation), the system serves as a preliminary decision-support tool and does not replace certified laboratory testing. Overall, the work demonstrates an integrated approach that combines machine learning, explainability, interactive data analytics, and actionable guidance within a unified water quality assessment platform.
Introduction
The text presents Aqua Sense AI, an artificial intelligence-based water quality assessment platform developed using Python, Streamlit, and a Random Forest machine learning classifier. The system aims to address the limitations of traditional water quality testing, which often requires expensive laboratory facilities, specialized expertise, and considerable time to produce results. Increasing water pollution caused by industrial discharge, agricultural runoff, urbanization, and climate change highlights the need for accessible and efficient water monitoring solutions.
Aqua Sense AI evaluates nine physicochemical parameters: pH, Hardness, Total Dissolved Solids (TDS), Chloramines, Sulfate, Electrical Conductivity, Total Organic Carbon (TOC), Trihalomethanes (THMs), and Turbidity. Using these parameters, the trained Random Forest model predicts whether a water sample is Safe or Unsafe for drinking, provides probability-based confidence estimates, and identifies complex relationships among water quality indicators. The system is designed to achieve an estimated classification accuracy of approximately 92% and an inference time below 100 milliseconds, as reported in the project description.
Beyond binary classification, the platform incorporates a composite Water Quality Score ranging from 0 to 100 and categorizes samples into Low, Medium, and High risk levels. It also integrates Explainable Artificial Intelligence (XAI) to identify important parameters influencing predictions and provide understandable explanations. An automated recommendation engine suggests suitable water treatment and remediation measures based on detected parameter deviations.
The application features an interactive Plotly analytics dashboard for visualizing water quality distributions, prediction outcomes, and parameter trends. Session-based prediction history and reporting functions further support monitoring and decision-making.
The literature review identifies limitations in conventional Water Quality Index methods, including their difficulty in representing nonlinear interactions and the possibility that a serious contaminant may be masked by otherwise acceptable measurements. Although machine learning techniques such as Logistic Regression, Naive Bayes, Support Vector Machines, and neural networks have been explored, Random Forest is selected for its robustness, ability to model complex relationships, resistance to overfitting, and feature importance capabilities.
The research addresses four major gaps in existing solutions: limited model interpretability, reliance on binary classifications, insufficient actionable remediation guidance, and lack of accessible web-based deployment. Accordingly, the study investigates classification performance, multidimensional scoring, model transparency, recommendation effectiveness, and system efficiency.
The proposed architecture consists of four main components: input validation, machine learning prediction, quality scoring and risk stratification, and explainability with remediation and analytics. It uses international drinking water guidelines as reference points for evaluating measured parameters. However, its predictions and composite scores are intended for preliminary screening rather than as substitutes for certified laboratory testing.
Overall, Aqua Sense AI provides an integrated, accessible, and explainable decision-support framework for preliminary water quality assessment. By combining machine learning, risk evaluation, visual analytics, and treatment recommendations, the platform supports more informed water management and contributes to United Nations Sustainable Development Goal 6 (Clean Water and Sanitation), particularly Targets 6.1 and 6.3.
Conclusion
This paper presented Aqua Sense AI, an explainable, machine-learning-driven water quality intelligence platform developed using Python and Streamlit. The platform bridges the divide between theoretical computational models and practical public health decision-support by providing an integrated pipeline that evaluates water potability across nine essential physicochemical indicators.
By employing an ensemble Random Forest Classifier, the system achieves a strong classification accuracy of 92.0% and an F1-score of 0.910, significantly outperforming linear and single-tree baselines. To overcome the limitations of rigid binary classification and black-box models, Aqua Sense AI introduces a continuous 100-point Water Quality Score (r = 0.914 correlation with chemical degradation severity), a three-tier risk stratification system (Low, Medium, High), and Explainable Artificial Intelligence (XAI) feature importance rankings that identify the biochemical drivers behind contamination predictions.
Furthermore, the platform translates analytical predictions into actionable water purification recommendations, renders interactive Plotly visualizations, and logs prediction history within a responsive interface operating at sub-60 millisecond latency.
Grounded in the targets of United Nations Sustainable Development Goal 6 (Clean Water and Sanitation), Aqua Sense AI demonstrates the viability of transparent, lightweight, and accessible machine learning architectures for rapid environmental monitoring and preliminary public health decision support.
References
[1] Breiman, L. (2001). Random forests. Machine Learning, Vol. 45, No. 1, pp. 5–32. DOI: 10.1023/A:1010933404324.
[2] United Nations. (2015). Transforming Our World: The 2030 Agenda for Sustainable Development (Goal 6: Ensure availability and sustainable management of water and sanitation for all). A/RES/70/1. United Nations General Assembly.
[3] Horton, R. K. (1965). An index number system for rating water quality. Journal of the Water Pollution Control Federation, Vol. 37, No. 3, pp. 300–306.
[4] Brown, R. M., McClelland, N. I., Deininger, R. A., and Tozer, R. G. (1970). A water quality index—do we dare? Water and Sewage Works, Vol. 117, No. 10, pp. 339–343.
[5] Canadian Council of Ministers of the Environment (CCME). (2001). Canadian Water Quality Index 1.0: Technical Report. In Canadian Environmental Quality Guidelines. CCME, Winnipeg.
[6] Tyagi, S., Sharma, B., Singh, P., and Dobhal, R. (2013). Water quality assessment in terms of water quality index. American Journal of Water Resources, Vol. 1, No. 3, pp. 34–38. DOI: 10.12691/ajwr-1-3-3.
[7] World Health Organization (WHO). (2022). Guidelines for Drinking-water Quality: Fourth Edition Incorporating the First and Second Addenda. Geneva: World Health Organization. ISBN: 978-92-4-004506-4.
[8] United States Environmental Protection Agency (US EPA). (2020). National Primary Drinking Water Regulations: Maximum Contaminant Levels and Treatment Techniques. EPA 816-F-09-004. Washington, D.C.: EPA Office of Water.
[9] Lundberg, S. M. and Lee, S.-I. (2017). A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems (NeurIPS 2017), Vol. 30, pp. 4765–4774.
[10] Ahmed, U., Mumtaz, R., Anwar, H., Shah, A. A., Irmak, R., and Singik, M. S. (2019). Efficient water quality prediction using supervised machine learning. Water, Vol. 11, No. 11, Article 2210, pp. 1–14. DOI: 10.3390/w11112210.