[Paper Review] Generating Counterfactual and Contrastive Explanations using SHAP
The paper presents a model-agnostic pipeline using SHAP to generate contrastive explanations and corresponding counterfactual datapoints, evaluated on Iris, Wine Quality, and Mobile Features datasets across multiple models.
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.
Motivation & Objective
- Motivate GDPR-driven need for explainable AI and human-centric explanations like contrastive and counterfactual explanations.
- Propose a model-agnostic pipeline using SHAP to generate contrastive explanations and corresponding counterfactual datapoints.
- Evaluate the approach across multiple datasets and classifiers to assess the quality and practicality of generated explanations.
Proposed method
- Use SHAP to compute feature attributions for each datapoint across target classes.
- Construct natural language explanations for 'Why P?' and 'Why not Q?' using positive/negative SHAP values.
- Mutate only features that negatively contribute to the desired class to generate counterfactual datapoints.
- Generate nearest-neighbor-based counterfactuals by exploring mutated feature sets until a point is classified as the desired class Q.
- Compare across models (KNN, NN, RF, SVM) and datasets (IRIS, Wine Quality, Mobile Features) to assess counterfactual generation.
Experimental results
Research questions
- RQ1Can SHAP-based attributions be used to generate coherent contrastive explanations ('Why P not Q?') for model outputs across different classifiers?
- RQ2Is it possible to generate diverse, realistic counterfactual datapoints by mutating only negatively contributing features, in a model-agnostic manner?
- RQ3How do the proposed explanations perform across datasets of varying density and feature dimensionality?
Key findings
- The approach yields contrastive explanations and counterfactual datapoints across several models and datasets.
- Most generated counterfactuals are not present in the original dataset, indicating exploration beyond the local neighborhood.
- SVM and Neural Networks tended to produce more counterfactuals, suggesting their decision boundaries lend themselves to such mutations.
- On Iris, RF, NN, and KNN, the number of counterfactuals and their overlap with data varies, with lower overlap indicating a tighter decision boundary.
- Dense datasets (Wine Quality, Mobile Features) produced fewer common counterfactuals, implying better separation by models.
- The system implementation (web dashboard) demonstrates practical generation of explanations for given points.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.