Removing input features via a generative model to explain their attributions to classifier's decisions

Chirag Agarwal, Dan Schonfeld, Anh NguyenarXiv 2019

Abstract

Attribution methods aim to explain the decisions of deep learning models by identifying which input features (pixels) most significantly influence a classifier's output. A common approach involves perturbing the input image—removing specific patches—and observing the resulting change in model confidence. However, traditional perturbation techniques like blurring or constant-color patching introduce unrealistic "out-of-distribution" (OOD) artifacts that can bias the model's response, leading to inaccurate explanations. This paper proposes a generative approach that utilizes inpainting to remove features while maintaining image realism. By integrating a generative model into existing attribution frameworks, we produce more faithful and human-interpretable heatmaps that avoid the artifacts common in standard methods.

Introduction: The Artifact Problem in Attribution

To understand why a model classifies an image as a "freight car," researchers often generate attribution maps (heatmaps) that highlight the most influential pixels. These maps are typically built through perturbation: removing a patch of the image and measuring the drop in model confidence. If the confidence plummets, that patch is deemed important.

The fundamental flaw in current methods lies in the "how" of feature removal. Techniques such as replacing patches with gray squares, random noise, or Gaussian blur create images that look nothing like the training data. When a model encounters a gray square, it may not be reacting to the absence of the object, but rather to the presence of a strange, OOD artifact. The authors observed that many classifiers mistake gray-patched images for "jigsaw puzzles" or "mazes," which fundamentally biases the resulting explanation.

Generative Inpainting for Feature Removal

The authors propose a generative approach to feature removal. Instead of using blunt tools like gray boxes, they integrate a generative inpainter (specifically DeepFill-v1) into three classic attribution methods:

  1. Sliding-Patch (SP-G): While traditional SP slides a gray box across the image, SP-G uses an "inpainting window" that fills the area with a plausible background.
  2. LIME-G: This method inpaints random "superpixels" instead of graying them out.
  3. Meaningful Perturbation (MP2-G): An optimization-based method that replaces blurring with inpainting, eliminating several sensitive hyperparameters and improving robustness.
Comparison of traditional perturbation methods (SP, LIME, MP2) vs. their generative counterparts (SP-G, LIME-G, MP2-G) showing samples and resulting heatmaps.

A key technical shift is the adoption of a "deletion" objective. Previous generative attempts tried to "preserve" the object and inpaint the background, which often failed because inpainters struggle to hallucinate complex foreground objects. By focusing on removing the object and filling in the background, the authors achieved significantly more realistic results.

Empirical Evaluation and Results

The researchers evaluated these "G-methods" on two standard benchmarks: ImageNet (object recognition) and Places365 (scene recognition), using pre-trained ResNet-50 models.

The "Jigsaw" Bias and Feature Erasure

A striking finding was that LIME’s traditional gray-out method produced samples classified as "jigsaw puzzle" or "maze" over 20% of the time. Inpainting successfully eliminated this bias. Furthermore, inpainting proved to be a more effective "eraser." While a classifier could still recognize a bird 26% of the time after heavy blurring, that confidence dropped to 8.9% with inpainting, indicating that discriminative evidence was more thoroughly removed.

Quantitative Performance

The generative versions outperformed their traditional counterparts across multiple metrics:

  • Object Localization: MP2-G achieved the lowest localization error on ImageNet (24.03%), surpassing the standard MP (29.35%) and the previous state-of-the-art generative method, FIDO-CA (27.9%).
  • Faithfulness: Using the "deletion metric" (measuring confidence drop as important pixels are removed), generative methods consistently identified more relevant features than baselines.
  • Visual Quality: Qualitatively, the heatmaps produced by SP-G and MP2-G were much cleaner, focusing tightly on the actual object rather than producing noisy blobs of high attribution.

Conclusion and Future Directions

By replacing unrealistic perturbations with generative inpainting, this work provides a more reliable foundation for explaining AI decisions. While the approach is computationally more expensive than simple blurring (taking approximately 0.2s per image on a GPU), the gain in accuracy and interpretability is substantial. Future work may involve using class-conditional inpainters to further refine explanations for rare or highly specific objects, ensuring the inpainter does not leave "ghost" artifacts that could still be detected by the classifier.

Summary updated

BibTeX
@misc{agarwal2019removing,
  author = {Chirag Agarwal and Dan Schonfeld and Anh Nguyen},
  title = {{Removing input features via a generative model to explain their attributions to classifier's decisions}},
  year = {2019},
  eprint = {1910.04256},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.04256},
}
Figure