National baseline high-resolution mapping of soil organic carbon in Moroccan cropland areas

Authors:
Soil organic carbon (SOC) plays a critical role in enhancing soil fertility, improving water retention, and contributing to global carbon sequestration and thereby supporting climate action. In Morocco, previous SOC mapping efforts have relied largely on traditional methods that fall short in capturing SOC's spatial variability due to data quality, availability, and extrapolation errors. This study aims to create the first national baseline SOC map for cropland using digital soil mapping techniques. Three machine learning (ML) models—Random Forest (RF), XGBoost, and LightGBM were compared to assess SOC spatial variability at 250-m resolution in Moroccan croplands. Recursive Feature Elimination was used to optimize model performance by selecting the most relevant predictors from 83 environmental covariates, including soil properties, climatic and hydrological factors, vegetation indices, and anthropogenic activities. The models were calibrated and validated using 9926 georeferenced samples from 0 to 30 cm soil depth alongside environmental data. Validation results demonstrated satisfactory predictive performance of ML models in SOC prediction, with RF achieving the highest accuracy (R2 = 0.41; RMSE = 0.43 %) and demonstrated low uncertainty, slightly outperforming XGBoost and LightGBM, which both achieved R2 = 0.39 and RMSE = 0.43 %. On the other hand, the created SOM map for Moroccan croplands displayed limited alignment with the global SOC dataset (SoilGrids), suggesting that this later is less appropriate for capturing local soil properties. These findings establish a foundational baseline SOC map for Moroccan croplands, providing detailed insights into spatial variability. The results support the recent policies aiming development of sustainable agricultural strategies, soil conservation efforts, and climate change mitigation through improving the in-depth understanding of soil carbon dynamics at various scales.