The use of complex models such as deep neural networks has yielded large improvements in predictive tasks in many fields including digital soil mapping. One of the concerns about using these models is that they are perceived as black boxes with low interpretability. In this paper we introduce the use of game theory, specifically Shapley additive explanations (SHAP) values, in order to interpret a digital soil mapping model. SHAP values represent the contribution of a covariate to the final model predictions. We applied this method to a multi-task convolutional neural network trained to predict soil organic carbon in Chile. The results show the contribution of each covariate to the model predictions in three different contexts: (a) at a local level, showing the contribution of the various covariates for a single prediction; (b) a global understanding of the covariate contribution; and (c) a spatial interpretation of their contributions. The latter constitutes a novel application of SHAP values and also the first detailed analysis of a model in a spatial context. The analysis of a SOC (soil organic carbon) model in Chile corroborated that the model is capturing sensible relationships between SOC and rainfall, temperature, elevation, slope, and topographic wetness index. The results agree with commonly reported relationships, highlighting environmental thresholds that coincide with significant areas within the study area. This contribution addresses the limitations of the current interpretation of models in digital soil mapping, especially in a spatial context. We believe that SHAP values are a valuable tool that should be included within the DSM (digital soil mapping) framework, since they address the important concerns regarding the interpretability of more complex models. The model interpretation is a crucial step that could lead to generating new knowledge to improve our understanding of soils.

The use of statistical and machine learning (ML) methods to model the distribution of soil classes or properties with environmental factors is a core
component of digital soil mapping (DSM). Since the processes driving pedogenesis are generally complex, there is a general trend in DSM studies to
increase the complexity of the models. More advanced models such as tree-like models and neural networks tend to deal better with the complex
non-linearities present in the data, usually outperforming more traditional methods such as generalised linear models

Complex models such as deep convolutional neural networks (CNNs) have been demonstrated to excel in predictive tasks in many fields of science

In this paper, we explore one approach, namely game theory, to interpret the CNN model for soil organic carbon (SOC) prediction in Chile reported in

From a game theory perspective, a modelling exercise may be rationalised as the superposition of multiple collaborative games where, in each game,
agents (explanatory variables) strategically interact to achieve a goal – making a prediction for a single observation. As a result of this
collaboration, the agents receive a “payout” proportionate to their contribution. In this context, the total gain (or loss) resulting from the
collaboration is the deviation of the prediction from the mean of the predictions for the complete dataset (expected value). Game theory is the
mathematical study of such “games” and the interactions and strategies between the involved agents

One method to estimate the expected marginal contribution of a covariate among all possible combinations is using Shapley values

In this paper we use a modification of the original method proposed by

Architecture of the multi-task network. “Shared layers” represent the layers shared by all the depth ranges. Each branch, one per depth range, first flattens the information to a 1D array and is followed by a series of two fully connected layers and a fully connected layer of size

The method is based on the concept that, in order to explain a complex model

The national-scale model was trained using a dataset of 485 soil profiles from Chile. As covariates, we used (a) a digital elevation model (HydroSHEDS – Hydrological data and maps based on SHuttle Elevation Derivatives at multiple Scales;

The model that we explore in this paper corresponds to a multi-task CNN (Fig.

Spatial distribution of SHAP values for each covariate in two different samples (3D arrays used as inputs).

To estimate the SHAP values, we used the “shap” Python library (

Given the nature of the CNN input (a 29 pixel

Since SHAP values have an additive property

Besides per-sample explanations, SHAP values can also be interpreted in a global context by analysing all the samples simultaneously. This allowed us to explore the overall contribution of the different covariates and also the interactions between them. By having a global understanding of the relationships captured by the model, it was possible to analyse the model behaviour along its environmental gradient and identify significant thresholds.

To make a prediction at a single pixel, the CNN model uses a 29 pixel

Force plots of the same two samples presented in Fig.

If we only consider single samples that can be used as inputs to the model, it is possible to evaluate the contribution of each pixel to the model
prediction. Fig.

In the case of the covariates related to topography, this analysis gives an indication of influential areas in the landscape (within the context
window), either positive or negative, describing interactions over long distances in what

By aggregating the per-pixel contributions into a single SHAP value per sample (Fig.

If we consider multiple samples simultaneously, it is possible to have a general idea of what the model has learned. We were able to confirm that the
model captured the direct relationship between TAP and SOC and the inverse relationship between MAT and SOC (Fig.

SHAP values for each covariate and soil depth interval for the CNN model. TAP: total annual precipitation; MAT: mean annual temperature; TWI: topographic wetness index.

It was also possible to further inspect the effect of particular covariates and evaluate if the model captured interactions between them. For
instance, the positive contribution of temperature peaked in the range between 4 and 8

Dependency plots between SHAP values and selected covariates:

For both temperature and precipitation, the threshold values where their contributions turn positive (around 12

All the previous interpretations are further corroborated by the resulting map of SHAP values (Fig.

Spatial distribution of SHAP values for each covariate for the CNN model. The value of each pixel is an average of all the instances where that pixel is used as context (up to 841 times for a 29 pixel

The SHAP values can also be applied to other ML models and even to linear models. When comparing the SHAP value map of the CNN with the SHAP value map of a tree-like model and a linear model, it was possible to observe similar trends in all of them. In the tree-like model (RMSE 3.6 %;
Fig.

Spatial distribution of SHAP values for each covariate for the tree-like model (RMSE 3.6 %). TAP: total annual precipitation; MAT: mean annual temperature; TWI: topographic wetness index.

Spatial distribution of SHAP values for each covariate for the linear model (RMSE 3.8 %). TAP: total annual precipitation; MAT: mean annual temperature; TWI: topographic wetness index.

The results of this study show that it is possible to work towards interpretable deep learning models in DSM and that a complex model, generally
perceived as a black box, can be inspected using SHAP values. It was possible to assess the covariate importance for the whole model, providing an
alternative to the variables of importance of the random forest algorithm, which is commonly used in DSM

Using SHAP values shows promising results to interpret a DSM CNN, which it is not only necessary to corroborate that the model was trained properly,
but it is also a fundamental part of the process leading to knowledge discovery

In this paper we introduced the use of game theory, specifically SHAP values, in order to interpret a multi-task convolutional neural network trained to simultaneously predict soil organic carbon (SOC) content at five depth intervals. We illustrated how this method can be used to provide insights about the model. The results corroborated that the model captured sensible relationships between the target soil property and the covariates used to train the model.

We were able to interpret the contribution of the different covariates in three contexts. First, this was at a local level, showing the contribution of the covariates for a single prediction. Second, by analysing multiple local interpretations simultaneously, a global understanding of the covariates contribution was determined. Third, a spatial interpretation of the contributions was performed, which is a novel application of SHAP values and also the first detailed spatial application of this kind.

After a more detailed inspection of the contributions at the global level, we were able to identify environmental thresholds consistent with significant areas within the study area. Those thresholds can be also inspected in a spatial context thanks to the map of SHAP values. This suggests that the modelling exercise, including data quality, model selection, and training, was successful.

Considering the limitations of the current interpretation of models in digital soil mapping, especially in a spatial context, we believe that SHAP values are a valuable tool that should be included in the DSM framework, since they address the important concerns regarding the interpretability of more complex models. Additionally, the insights provided from the ML models could also lead to knowledge discovery.

The data are available upon request.

JP conceived and executed the research and wrote the paper. BM gave suggestions about the approach and wrote the paper. ABMB gave suggestions about the approach. All authors reviewed the paper.

The authors declare that they have no conflict of interest.

The authors acknowledge the University of Sydney HPC service at The University of Sydney for providing HPC resources that have contributed to the research results reported within this paper.

This research has been supported by the Australian Research Council, project “Forecasting soil conditions” (grant no. DP200102542).

This paper was edited by Olivier Evrard and reviewed by Matt Aitkenhead and one anonymous referee.