Forecasting short-term rainfall patterns in arid and semi-arid regions using machine learning and deep learning models: a case study from Morocco

Morocco's oases, critical agroecological systems in arid regions, face escalating water scarcity due to climate variability, groundwater depletion, and a historic decline in palm groves from 15 million to 4 million trees over the past century. This study introduces a machine learning (ML)-based precipitation forecasting framework to enhance water resource management in four semi-arid Moroccan regions: Errachidia, Figuig, Tata, and Zagora. Leveraging a 1981-2025 dekadal rainfall dataset from the Climate Hazards Group InfraRed Precipitation with Station data (CHIRPS v2), we developed and compared four ML models: XGBoost, CatBoost, Long Short-Term Memory (LSTM), and Temporal Convolutional Network (TCN). CatBoost emerged as the most effective, achieving a testing \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\varvec{R<^>2}$$\end{document} of 0.9818 and a mean squared error (MSE) of 0.5430 mm\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$<^>2$$\end{document} on historical data (2019-2025), and a fine-tuned 90-day forecast (March 5-June 3, 2025) with \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\varvec{R<^>2}$$\end{document} of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\varvec{0.985 \pm 0.002}$$\end{document} and MSE of 0.3364 mm\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$<^>2$$\end{document}. Historical trends revealed declining precipitation post-2015, underscoring the need for predictive tools. These findings demonstrate CatBoost's superior ability to capture nonlinear rainfall dynamics, offering a scalable solution for climate-resilient water management in water-scarce regions. However, challenges such as data sparsity and model interpretability highlight the need for enhanced observational networks and explainable AI approaches to maximize practical adoption.

关键词