# Generating Counterfactual and Contrastive Explanations using SHAP

arXiv: https://arxiv.org/abs/1906.09293 · HTML: https://mlsanity.com/paper/1906.09293/

## Key facts

- Cited by 24 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 21 Jun 2019.

## Built on by (most cited first, 24 of 24)

- [Explainability of deep vision-based autonomous driving systems: Review and challenges](https://mlsanity.com/paper/2101.05307/) (2021)
- [Contrastive Explanations for Model Interpretability](https://mlsanity.com/paper/2103.01378/) (2021)
- [Counterfactuals and Causability in Explainable Artificial Intelligence: Theory, Algorithms, and Applications](https://mlsanity.com/paper/2103.04244/) (2021)
- [The Road to Explainability is Paved with Bias: Measuring the Fairness of Explanations](https://mlsanity.com/paper/2205.03295/) (2022)
- [On the Complexity of SHAP-Score-Based Explanations: Tractability via Knowledge Compilation and Non-Approximability Results](https://mlsanity.com/paper/2104.08015/) (2021)
- [Amortized Generation of Sequential Algorithmic Recourses for Black-box Models](https://mlsanity.com/paper/2106.03962/) (2021)
- [Explainable Reinforcement Learning for Broad-XAI: A Conceptual Framework and Survey](https://mlsanity.com/paper/2108.09003/) (2021)
- [Counterfactual Shapley Additive Explanations](https://mlsanity.com/paper/2110.14270/) (2021)
- [A Framework and Benchmarking Study for Counterfactual Generating Methods on Tabular Data](https://mlsanity.com/paper/2107.04680/) (2021)
- [MACE: An Efficient Model-Agnostic Framework for Counterfactual Explanation](https://mlsanity.com/paper/2205.15540/) (2022)
- [Feature Synergy, Redundancy, and Independence in Global Model Explanations using SHAP Vector Decomposition](https://mlsanity.com/paper/2107.12436/) (2021)
- [Interpretation of Black Box NLP Models: A Survey](https://mlsanity.com/paper/2203.17081/) (2022)
- [Evaluating the Correctness of Explainable AI Algorithms for Classification](https://mlsanity.com/paper/2105.09740/) (2021)
- [Benchmarking Instance-Centric Counterfactual Algorithms for XAI: From White Box to Black Box](https://mlsanity.com/paper/2203.02399/) (2022)
- [SAFE: Saliency-Aware Counterfactual Explanations for DNN-based Automated Driving Systems](https://mlsanity.com/paper/2307.15786/) (2023)
- [Causal versus Marginal Shapley Values for Robotic Lever Manipulation Controlled using Deep Reinforcement Learning](https://mlsanity.com/paper/2111.02936/) (2021)
- [Counterfactual Explainer Framework for Deep Reinforcement Learning Models Using Policy Distillation](https://mlsanity.com/paper/2305.16532/) (2023)
- [Policy Optimization with Sparse Global Contrastive Explanations](https://mlsanity.com/paper/2207.06269/) (2022)
- [Rectifying Group Irregularities in Explanations for Distribution Shift](https://mlsanity.com/paper/2305.16308/) (2023)
- [CLIMAX: An exploration of Classifier-Based Contrastive Explanations](https://mlsanity.com/paper/2307.00680/) (2023)
- [Towards an Explanation Space to Align Humans and Explainable-AI Teamwork](https://mlsanity.com/paper/2106.01503/) (2021)
- [CEnt: An Entropy-based Model-agnostic Explainability Framework to Contrast Classifiers' Decisions](https://mlsanity.com/paper/2301.07941/) (2023)
- [An Explainable Gaussian Process Auto-encoder for Tabular Data](https://mlsanity.com/paper/2509.00884/) (2025)
- [GFGE: Unifying Explainable AI Methods through an Interpretation Framework](https://mlsanity.com/paper/2610.05225/) (2026)

## Abstract (arXiv)

With the advent of GDPR, the domain of explainable AI and model interpretability has gained added impetus. Methods to extract and communicate visibility into decision-making models have become legal requirement. Two specific types of explanations, contrastive and counterfactual have been identified as suitable for human understanding. In this paper, we propose a model agnostic method and its systemic implementation to generate these explanations using shapely additive explanations (SHAP). We discuss a generative pipeline to create contrastive explanations and use it to further to generate counterfactual datapoints. This pipeline is tested and discussed on the IRIS, Wine Quality & Mobile Features dataset. Analysis of the results obtained follows.
