Skip to yearly menu bar Skip to main content

Workshop: XAI in Action: Past, Present, and Future Applications

Cost-aware counterfactuals for black box explanations

Natalia Martinez · Kanthi Sarpatwar · Sumanta Mukherjee · Roman Vaculin


Counterfactual explanations provide actionable insights into the minimal change in a system that would lead to a more desirable prediction from a black box model. We address the practical challenges of finding counterfactuals in the setting where there is a different cost or preference for perturbing each feature. We propose a multiplicative weight approach that is applied on the perturbation, and show that this simple approach can be easily adapted to obtain multiple diverse counterfactuals, as well as to integrate the importance features obtained by other state of the art explainers to provide counterfactual examples. Additionally, we discuss the computation of valid counterfactuals with numerical gradient-based methods when the black box model presents flat regions with no reliable gradient. In this scenario, sampling approaches, as well as those that rely on available data, sometimes provide counterfactuals that may not be close to the decision boundary. We show that a simple long-range guidance approach, when no gradient is available, improves quality of the counterfactual explanation in this scenario. In this work we discuss existing approaches, and show how our proposed alternatives compares favourably on different datasets and metrics.

Chat is not available.