Counterfactual Generation with Knockoffs

Oana-Iuliana Popescu, Maha Shadaydeh, Joachim DenzlerarXiv 2021

Introduction

Deep neural networks are often criticized as "black boxes," making their deployment in high-stakes environments like medicine challenging. To build trust, we must understand the rationale behind their decisions. A prominent approach is the generation of counterfactual explanations, which address the question: "What minimal changes to the input would cause the model to alter its classification?"

Existing methods for generating these explanations often face a "Goldilocks" problem. Heuristic methods, such as blurring or graying out pixels, create out-of-distribution artifacts that can mislead the classifier. Conversely, standard generative models like Variational Auto-Encoders (VAEs) may over-regularize, filling in missing values so effectively that they obscure the impact of specific features, leading to false-negative explanations.

Methodology

To address these limitations, we propose a framework utilizing Knockoffs—statistical "twins" of data features. Originally used for variable selection, knockoffs share the same distribution as the original data but are designed to be as decorrelated as possible from the original features while containing no information about the outcome.

Flowchart of the Knockoff-based counterfactual generation process.

Our approach integrates knockoffs with the Fill-In Drop-Out (FIDO) algorithm. The process involves:

  1. Knockoff Generation: A VAE generates a "knockoff image" of the input.
  2. Mask Optimization: Using "Concrete Dropout," we learn a binary mask that determines which pixels to swap between the original and knockoff images.
  3. Objective Function: The mask is optimized to identify the Smallest Deletion Region (essential for the current label) or the Smallest Supporting Region (sufficient to maintain the label).

Experimental Setup

The framework was evaluated primarily on the MNIST dataset. To test the causal precision of the explanations, we utilized specialized subsets: Complementary MNIST 3/8 and 5/6. These pairs are structurally similar, requiring the model to identify specific strokes (e.g., the loops that distinguish an '8' from a '3') to provide a truly causal explanation.

Results and Discussion

Quantitative evaluation focused on the Saliency Metric (SM), which measures the compactness and informativeness of an explanation. Knockoff-based methods achieved superior SM scores compared to both heuristic "flip" methods and standard VAE in-filling.

Qualitative results showing the precision of knockoff-based saliency masks.

Qualitatively, knockoffs demonstrated a superior ability to highlight causal features. In the Complementary MNIST tests, the method accurately identified the specific regions needed to transform one digit into another—such as the empty spaces that, when filled, turn a '3' into an '8'. Unlike heuristic methods that often produce broad, noisy saliency maps, knockoffs focused strictly on relevant digit strokes, significantly reducing artifacts.

Conclusion and Future Work

While promising on grayscale datasets like MNIST, the framework's performance on high-resolution, natural images remains to be fully explored. Additionally, the quality of explanations is inherently tied to the performance of the underlying generative model. Future research will focus on scaling this approach to more complex data and developing evaluation metrics that better align with human causal reasoning.

Summary updated

BibTeX
@misc{popescu2021counterfactual,
  author = {Oana-Iuliana Popescu and Maha Shadaydeh and Joachim Denzler},
  title = {{Counterfactual Generation with Knockoffs}},
  year = {2021},
  eprint = {2102.00951},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.00951},
}
Figure