# Boosting Model Interpretability for Transparent ML in TBM Tunneling
## 2 Interpretability with SHapley Additive exPlanations (SHAP)  
SHAP is a game theory-based method for explaining machine learning model outputs [19]. Shapley values from cooperative game theory fairly distribute credit among features, providing local explanations of a model's predictions [20; 21]. To illustrate, consider a team working toward a combined value (the coalition value). The challenge is determining each member's contribution, especially when interactions make the whole greater than the sum of its parts. Shapley values address this by comparing the value of coalitions with and without a specific member. For instance, to calculate a member's marginal contribution, all possible coalitions with and without that member are evaluated, ensuring a fair measure of their impact. In model interpretability, SHAP adapts this concept to analyze how individual features influence predictions. By decomposing contributions, SHAP clarifies each feature's role  
Figure 1: Typical TBM work distribution in Ghomroud tunnel. in the overall model output. The mathematical formula for Shapley values is provided in Equation (2). \[\phi_{i}(f,x)=\sum_{z^{\prime}\subseteq x^{\prime}}\frac{|z^{\prime}|!(M-|z^{ \prime}|-1)!}{M!}\big{[}f_{x}(z^{\prime})-f_{x}(z^{\prime}\setminus i)\big{]} \tag{2}\]  
where the variables are defined as follows:  
* \(\varphi_{i}\) (f,x) is the Shapley value for feature i, f is the black box model, and x is the input datapoint. * z\({}^{\prime}\) is the subset. * x\({}^{\prime}\) is the simplified input. * 1)!/M! is the weighting. * f\({}_{x}\) is the black box model output and \([\)f\({}_{x}\)\((z^{\prime})\)\(-\) f\({}_{x}\)\((z^{\prime})\)\(\mid\)] is the contribution. To simplify Equation (1), the \"Additive\" aspect of SHAP is key. In Equation (3), x represents the inputs and f(x) is the model. A simplified input version x\({}^{\prime}\) transforms the feature vector into a binary format, indicating whether each feature is included or excluded. The explanatory model is then represented as g(x\({}^{\prime}\)). The key is ensuring the following:  
1. If x is approximately equal to x\({}^{\prime}\), then g(x\({}^{\prime}\)) (Additive Feature Attribution) should be roughly equal to f(x);
2. g must conform to the structure where \(\varphi_{0}\) represents the null output of the model (average output of the model) and \(\varphi_{1}\) denotes the explained effect of feature 1 (indicating how much feature 1 alters the model's output). This is referred to as attribution. \[ \begin{array}{l}1.\ x=x^{\prime}\Rightarrow f(x)=g(x^{\prime})\\ 2.\ g(x^{\prime})=\phi_{0}+\sum_{i=1}^{N}\phi_{i}x_{i}\end{array}  \tag{3}\]  
SHAP creates an explanatory model that highlights each feature's contribution and importance through its phi values. This additive approach relies on three key properties as follows:  
* Local accuracy: when the input and simplified input are nearly identical, the explanatory model should match the actual model's output. f(x)\(\approx\)g(x\({}^{\prime}\)) if x\(\approx\)x\({}^{\prime}\)
* Missingness: a feature excluded from the model should have zero attribution, indicating no impact on the output. xi\({}^{\prime}\)= 0 => \(\varphi\)i = 0
* Consistency: if a feature's contribution increases in a new model, its attribution in the explanatory model should not decrease. Different SHAP versions (e.g., low-order SHAP, kernel SHAP, linear SHAP, deep SHAP, tree SHAP) use model-specific assumptions for faster processing. In this paper, Tree Explainer was applied to the XGBoost model and Deep Explainer to the ANN model. Comparing these explainers on the same dataset provides the following key advantages:  
* Model understanding: Tree Explainer interprets XGBoost by attributing decisions to individual trees, while Deep Explainer reveals how features influence neural network predictions. * Complexity comparison: tree models are more interpretable, whereas neural networks are complex; Deep Explainer demystifies the processing in network layers.