Semi-supervised counterfactual explanations

Surya Shravan Kumar Sajja, Sumanta Mukherjee, Satyam Dwivedi, Vikas C. RaykarOpenReview 2020 · DOI

TL;DR

This paper introduces a novel semi-supervised approach to generate more interpretable and "likely" counterfactual explanations for machine learning models. By jointly training an auto-encoder with a classifier, the method ensures counterfactuals not only stay within the overall data distribution but also align with the target class's distribution, leading to more trustworthy and actionable explanations.

What Problem Does This Paper Address?

Counterfactual explanations are crucial for understanding why a machine learning model made a certain decision and how to achieve a desired outcome. For instance, a loan application might be denied, and a counterfactual explanation would tell the applicant how to get approved (e.g., "if your income was $X, you would be approved"). However, a major challenge is ensuring these explanations are interpretable and likely. An explanation is interpretable if it's close to the original data distribution, and likely if it reflects realistic feature values for the target outcome. Previous methods often struggled to satisfy both, sometimes generating explanations that were technically valid but unrealistic or hard to understand. This paper tackles the problem of generating counterfactuals that are not only close to the training data distribution but also specifically align with the distribution of the target class, thereby enhancing their interpretability and trustworthiness.

Methods

The core innovation lies in a semi-supervised learning framework for training an auto-encoder. Instead of training the auto-encoder in a purely unsupervised manner (only to reconstruct input data), this approach jointly trains the auto-encoder and the classifier. This joint training uses a combined loss function that includes:

  • Cross-entropy loss: For the classification task.
  • Reconstruction loss: For the auto-encoder to reconstruct input data.

This integration allows the auto-encoder's latent space to become "aware" of class information. The authors propose a loss function for generating counterfactuals that incorporates:

  • Prediction loss: To ensure the counterfactual achieves the target prediction.
  • Sparsity loss: To minimize the number of feature changes.
  • Reconstruction loss: To keep the counterfactual within the data manifold.
  • Prototype loss: To guide the counterfactual towards the latent space representation of the target class.

This semi-supervised approach aims to create a latent space that better separates different classes, leading to more discriminative and interpretable counterfactuals.

Datasets

The paper evaluates its approach on several standard datasets:

  • German Credit data set: Predicting credit risk.
  • Adult census data set: Predicting income above $50K.
  • Breast Cancer Wisconsin (diagnostic) data set: Predicting malignancy.
  • MNIST data set: Used for an odd-even digit classification task.
  • COMPAS data set: Predicting recidivism risk.
  • PIMA data set: Predicting diabetes.

Key Insights and Ideas

  • Class-aware latent space is key: Simply ensuring counterfactuals are within the general data distribution isn't enough. They must also align with the distribution of the target class to be truly interpretable and likely.
  • Semi-supervised training bridges the gap: Jointly training an auto-encoder with a classifier imbues the latent space with class-specific information, which is crucial for generating better counterfactuals.
  • Improved interpretability and sparsity simultaneously: The proposed method demonstrates that it's possible to achieve both sparser counterfactuals (fewer feature changes) and higher interpretability, a trade-off often seen in previous methods.
  • Prototype guidance enhances search: Using prototypes (representative points) in the latent space of the target class helps guide the counterfactual search more efficiently and accurately.

Key Results

The paper reports significant improvements in interpretability and sparsity metrics when comparing their semi-supervised approach (SS) against traditional unsupervised auto-encoder methods (U).

  • Sparsity: SS consistently produced sparser counterfactuals across most datasets, meaning fewer features needed to be changed.
  • Categorical Proximity: SS generally achieved better categorical proximity, indicating more realistic changes for categorical features.
  • Interpretability (IM1 and IM2): The SS framework showed consistent improvement in interpretability metrics, particularly IM2, indicating better alignment with the target class distribution. For example, on the Adult Income and COMPAS datasets, the SS framework's counterfactuals were better explained by the target class distribution.
  • Qualitative Examples: The paper provides examples showing how the SS method can capture implicit correlations between features (e.g., age and age category in COMPAS) and generate more concise explanations. For the German Credit dataset, a single change in "loan application purpose" was sufficient for a significant risk reduction.

Limitations and Future Work

  • Actionability and Feasibility: The authors acknowledge that while they focus on interpretability, actionability (whether the suggested changes are practical) and feasibility (whether the changes are realistic or permissible) are also important aspects not directly addressed in this work.
  • Hyperparameter Tuning: The performance of the method depends on hyperparameter tuning for loss function weights and neural network architectures.
  • Future Work: The authors suggest exploring more advanced representation learning techniques like semi-supervised Variational Autoencoders (VAEs) and incorporating causality and feasibility constraints to derive even more faithful data embeddings. They also plan to explore the potential of this approach for more complex scenarios.

Summary updated

BibTeX
@misc{sajja2020semi,
  author = {SURYA SHRAVAN KUMAR SAJJA and Sumanta Mukherjee and Satyam Dwivedi and Vikas C. Raykar},
  title = {{Semi-supervised counterfactual explanations}},
  year = {2020},
  eprint = {2303.12634},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.12634},
}
Figure