In collaboration Iranian Hydraulic Association

Application of Machine Learning in Sustainable Qanat Management: Qanat Discharge Estimation Using the Random Forest Algorithm and Sensitivity Analysis (SHAP and Permutation Importance) in Qaen Plain

Document Type : Original Article

Authors

Department of Water Engineering, Faculty of Agriculture, University of Birjand, Birjand, Iran.

Abstract
Arid and semi-arid regions of Iran, particularly the Qaen Plain in South Khorasan Province, face severe water resource limitations. Qanats, as traditional sustainable water supply systems with over 3,000 years of history, play a vital role in local agriculture and livelihoods. However, accurately estimating their discharge is challenging due to climate change impacts and data limitations. This study employs the Random Forest (RF) algorithm—a powerful machine learning method—to estimate qanat discharges in the Qaen Plain using 12 years of data (2007–2018 CE). Input variables included historical observed discharges, mean temperature, monthly precipitation, and elevation of each qanat. After preprocessing (normalization and missing data imputation), the dataset was split into training (70%) and testing (30%) sets. The model was trained with optimized hyperparameters (max_depth=10, max_features=0.5, min_samples_split=5, n_estimators=500). Results showed strong performance: RMSE = 4.27 L/s, NSE = 0.54, r = 0.76, KGE = 0.51, and NRMSE = 15.19%. Sensitivity analysis using SHAP and Permutation Importance identified elevation as the key variable (mean |SHAP| = 2.16), while precipitation exhibited a slight negative influence (SHAP = -0.013). These findings validate RF's efficacy and provide a practical framework for water resource management in arid regions.

Keywords

Subjects

Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5-32. https://doi.org/10.1023/A:1010933404324
Dastourani, M., Mamirabadizadeh, M., & Mohammadie, K. (2025). The Impact Assessment of Changes in Agricultural Cropping Patterns on the Quantitative Status of Groundwater Resources in the Qaen Plain Aquifer Using the MODFLOW Model. Iranian Journal of Irrigation & Drainage, 19(4), 537-554. [In Persian]
Farzaneh, M. and Banimostafaarab, F. (2025). Qanat and climate resilience Investigating the climate legislations in developing countries from disaster risk management perspective. Journal of Aquifer and Qanat, 6(1), 67-86. https://doi.org/10.22077/jaaq.2025.8869.1097. [In Persian]
Foruzanmehr, M. and Khozeymehnezhad, H. (2023). Investigation of spatial and temporal changes of qualitative parameters of Qaen plain aquifer using interpolation methods. Journal of Aquifer and Qanat, 4(1), 1-15. https://doi.org/10.22077/jaaq.2023.5130.1045. [In Persian]
Hejazi, A., & Marzbani, M. (2015). Estimation of maximum runoff height and discharge using curve number method case study: Sarab Darehshahr Watershed. Hydro Geomorphol, 2(5), 63-81.
Kratzert, F., Klotz, D., Shalev, G., Klambauer, G., Hochreiter, S., & Nearing, G. (2019). Towards learning universal, regional, and local hydrological behaviors via machine learning applied to large-sample datasets. Hydrology and Earth System Sciences, 23(12), 5089-5110. https://doi.org/10.5194/hess-23-5089-2019
Maghrebi, M., Noori, R., Sadegh, M., Sarvarzadeh, F., Akbarzadeh, A. E., Karandish, F.,... & Taherpour, H. (2023). Anthropogenic decline of ancient, sustainable water systems: qanats. Groundwater, 61(1), 139-146. https://doi.org/10.1111/gwat.13248
Norouzi Qoshblagh, H., & Naderi, A. (2018). Prediction of groundwater level in the Bukan plain using fuzzy logic, random forest, and neural network models. Journal of Range and Watershed Management, 71(3), 829-845. https://doi.org/10.22059/jrwm.2018.68924. [In Persian]
Prieto, C., Le Vine, N., Kavetski, D., García, E., & Medina, R. (2019). Flow prediction in ungauged catchments using probabilistic random forests regionalization and new statistical adequacy tests. Water Resources Research, 55(5), 4364-4392. https://doi.org/10.1029/2018WR023254
Ramezani Feriz, A. H. and Ramezani, Y. (2025). Evaluation of the accuracy of artificial intelligence models in predicting qanat discharge in arid and semi-arid regions (Case study: Qaen Plain). Journal of Aquifer and Qanat, (), . https://doi.org/ 10.22077/jaaq.2025.10072.1124. [In Persian]
Rezaeian-Zadeh, M., Tabari, H., & Abghari, H. (2013). Prediction of monthly discharge volume by different artificial neural network algorithms in semi-arid regions. Arabian Journal of Geosciences, 6(7), 2529-2537. https://doi.org/10.1007/s12517-011-0517-y
Samani, S., Vadiati, M., Kisi, O., Ghasemi, L., & Farajzadeh, R. (2024). Qanat discharge prediction using a comparative analysis of machine learning methods. Earth Science Informatics, 17(5), 4597-4618. https://doi.org/10.1007/s12145-024-01409-0
Sedghi, M. M., & Zhan, H. (2024). Discharge variations of the qanat near an ephemeral stream. Journal of Hydrology, 637, 131367. https://doi.org/10.1016/j.jhydrol.2024.131367
Tang, T., Liang, Z., Hu, Y., Li, B., & Wang, J. (2020). Research on flood forecasting based on flood hydrograph generalization and random forest in the Qiushui River basin, China. Journal of Hydroinformatics, 22(6), 1588-1602. https://doi.org/10.2166/hydro.2020.147
UNESCO World Heritage Centre. (2016). Persian Qanat. Retrieved from https://whc.unesco.org/en/list/1506