(untitled) (Al-Farooq Journal of Sciences, 2026)
Real-time monitoring of drinking water quality remains a critical challenge, particularly in remote and resource-constrained environments where traditional infrastructure fails to provide continuous and efficient surveillance. This paper presents the design and implementation of a lightweight machine learning (ML) model capable of classifying water potability for human consumption with reasonable accuracy, while ensuring deployability on low-power edge devices. The proposed methodology leverages the "Water Potability" dataset from Kaggle, comprising 3,276 samples and 10 physicochemical features. Data quality challenges were addressed through median imputation for missing values and the SMOTE algorithm for class distribution balancing. A compact sequential neural network architecture was designed, consisting of three dense layers (32→16→8 neurons) enhanced with advanced regularization techniques (L2 regularization, BatchNormalization, Dropout) to mitigate overfitting. To optimize computational efficiency, the model was converted to TensorFlow Lite format with post-training INT8 quantization. Experimental results on the held-out test set (n=656) demonstrated a classification accuracy of 61.13%, an F1-score of 51.80%, and a ROC-AUC of 65.69%. Most significantly from a deployment perspective, the model size was compressed from 59.47 KB to merely 6.07 KB—a 9.8× compression ratio—making it suitable for deployment on microcontrollers such as ESP32, Arduino Nano 33 BLE, and Raspberry Pi Pico. This study validates the feasibility of employing lightweight, quantized AI models for field-based environmental monitoring applications, where a deliberate trade-off between classification accuracy and resource efficiency is managed. The findings represent a practical step toward autonomous, low-cost early-warning systems for water contamination detection, while opening avenues for future research in temporal data fusion, federated learning, and hardware-aware quantization.