Sustainable aquaculture relies on continuous monitoring and accurate prediction of water quality parameters to ensure optimal aquatic health and maximize production. Conventional monitoring often relies on discrete sampling, which fails to develop the dynamic interdependencies among critical physicochemical parameters. This study addresses this gap by developing machine learning (ML) models using an openly available water quality dataset collected from a fish pond in Khulna, Bangladesh[1].
We investigated the relationship among three fundamental parameters by employing machine learning techniques to predict pH from water temperature and turbidity measurements. The dataset was acquired using an Arduino Mega-based monitoring system integrated with digital sensors installed at a water depth of 30 cm. Temperature, pH, and turbidity were measured simultaneously at approximately one-minute intervals over a continuous seven-day period (15–22 January 2020), generating a dataset of 9,623 measurements for model development. During the monitoring period, water temperature ranged from 15.6 to 23.8°C, turbidity ranged from 194 to 249 NTU, and pH ranged from 6.98 to 8.43. The collected dataset was preprocessed, divided into the training and testing subsets (80/20), and evaluated using the coefficient of determination (R²), mean absolute error (MAE), and root mean square error (RMSE). Model validation and feature importance analyses were also conducted to assess prediction reliability and quantify the influence of individual input variables.
We applied K-Nearest Neighbors (KNN) Regressor, Random Forest (RF), Gradient Boosting (GB), and Support Vector Regression (RBF) models to the processed datasets. We found that the ML models can effectively learn the nonlinear relationships and temporal patterns within the water quality parameters, offering a robust framework for near-real-time forecasting and anomaly detection. We evaluated ML frameworks and found strong regression performance with the GB (87%, RMSE 0.15), KNN Regressor (95%, RMSE 0.09), SVR (RBF) (69%, RMSE 0.24), and RF (97%, RMSE 0.11) models. We also found that turbidity is the most influential parameter affecting the pH in the water.
[1] Arafat, A. I.; Akter, T.; Ahammed, M. F.; Ali, M. Y.; Nahid, A. A. Data in Brief, 2020, 33, 106457.