facelift
FaceLift -- Navigating Explanatory Multiverse Through Counterfactual Path Geometry
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.7%) to scientific vocabulary
Repository
FaceLift -- Navigating Explanatory Multiverse Through Counterfactual Path Geometry
Basic Info
Statistics
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
FACELift
This repository hosts FACElift source code and useful resources for the following paper.
Navigating Explanatory Multiverse Through Counterfactual Path Geometry
Counterfactual explanations are the de facto standard when tasked with interpreting decisions of (opaque) predictive models. Their generation is often subject to algorithmic and domain-specific constraints such as density-based feasibility for the former and attribute (im)mutability or directionality of change for the latter that aim to maximise their real-life utility. In addition to desiderata with respect to the counterfactual instance itself, the existence of a viable path connecting it with the factual data point, known as algorithmic recourse, has become an important technical consideration. While both of these requirements ensure that the steps of the journey as well as its destination are admissible, current literature neglects the multiplicity of such counterfactual paths. To address this shortcoming we introduce the novel concept of explanatory multiverse that encompasses all the possible counterfactual journeys and shows how to navigate, reason about and compare the geometry of these paths their affinity, branching, divergence and possible future convergence with two methods: vector spaces and graphs. Implementing this (interactive) explanatory process grants explainees more agency by allowing them to select counterfactuals based on the properties of the journey leading to them in addition to their absolute differences.
bibtex
@article{
title={Navigating Explanatory Multiverse Through Counterfactual Path Geometry},
author={Sokol, Kacper and Small, Edward and Xuan, Yueqing},
journal={arXiv preprint arXiv:2306.02786},
year={2023}
}
Tabular Data Example
The role of geometry in (counterfactual) explainability is captured by the following figure, which demonstrates the diverse characteristics of counterfactual paths for a two-dimensional toy data set with continuous numerical features.
Example of explanatory multiverse constructed for tabular data with two continuous (numerical) features. It shows various types of counterfactual path geometry their affinity, branching, divergence and convergence. Each journey terminates in a (possibly the same or similar) counterfactual explanation but characteristics of the steps leading there make some explanations more attractive targets, e.g., by giving the explainee more agency through multiple actionable choices towards the end of a path.
When considered in isolation, these paths shown in the figure above have the following properties:
- B is short but terminates close to a decision boundary, thus carries high uncertainty;
- A while longer and leading to a high-confidence region, it lacks data along its journey, which signals that it may be infeasible;
- C addresses the shortcomings of A, but it terminates in an area of high instability (compared to D, Ei, F, G & H);
- G & H also do not exhibit the deficiencies of A, but they lead to an area with a high error rate;
- D & F have all the desired properties, but they require the most travel; and
- Ei are feasible, but they are incomplete by themselves.
To compose richer explanations, we introduce the concept of explanatory multiverse, which allows for spatially-aware counterfactual explainability. Our approach encompasses all the possible counterfactual paths and helps to navigate, reason about and compare the geometry of these journeys their affinity, branching, divergence and possible future convergence.
MNIST Example
To run the example:
- instal Python dependencies with
pip install -r requirements.txt; - place the dataset files in
/data/raw_data/; and - run
python run_explainer.pywith the default configuration.
The code to generate counterfactual explanations for the MNIST dataset is available in mnist_example.ipynb.
The following figure demonstrates counterfactual pathfinding in the MNIST dataset and the branching factors of these paths.
Example counterfactual journeys identified in the MNIST data set of handwritten digits. Paths 1 (blue) and 2 (green) explain an instance $\mathring{x}$ classified as $\mathring{y} = 1$ for the counterfactual class $\check{y} = 9$. Paths leading to alternative classification outcomes are also possible (shown in grey). Path 1 is shorter than Path 2 at the expense of explainees' agency which is reflected in its smaller branching factor therefore switching to alternative paths leading to different classes is easier, i.e., less costly in terms of distance.
Baselines
We use the following three baseline explainers to generate counterfactual explanations for MNIST dataset.
- FACE is implemented in mnist_example.ipynb.
- Growing Sphere is implemented in growing_sphere.ipynb.
- Prototype is implemented in cfproto_mnist.ipynb. Our implementation is adopted from the package alibi.
- The Binary Space Partition technique which finds counterfactual paths for non-path-based explainers is also implemented in growing_sphere.ipynb.
Hyper-parameters
The hyper-parameters are defined in the params.yaml file.
(Command line configuration will be implemented in future releases.)
Datasets
MNIST
``` distancethreshold: 6.1 predictionthreshold: 0.6 penalty_term: 1.1
directed: True distancefunction: l2 method: knn knn: nneighbours: 5
startpointidx: 1 target_class: 9 ```
Owner
- Name: XUAN
- Login: xuanxuanxuan-git
- Kind: user
- Repositories: 2
- Profile: https://github.com/xuanxuanxuan-git
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you build upon our ideas, please cite the following paper."
authors:
- family-names: "Sokol"
given-names: "Kacper"
orcid: "https://orcid.org/0000-0002-9869-5896"
- family-names: "Small"
given-names: "Edward"
orcid: "https://orcid.org/0000-0002-3368-1397"
- family-names: "Xuan"
given-names: "Yueqing"
orcid: "https://orcid.org/0000-0002-9365-8949"
title: "Navigating Explanatory Multiverse Through Counterfactual Path Geometry"
version: FACElift
doi: 10.48550/arXiv.2306.02786
date-released: 2023-06-06
url: "https://github.com/xuanxuanxuan-git/facelift"
preferred-citation:
type: article
title: "Navigating Explanatory Multiverse Through Counterfactual Path Geometry"
authors:
- family-names: "Sokol"
given-names: "Kacper"
orcid: "https://orcid.org/0000-0002-9869-5896"
- family-names: "Small"
given-names: "Edward"
orcid: "https://orcid.org/0000-0002-3368-1397"
- family-names: "Xuan"
given-names: "Yueqing"
orcid: "https://orcid.org/0000-0002-9365-8949"
journal: "arXiv preprint arXiv:2306.02786"
year: 2023
GitHub Events
Total
- Push event: 4
Last Year
- Push event: 4
Dependencies
- dill ==0.3.6
- matplotlib ==3.7.1
- numpy ==1.24.3
- pandas ==2.0.1
- python ==3.8
- pyyaml ==6.0
- scikit-learn ==1.2.2
- scipy ==1.10.1
- seaborn ==0.12.2
- tqdm ==4.65.0