3.1. Descriptive Statistics and Dataset Partition
Descriptive statistics for the 259 valid soil samples—retained after excluding two extreme outliers using the 3
rule—are summarized in
Table 2. The soil organic carbon (SOC) content ranged from 4.70 to 37.80
, with a mean of 16.93
and a median of 16.80
. A coefficient of variation (CV) of 38.04% indicates moderate-to-high spatial heterogeneity. With a skewness of 0.29 and a kurtosis of −0.40, the dataset exhibits an approximately symmetric, slightly platykurtic distribution (
Figure 4a). To ensure representative model training and evaluation, the samples were partitioned via quantile-based stratified random sampling across five strata defined by SOC quintiles. Approximately 80% of the samples (
) were allocated to the training set, while the remaining 20% (
) were reserved for independent testing. The training set exhibited a mean SOC of 16.97
(
), whereas the test set displayed a mean of 16.79
(
). Visual inspection of the violin plot (
Figure 4b) confirms distributional similarity between the two subsets, a finding corroborated by the Kolmogorov–Smirnov (K–S) test (
,
). These results confirm the efficacy of the stratified sampling strategy, ensuring distributional equivalence for robust assessment of model generalization.
3.2. Model Performance and Accuracy Assessment
To mitigate the mild positive skewness observed in the raw soil organic carbon (SOC) data (
), a Box–Cox transformation was applied prior to model training, with the optimal transformation parameter
estimated via maximum likelihood estimation (
Section 2.2.2). Following model inference, Duan’s smearing estimator was employed to back-transform all predicted values onto the original SOC scale [
21]. Consequently, the performance evaluation metrics reported in
Table 3 (
,
,
,
, and
) were derived directly from these bias-corrected, back-transformed predictions.
Table 3 summarizes the predictive performance of each model across both the training and independent test sets, whereas
Figure 5 illustrates the correspondence between predicted and measured SOC values for the independent test set.
Among the five evaluated algorithms, gradient boosting decision trees (GBDT) consistently achieved the highest predictive accuracy on both the training and test sets. During the training phase, GBDT yielded the highest
(0.660) and the lowest
(3.952
), followed by random forest (RF;
) and XGBoost (
). Partial least squares (PLS) produced the lowest training performance (
). On the independent test set, GBDT again outperformed all other models, achieving the highest
(0.518), the lowest
(4.498
), the highest
(2.229), and an
of 0.621 (
Table 3). Support vector machine (SVM) attained a comparable
(0.631) but exhibited lower overall predictive performance (
). XGBoost (
) and RF (
) showed intermediate performance, whereas PLS remained the least accurate (
). Visual analysis of the prediction scatter plots (
Figure 5) corroborated these quantitative findings. GBDT predictions clustered most tightly along the 1:1 line, exhibiting minimal deviation across the entire SOC range. SVM displayed slight compression at the extremes, whereas RF and PLS showed greater dispersion, characterized by a systematic underestimation of values exceeding 30
. Based on its superior and consistent performance, GBDT was selected as the foundational architecture for final SOC mapping, SHAP-based feature interpretation, and uncertainty quantification.
To rigorously assess the spatial generalization capacity of the models, a spatial block cross-validation scheme was implemented. Consistent with expectations regarding spatial data leakage, all machine learning models exhibited a decline in predictive performance under spatial block cross-validation compared with conventional random cross-validation (
Table 4). For the optimal gradient boosting decision tree (GBDT) model, the test
increased from
under random cross-validation to
under spatial block validation, reinforcing the necessity of accounting for geographic heterogeneity when estimating model generalization. Nevertheless, our original stratified random validation scheme remains the most appropriate baseline for our final mapped products, as the quintile-based stratification successfully guaranteed distributional equivalence across all soil carbon tiers. Conversely, spatial block cross-validation functions as an overly pessimistic evaluation strategy given our limited sample size, where removing entire geographic clusters induces localized data scarcity and model underfitting rather than reflecting a true deficiency in model generalization capacity.
3.3. SHAP-Based Variable Importance and Response Patterns
As indicated by the SHAP mean absolute value ranking (
Figure 6), the near-infrared band (B5) emerged as the most influential predictor based on this metric, followed by the Topographic Wetness Index (TWI), Normalized Red–Green Difference Index (NRGDI), elevation (H), the red band (B4), and the SWIR2 band (B7). Collectively, spectral bands account for 42% of the total feature importance, suggesting that soil reflectance properties serve as the primary information source for soil organic carbon (SOC) estimation within this bare-soil composite dataset and model configuration. The SHAP summary plot (
Figure 7) illustrates the directional relationship between predictor variables and SOC predictions: higher values of B5, NRGDI, H, B7, valley depth (VD), B6, B2, B4, and Normalized Difference Moisture Index (NDMI) correspond to lower predicted SOC (negative contribution), whereas higher values of TWI, the Bare Soil Index (BSI), and aspect correspond to higher predicted SOC (positive contribution).
Figure 6 illustrates the global importance of environmental predictors derived from mean absolute SHAP values. Complementing this, the SHAP dependence plots in
Figure 8 illustrate the nonlinear interactions between topographic and spectral covariates as captured by the model within the Hungarian study area. These patterns are consistent with a commonly observed inverse relationship: soil reflectance across the optical spectrum tends to decrease as soil organic carbon (SOC) content increases—a well-documented phenomenon in soil spectroscopy attributable to the chromophoric properties of organic matter.
The near-infrared band (B5; 0.85–0.88
) exerts a predominantly negative influence on SOC prediction, consistent with the aforementioned inverse reflectance–SOC relationship. The SHAP dependence plot (
Figure 8a) suggests a model-inferred threshold near a reflectance value of approximately 0.16 within the Hungarian dataset; below this value, SHAP contributions are largely positive—signifying that low reflectance correlates with higher predicted SOC—whereas values exceeding this threshold correspond to negative contributions, potentially indicative of carbon-poor, mineral-dominated soils. Comparable transitions in SHAP contributions are observed for B4 (0.64–0.67
), B6 (1.57–1.65
), and B7 (2.11–2.29
).
Conversely, the Topographic Wetness Index (TWI) exhibits a consistently positive influence on SOC predictions. The SHAP dependence plot (
Figure 8b) demonstrates a monotonic increase in SHAP values with rising TWI, transitioning from negative contributions at low values (
) to strongly positive contributions in high-TWI regimes. This positive TWI–SOC correlation is spatially consistent with the results in
Section 3.4, where high-SOC classes (IV and V) are predominantly localized in low-elevation alluvial depressions. Furthermore, spectral indices including the Normalized Red–Green Difference Index (NRGDI), Bare Soil Index (BSI), and Normalized Difference Moisture Index (NDMI) consistently exhibit negative SHAP contributions. In this context, NRGDI acts primarily as a proxy for soil brightness and iron content rather than as a vegetation discriminator; thus, higher values—associated with brighter, mineral-dominated surfaces—are inversely correlated with SOC, reinforcing the underlying spectral response patterns.
3.4. Spatial Prediction and Uncertainty Mapping
Utilizing the optimized gradient boosting decision tree (GBDT) model—which achieved a predictive performance of
and
under 10-fold cross-validation—a 30 m resolution map of topsoil soil organic carbon (SOC) was generated for the Hungarian cropland study area (
Figure 9). The predicted SOC values ranged from 6.36 to 28.27
, with a mean concentration of
. To facilitate the interpretation of spatial distribution patterns, these predictions were classified into five distinct tiers using 5
intervals: Class I (5–10
), Class II (10–15
), Class III (15–20
), Class IV (20–25
), and Class V (25–30
).
To investigate topographic controls on soil carbon, five elevation zones were delineated from the digital elevation model (DEM) using natural breaks classification [
44]. The distribution of SOC classes within these zones is detailed in
Table 5. Hungarian cropland is predominantly concentrated in the lowest elevation zone (0–124 m), which encompasses 62% of the total cropland area and contains the majority of high-SOC classes (IV and V; 51.5%). Conversely, Class II predominates in zones exceeding 124 m, accounting for 53–84% of the area in these elevated regions. While the proportion of high-SOC classes declines markedly with increasing elevation, Class I—observed in both sandy lowlands and high-altitude, cool uplands—characterizes the textural and erosional extremes of the SOC gradient.
The 30 m SOC map demonstrates a pronounced east–west zonation across Hungarian croplands: higher SOC concentrations are localized in the eastern and southeastern plains, whereas lower values prevail in western and hilly regions. Class II represents the largest areal extent, while Classes IV and V are largely restricted to low-elevation plains. Class I appears sporadically on aeolian sand dunes of the Great Plain and in high-elevation northern croplands; Class III extends across the central region toward the northern foothills and western borders; and Class V occurs as scattered patches within northeastern alluvial depressions and southern lowlands. These broad spatial patterns align with the Global Black Soil Map (GBSmap) [
45] and the national-level product of Szatmári et al. [
6].
Complementing this regional agreement, the 30 m resolution captures intra-class heterogeneity that coarser products fail to resolve. In the eastern high-SOC belt, contiguous Class IV patches are interspersed with localized Class V occurrences, while small Class I fragments delineate sandy dune landforms in the southern study area. This finer spatial resolution exposes local-scale SOC variations associated with soil type boundaries, microtopographic depressions, and isolated sand lenses—features inherently smoothed by coarser mapping products. Such granularity has direct implications for site-specific management, as it delineates zones of contrasting carbon status within fields that would otherwise be treated as spatially uniform.
A pixel-level coefficient of variation (
) map, derived from 100 bootstrap resampling iterations, was generated to quantify the spatial distribution of SOC prediction uncertainty (
Figure 10). The lowest uncertainty (
, dark green) is concentrated in the eastern Great Plain (46.8–47.3° N, 18.5–21.0° E), overlapping extensive high-SOC zones dominated by Chernozems. This correspondence between high prediction confidence and high SOC is attributable to the model’s reliance on the B5 band. In this region, the deep, dark humic horizons of Chernozems produce persistently low near-infrared (NIR) reflectance, providing a stable spectral signature for the model’s most influential predictor. Furthermore, the subdued topography and gradual soil transitions here reduce the complexity of predictor–response relationships, fostering greater prediction stability.
Conversely, higher uncertainty is concentrated in two primary zones. The first encompasses the southern Danube–Tisza interfluve and the Kiskunság sand region (~46.0° N), where sandy, coarse-textured soils dominate. Here, the fine-scale mosaic of aeolian sands and Chernozems induces high-frequency spatial variation that the current predictor set cannot fully resolve. The second zone lies in the western Transdanubian Hills (~17° E), where the landscape transitions from hills to plains and soil types shift abruptly from Cambisols to Fluvisols along valley axes. The intermingling of river terraces, floodplains, and hillslopes creates rapid successions of soil and topographic conditions, thereby elevating prediction uncertainty. Finally, the northern high-elevation region exhibits moderate uncertainty; despite the pronounced relief, regional-scale topographic proxies are insufficient to fully capture localized carbon enrichment within closed depressions of the Luvisol–Chernozem mosaic.
To evaluate the calibration of the bootstrap-derived prediction intervals, the Prediction Interval Coverage Probability (PICP) and Mean Prediction Interval Width (MPIW) were assessed at the 95% confidence level on the independent test set. The PICP was 94.59%, and the MPIW was 13.65 .
To assess whether significant spatially structured processes remained unaccounted for, the spatial autocorrelation of prediction residuals from the optimal GBDT model was analyzed using global Moran’s
. Three
-nearest neighbor (KNN) spatial weight matrices were evaluated (
). The resulting global Moran’s
values were
(
),
(
), and
(
), calculated via 9999 randomized Monte Carlo permutations. The lack of statistically significant spatial autocorrelation in the residuals suggests that the model successfully captured the spatial dependencies inherent in the SOC data. Furthermore, a control experiment was conducted to determine if incorporating macro-scale covariates (mean annual temperature, mean annual precipitation, and categorical parent material) would enhance model accuracy. This inclusion failed to improve performance; the expanded GBDT model achieved a test
of 0.476 (
Table 6). These findings suggest that the information dilution and spatial mismatch associated with integrating these macro-scale features outweighed their theoretical relevance when modeled at a 30 m resolution.
3.6. Comparative Assessment with Existing SOC Products
Table 8 summarizes the statistical comparison between our GBDT-derived SOC prediction (0–20 cm) and the three benchmark products (all 0–30 cm). Our map demonstrated Pearson correlations (
) of
with SERENA 2016,
with SoilGrids 2.0, and
with Szatmári 2000. The respective biases relative to these benchmarks were
,
, and
. In terms of Lin’s concordance correlation coefficient (
), SERENA 2016 achieved the highest agreement (
), whereas Szatmári 2000 displayed minimal concordance (
). Although SoilGrids 2.0 yielded the lowest
(
) and bias (
), it exhibited the weakest correlation and a standard deviation of
—representing only 45% of the spatial variability captured by our map—suggesting an underestimation of spatial heterogeneity. Reduced Major Axis (RMA) regression slopes for SERENA, SoilGrids 2.0, and Szatmári 2000 were 0.83, 0.94, and 0.35, respectively (
Table 8;
Figure 11a–c). The Bland–Altman analysis yielded 95% limits of agreement of [
]
for SERENA (characterized by a funnel-shaped distribution), [
]
for SoilGrids 2.0 (the narrowest range), and [
]
for Szatmári 2000. The latter benchmark’s limits, being entirely negative, indicate a systematic and substantial underestimation of SOC content across the study area.
Pixel-wise difference maps (
Figure 11d–f) revealed distinct spatial structures in the predictive bias relative to the benchmark products. Comparisons with SERENA 2016 indicated a clear spatial gradient, characterized by positive bias in the eastern Great Plain and negative bias in the western hilly and southern sandy regions. Conversely, residuals relative to SoilGrids 2.0 were centered near zero, with deviations limited to localized discrepancies in sandy zones. Finally, the comparison with the Szatmári 2000product demonstrated a pronounced, systematic negative bias across the entire study area.
A comparative visual analysis between our 30 m SOC map (
Figure 9) and the three benchmark products (
Figure 3) reveals that our results provide the most refined delineation of the east–west SOC zonation, characterized by distinct spatial boundaries. While the SERENA product successfully reproduces macro-scale patterns, it exhibits noticeable smoothing at transition zones. SoilGrids 2.0 presents a comparatively homogenized landscape, likely attributable to resolution-induced aggregation. Although the Szatmári 2000 product demonstrates high spatial similarity (
), it consistently reports higher absolute SOC magnitudes across the study area. Detailed inspection of local subsets (
Figure 12a–d) confirms that our 30 m map captures sharper SOC gradients at finer spatial scales, whereas the 100 m and 250 m products progressively attenuate these transitions, effectively masking local-scale pedological heterogeneity.
Using the SERENA product as a reference, we assessed the spatial structure of the difference raster using a spatial clustering index (
), which confirmed a statistically significant spatial clustering of the prediction bias (
). The focal Pearson correlation analysis, computed within
pixel windows, yielded a median
; however, this aggregate value masked considerable local heterogeneity, as 21.9% of locations exhibited negligible correlations (
), whereas 13.6% demonstrated strong local correlations (
). Furthermore, the bias relative to SERENA exhibited a significant negative correlation with elevation (
). A zonal analysis across five elevation strata revealed a monotonic trend, with mean bias decreasing from
in the lowest elevation zone (Zone 1: 0–124 m) to
in the highest zone (Zone 5:
) (
Table 9,
Figure 12e). All subsample-based bootstrap validations demonstrated high stability, with coefficient of variation (
) values
.