Spatiotemporal prediction of soil moisture content at various depths in three soil types using machine learning algorithms - Alahmad, Tarek; Neményi, Miklós; Széles, Adrienn; Ali, Nour; Hijazi, Omar; Nyéki, Anikó (Frontiers in Soil Science, 2025)
IntroductionAccurate prediction of soil moisture content (SMC) is crucial for agricultural systems as it affects hydrological cycles, crop growth, and resource management. Considering the challenges with prediction accuracy and determining the effect of soil texture, depth, and meteorological data on SMC variation and prediction capability of the used models, this research has been conducted.MethodsThree machine learning (ML) models—random forest regression (RFR), eXtreme gradient boosting (XGBoost), and long short-term memory (LSTM)—were developed to predict SMC in three soil types (loam, sandy loam, and silt loam) at five depths of 5, 20, 40, 60, and 80 cm. The dataset was collected during the maize season in 2023, encompassing meteorological parameters collected using Internet of Things (IoT)-based sensors and SMC data calculated using the gravimetric method.ResultsThe results showed variations in SMC in all studied soil types and depths, with silt loam exhibiting the highest variation in SMC. RFR demonstrated high accuracy at different depths and soil types, particularly in loam soil, at a depth of 80 with a root mean square error (RMSE) value of 0.89 and a mean absolute error (MAE) value of 0.74, and in silt loam at 40 cm depth with an RMSE value of 0.498 and an MAE of 0.416. LSTM performed effectively at shallower and moderate depths (60 and 20 cm) with RMSE values of 0.391 and 0.804 and MAE values of 0.335 and 0.793, respectively. In sandy loam soil at 5 cm depth, XGBoost displayed minimal errors and robust performance at the same depths with higher accuracy, achieving an RMSE of 0.025 and an MAE of 0.159. Analysis of training and validation loss revealed that the LSTM model stabilized and improved with more epochs, showing a more consistent decrease in MSE, while RFR and XGBoost exhibited higher performance with increased model complexity, shown in low MSE and RMSE values. Comparisons between measured and predicted SMC% values demonstrated the models’ effectiveness in capturing soil moisture dynamics. Furthermore, feature importance analysis revealed that solar radiation and precipitation were the most influential predictors across all models, offering critical insights into dominant environmental drivers of soil moisture variability.DiscussionBy providing precise SMC predictions across different spatial and temporal scales, this study underscores the value of ML models for SMC prediction, which could have implications for improving irrigation scheduling, reducing water wastages, and enhancing sustainability.