In semi-arid regions, sustainable groundwater management for irrigation is critical for agricultural productivity and food security. This study presents an integrated methodological framework combining hydrochemical characterization, machine learning (ML) modeling, and explainable artificial intelligence (XAI) to predict the Irrigation Water Quality Index (IWQI) in the Ain Oussera plain, Djelfa Province, Algeria. A total of 191 groundwater samples were collected from November 2023 to September 2024 and analyzed for major ions and physicochemical parameters. Multiple irrigation suitability indices were calculated, including Sodium Adsorption Ratio (SAR), Sodium Percentage (Na%), Magnesium Hazard (MH), Permeability Index (PI), Residual Sodium Carbonate (RSC), Soluble Sodium Percentage (SSP), and Kelly’s Ratio (KR). Five ML models were developed and evaluated for IWQI prediction: Random Forest, Gradient Boosting, XGBoost, K-Nearest Neighbors, and Support Vector Regression. Results showed that 55% of groundwater samples exhibited low to no restrictions for irrigation use, while 19% required high to severe restrictions. The XGBoost model demonstrated superior performance, with the highest R2 (0.95) and the lowest RMSE (3.22) among all tested algorithms. SHAP (SHapley Additive exPlanations) analysis provided a transparent interpretation of model predictions, identifying electrical conductivity and Sodium Adsorption Ratio as the most influential parameters affecting IWQI, while chloride, sodium, total hardness, and magnesium had minimal impact. Spatial mapping using Inverse Distance Weighting (IDW) interpolation in ArcGIS 10.8 revealed considerable spatial variability in water quality throughout s the plain. This research addresses a critical gap in North African groundwater management by integrating ML predictive capabilities with XAI transparency, providing water resource managers and agricultural stakeholders with interpretable, data-driven tools for sustainable irrigation planning in water-stressed semi-arid environments.
Azlaoui et al. (Fri,) studied this question.