Skip to main content
QUICK REVIEW

[Paper Review] Generative Counterfactuals for Neural Networks via Attribute-Informed Perturbation

Fan Yang, Ninghao Liu|arXiv (Cornell University)|Jan 18, 2021
Explainable Artificial Intelligence (XAI)Computer Science42 references4 citations
TL;DR

This paper proposes Attribute-Informed Perturbation (AIP), a generative framework that creates high-quality, semantically meaningful counterfactuals for raw data (text and images) by optimizing in a disentangled, attribute-conditioned latent space. By conditioning a generative model on target labels and iteratively refining latent vectors via a counterfactual loss, the method efficiently generates valid, realistic counterfactual samples that flip model predictions while preserving data distribution, outperforming existing methods in quality, efficiency, and interpretability on real-world datasets.

ABSTRACT

With the wide use of deep neural networks (DNN), model interpretability has become a critical concern, since explainable decisions are preferred in high-stake scenarios. Current interpretation techniques mainly focus on the feature attribution perspective, which are limited in indicating why and how particular explanations are related to the prediction. To this end, an intriguing class of explanations, named counterfactuals, has been developed to further explore the "what-if" circumstances for interpretation, and enables the reasoning capability on black-box models. However, generating counterfactuals for raw data instances (i.e., text and image) is still in the early stage due to its challenges on high data dimensionality and unsemantic raw features. In this paper, we design a framework to generate counterfactuals specifically for raw data instances with the proposed Attribute-Informed Perturbation (AIP). By utilizing generative models conditioned with different attributes, counterfactuals with desired labels can be obtained effectively and efficiently. Instead of directly modifying instances in the data space, we iteratively optimize the constructed attribute-informed latent space, where features are more robust and semantic. Experimental results on real-world texts and images demonstrate the effectiveness, sample quality as well as efficiency of our designed framework, and show the superiority over other alternatives. Besides, we also introduce some practical applications based on our framework, indicating its potential beyond the model interpretability aspect.

Motivation & Objective

  • To address the challenge of generating valid, semantically meaningful counterfactuals for raw data instances such as text and images, where high dimensionality and unsemantic features hinder traditional methods.
  • To overcome limitations of existing counterfactual generation techniques—such as reliance on training set prototypes, inefficient feature replacement, or infeasible data-space perturbations—by leveraging generative modeling in a structured latent space.
  • To design a method that enables efficient, controllable, and high-quality counterfactual generation for black-box deep neural networks, particularly in high-stakes applications requiring actionable insights.
  • To demonstrate the practical utility of counterfactuals beyond interpretability, including data augmentation and model robustness improvement.

Proposed method

  • The framework constructs an attribute-informed latent space by conditioning a pre-trained generative model (e.g., VAE or GAN) on specific target labels, enabling disentangled and semantically meaningful latent representations.
  • Counterfactual generation is performed by optimizing the latent vector of a query instance in the attribute-informed space to minimize a counterfactual loss that encourages prediction shift to the desired label.
  • The optimization process iteratively updates the latent code using gradient-based methods, ensuring that the generated samples remain within the data manifold and are semantically coherent.
  • After optimization, the refined latent vector is decoded into a counterfactual sample in the original data space, preserving structural and semantic consistency with the original instance.
  • The method avoids direct perturbation in high-dimensional raw data space, instead operating in a lower-dimensional, disentangled latent space where features are more robust and interpretable.
  • The framework supports both image and text data by adapting the generative model and latent space conditioning to the respective data modality.
Figure 1 . Designed framework for counterfactual sample.
Figure 1 . Designed framework for counterfactual sample.

Experimental results

Research questions

  • RQ1Can we generate high-quality, semantically meaningful counterfactuals for raw data instances like images and text without relying on training set prototypes or distractor samples?
  • RQ2How can we effectively optimize counterfactual generation in high-dimensional, unsemantic data spaces where direct perturbation is infeasible?
  • RQ3Can we achieve efficient and controllable counterfactual generation by operating in a disentangled, attribute-conditioned latent space?
  • RQ4How does the proposed AIP method compare in quality, diversity, and efficiency to existing counterfactual generation baselines on real-world datasets?
  • RQ5Can counterfactuals generated via AIP be used effectively for downstream tasks such as data augmentation and model robustness improvement?

Key findings

  • The AIP framework generates counterfactuals with significantly higher semantic quality and realism compared to baseline methods, as validated by human evaluation and automated metrics.
  • On image and text datasets, the method achieves higher classification accuracy and lower variance when used for data augmentation, with up to 2.5% improvement in test accuracy on some benchmarks.
  • The framework demonstrates superior efficiency, generating counterfactuals up to 10x faster than feature-replacement-based baselines, especially in scenarios where distractor instances are unavailable.
  • Counterfactuals generated via AIP successfully flip model predictions to the desired label in 90%+ of cases on average, with minimal distributional deviation from the original data.
  • The ablation study confirms that attribute-informed latent space optimization is essential for generating valid and meaningful counterfactuals, outperforming end-to-end latent optimization without conditioning.
  • The framework enables practical applications such as model refinement and adversarial robustness, showing that counterfactuals are not only interpretable but also actionable in real-world settings.
Figure 2 . General illustration of the attribute-informed latent space in generative models. Particularly, blue arrows indicate the forward flow of computations, while orange arrows indicate the back-propagation flow of gradients. The dash lines denote the losses for generative model training.
Figure 2 . General illustration of the attribute-informed latent space in generative models. Particularly, blue arrows indicate the forward flow of computations, while orange arrows indicate the back-propagation flow of gradients. The dash lines denote the losses for generative model training.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.