Groundwater Nitrate Modelling Using Optimized Machine Learning, Feature Selection and Explainable Artificial Intelligence (XAI)

Groundwater nitrate contamination has become an important concern due to its adverse effects on groundwater quality and human health. Therefore, developing reliable prediction models is necessary for estimating nitrate concentrations and supporting groundwater quality monitoring. In this study, machine learning models integrated with optimization algorithms were developed for predicting groundwater nitrate concentrations in Telangana, India. A total of 368 observations obtained from a secondary dataset available on Kaggle, representing post-monsoon conditions in 2020, were used for the analysis. Four input-variable configurations (C1–C4) were considered to examine the effect of different combinations of hydrochemical parameters on model performance. Furthermore, Random Forest-based feature selection was applied to determine the relative importance of the input variables. The Bagged Trees (BT) model was subsequently optimized using the Educational Competition Optimizer (ECO) and Firefly Algorithm (FA). In addition, SHapley Additive exPlanations (SHAP) was employed to explain the contribution of the input variables to the model predictions. Model performance was evaluated using the coefficient of determination (R2), ratio of performance to interquartile distance (RPIQ) and relative absolute error (RAE) during the training and testing stages. Five-fold cross-validation was also considered for model evaluation. The results showed that configuration C4 provided the best performance among the conventional BT models and was therefore selected for further optimization. The optimized BT-FA-C4 model produced the best testing results, with R2, RPIQ and RAE values of 0.983, 10.256 and 0.086, respectively. Similarly, the BT-ECO-C4 model achieved R2, RPIQ and RAE values of 0.949, 8.060 and 0.097, respectively. Moreover, SHAP analysis provided further information on the relative contributions of the hydrochemical parameters to groundwater nitrate predictions. Based on these results, the integration of feature selection, optimization algorithms and explainable machine learning provides a useful approach for predicting groundwater nitrate concentrations from hydrochemical data.

Authors

Institutions

Publication Details

Journal
Nitrogen
Published
2026-11-17
DOI
https://doi.org/10.3390/nitrogen7040139
Primary Topic
Water Quality and Pollution Assessment
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Groundwater Nitrate Modelling Using Optimized Machine Learning, Feature Selection and Explainable Artificial Intelligence (XAI)

Abdullahi Garba Usman
4 links
Nitrogen
Water Quality and Pollution Assessment
article

Groundwater Nitrate Modelling Using Optimized Machine Learning, Feature Selection and Explainable Artificial Intelligence (XAI)

Abdullahi Garba Usman
article en

Abstract

Groundwater nitrate contamination has become an important concern due to its adverse effects on groundwater quality and human health. Therefore, developing reliable prediction models is necessary for estimating nitrate concentrations and supporting groundwater quality monitoring. In this study, machine learning models integrated with optimization algorithms were developed for predicting groundwater nitrate concentrations in Telangana, India. A total of 368 observations obtained from a secondary dataset available on Kaggle, representing post-monsoon conditions in 2020, were used for the analysis. Four input-variable configurations (C1–C4) were considered to examine the effect of different combinations of hydrochemical parameters on model performance. Furthermore, Random Forest-based feature selection was applied to determine the relative importance of the input variables. The Bagged Trees (BT) model was subsequently optimized using the Educational Competition Optimizer (ECO) and Firefly Algorithm (FA). In addition, SHapley Additive exPlanations (SHAP) was employed to explain the contribution of the input variables to the model predictions. Model performance was evaluated using the coefficient of determination (R2), ratio of performance to interquartile distance (RPIQ) and relative absolute error (RAE) during the training and testing stages. Five-fold cross-validation was also considered for model evaluation. The results showed that configuration C4 provided the best performance among the conventional BT models and was therefore selected for further optimization. The optimized BT-FA-C4 model produced the best testing results, with R2, RPIQ and RAE values of 0.983, 10.256 and 0.086, respectively. Similarly, the BT-ECO-C4 model achieved R2, RPIQ and RAE values of 0.949, 8.060 and 0.097, respectively. Moreover, SHAP analysis provided further information on the relative contributions of the hydrochemical parameters to groundwater nitrate predictions. Based on these results, the integration of feature selection, optimization algorithms and explainable machine learning provides a useful approach for predicting groundwater nitrate concentrations from hydrochemical data.

NitrogenVol. 7(4)
Near East University (CY)
Clean water and sanitation
Water Quality and Pollution Assessment
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon