On the Robustness of Sparse Counterfactual Explanations to Adverse Perturbations

Marco Virgolin, Saverio Fracaros
1/22/2022
63 citations
cs.LG

Official code: marcovirgolin/robust-counterfactuals (11 stars, Jupyter Notebook, last commit 2023-02-16). 1 more implementation below.

Abstract

Counterfactual explanations (CEs) are a powerful means for understanding how decisions made by algorithms can be changed. Researchers have proposed a number of desiderata that CEs should meet to be practically useful, such as requiring minimal effort to enact, or complying with causal models.

Show full abstract

We consider a further aspect to improve the usability of CEs: robustness to adverse perturbations, which may naturally happen due to unfortunate circumstances. Since CEs typically prescribe a sparse form of intervention (i.e., only a subset of the features should be changed), we study the effect of addressing robustness separately for the features that are recommended to be changed and those that are not. Our definitions are workable in that they can be incorporated as penalty terms in the loss functions that are used for discovering CEs. To experiment with robustness, we create and release code where five data sets (commonly used in the field of fair and explainable machine learning) have been enriched with feature-specific annotations that can be used to sample meaningful perturbations. Our experiments show that CEs are often not robust and, if adverse perturbations take place (even if not worst-case), the intervention they prescribe may require a much larger cost than anticipated, or even become impossible. However, accounting for robustness in the search process, which can be done rather easily, allows discovering robust CEs systematically. Robust CEs make additional intervention to contrast perturbations much less costly than non-robust CEs. We also find that robustness is easier to achieve for the features to change, posing an important point of consideration for the choice of what counterfactual explanation is best for the user. Our code is available at: https://github.com/marcovirgolin/robust-counterfactuals.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
marcovirgolin/robust-counterfactualsOfficial11Jupyter Notebook–2023-02-16
marcovirgolin/CoGSCommunity5PythonGPL-3.02023-01-05

Repo of the paper "On the Robustness of Sparse Counterfactual Explanations to Adverse Perturbations"

113Jupyter Notebook, JavaScriptJan 21, 20223 years ago
counterfactual-explanationscounterfactualsexplainable-aiexplainable-machine-learningfairness-ml+5 more
marcovirgolin/CoGSCommunity100%
GPL-3.0

A baseline genetic algorithm for the discovery of counterfactuals, implemented in Python for ease of use and heavily leveraging NumPy for speed.

51Python, Jupyter Notebook3 years agoGPL-3.0
counterfactual-explanationscounterfactualsexplainable-aiexplainable-machine-learningexplainable-ml+4 more

Similar Papers

Cite this paper

@article{virgolin2022robustness,
  title  = {On the Robustness of Sparse Counterfactual Explanations to Adverse Perturbations},
  author = {Marco Virgolin and Saverio Fracaros},
  year   = {2022},
  eprint = {2201.09051},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2201.09051}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2201.09051.svg)](https://codeofpaper.com/paper/2201.09051)

Discussion