# Explainable AI with counterfactual paths

**Authors:** Bastian Pfeifer, Mateusz Krzyzinski, Hubert Baniecki, Anna Saranti, Andreas Holzinger, Przemyslaw Biecek  
**arXiv:** [2307.07764](https://arxiv.org/abs/2307.07764)  
**Date:** 2023-07-15  
**Summary page:** https://www.summarizepaper.com/en/paper/2307.07764v1/

## Key points

- Evaluation and experimental setup of proposed approach for Explainable AI (XAI) using counterfactual paths
- Synthetic data generated under three conditions: conditional dependency, correlation, and conditional independence
- Random Forest model trained on synthetic data and predictions made based on training set
- Comparison of feature importance scores computed by explainers (such as SHAP and LIME) with model's Gini impurity scores generated by random forest
- High correlation between scores indicates explainers capturing underlying patterns in model's behavior
- Study of capability of explainers to detect important features within the data
- Model-specific Gini impurity scores efficiently detected simulated ground truth for simulated features within the data
- Global explanations computed using SHAP and LIME by computing mean absolute values of local explanation scores
- Conditional Predictive Impact (CPI) used for comparison in a data-focused experiment
- Metrics considered to evaluate quality of explanations: sensitivity metric, fidelity or faithfulness, accuracy of random forest classifier on Diabetes dataset (0.97 AU C)
- Graphical summary of generated counterfactuals showing significant number of swapped labels when glucose variable used as first node in counterfactual path
- Proposed approach provides interpretable explanations for model behavior, detects important features within data, and evaluates quality of explanations.

## Summary

In this section, the authors present the evaluation and experimental setup of their proposed approach for Explainable AI (XAI) using counterfactual paths. They generated synthetic data under three conditions: conditional dependency, correlation, and conditional independence. Two features were simulated to fulfill these conditions, while the rest of the features were added as noise. A Random Forest model was trained on this synthetic data and predictions were made based on the training set. To explain the model's behavior, the authors compared the feature importance scores computed by explainers (such as SHAP and LIME) with the model's Gini impurity scores generated by the random forest. A high correlation between these scores indicates that the explainers are capturing underlying patterns in the model's behavior. The authors also studied the capability of explainers to detect important features within the data. They found that model-specific Gini impurity scores efficiently detected simulated ground truth. However, they focused more on simulated features within the data rather than features preferred by the model. For global explanations using SHAP and LIME, feature importance scores were computed as mean absolute values of local explanation scores. In addition to these methods, Conditional Predictive Impact (CPI) was also used for comparison in a data-focused experiment. To evaluate the quality of explanations several metrics were considered such as sensitivity metric which expressed an expectation that substantial changes in a model's decision logic would be reflected in its explanations; fidelity or faithfulness which was used in conjunction with a surrogate model to measure agreement between original and surrogate models; accuracy of random forest classifier on Diabetes dataset which was 0.97 AU C; graphical summary of generated counterfactuals showed that glucose variable caused a significant number of swapped labels when used as first node in counterfactual path etc.. Overall, this evaluation and experimental setup demonstrated how their proposed approach can provide interpretable explanations for model behavior, detect important features within data and evaluate quality of explanations.
