Soil Knowledge-Guided Depth-Autoregressive Transformer for Predicting Soil Organic Carbon at Multiple Depths
Abstract
The soil organic carbon (SOC) is a critical component of the terrestrial carbon cycle and a key indicator of soil health and agricultural productivity. The accurate prediction of SOC across multiple depths is essential for reliable carbon stock estimation and sustainable soil management. However, the existing approaches still face challenges in achieving high accuracy for deep SOC prediction and often lack the incorporation of soil knowledge, leading to limited model stability, especially for deep soils. To address these issues, we proposed a depth-autoregressive transformer that enhances depth representation through optimized depth embeddings and leverages autoregressive prediction to incorporate prior SOC information from adjacent layers. In addition, a soil knowledge-guided loss (SKG-Loss) was introduced, integrating depth constraints and feature monotonicity constraints to guide the training process. A total of 256 soil cores (0–100 cm) were collected and divided into four depth intervals (0–20, 20–40, 40–60, and 60–100 cm) in this study. Based on multisource environmental covariates, a multitemporal feature set with 32 predictors was developed. The results from location-based fivefold cross-validation demonstrate that the proposed model outperforms five commonly used models, achieving an R2 of 0.69, a root mean square error (RMSE) of 4.11 g kg−1, and a mean absolute error (MAE) of 3.03 g kg−1. The incorporation of SKG-Loss consistently improves prediction accuracy across all depths, with particularly notable gains at 20–60 cm (approximately 10% increase in R ${}^{2}$ ). Finally, the SOC distribution maps at multiple depths with 10-m spatial resolution were generated for the study area. Overall, the proposed approach improves both the accuracy and stability of depthwise SOC prediction, providing an effective and physically informed framework for 3-D SOC mapping and carbon stock assessment.