AttributionLab: Faithfulness of Feature Attribution Under Controllable Environments

Yang Zhang, Yawei Li, Hannah Brown, Mina Rezaei, Bernd Bischl, Philip Torr, Ashkan Khakzar, Kenji Kawaguchi

TL;DR

AttributionLab introduces a "controlled laboratory" for testing the faithfulness of neural network explanations by manually designing both the datasets and the model weights. This approach reveals that popular attribution methods often fail basic sanity checks, showing that common evaluation metrics like perturbation analysis are fundamentally unreliable due to the "Unseen Data Effect."

What Problem Does This Paper Address?

In the quest to make "black box" neural networks interpretable, researchers use feature attribution methods (like GradCAM, LIME, or Integrated Gradients) to highlight which input pixels were most important for a specific prediction. But how do we know if these explanations are faithful—that is, do they truly reflect the model's internal logic, or are they just producing "human-pleasing" heatmaps?

The current trend is to test faithfulness using synthetic data where we think we know the ground truth. However, the authors highlight a critical flaw called the Rashomon effect: even if a model achieves 100% accuracy on a synthetic dataset, there is no guarantee it learned to use the features the designer intended. For example, a model might learn to identify a square by looking only at its corners rather than the whole shape.

Designing data alone is insufficient because models may learn spurious correlations or ignore intended features.

Methods

The authors propose AttributionLab, a framework that bypasses the uncertainties of training. Instead of training a model, they manually design the network architecture and set its weights. By doing this, they create a model where the "ground truth" of which features influence the output is mathematically certain.

The setup involves:

  1. Synthetic Environments: Designing modular components like "CNN Color Detectors" and "CNN Accumulators" (see Figure 4) to perform specific tasks, such as identifying the dominant color in an image.
  2. Faithfulness Test: Measuring the alignment between an attribution method's output and the known ground truth using precision, recall, and F1-scores.
  3. Simulating the "Unseen Data Effect": Manually programming the model to react unpredictably to inputs outside its "training" distribution, allowing the authors to test how evaluation metrics handle out-of-distribution (OOD) data.
Figure 1. Designing data and model to set up a controllable environment for testing the faithfulness of attribution methods and analyzing their properties. To obtain the ground truth attribution, we explicitly design networks in tandem with inputs. The models follow conventional neural network designs and have sufficient complexity (shown in Table 1). More synthetic environments, including different modules (e.g., a modulo computer) and different tasks (e.g., regression) are in the appendix C. The faithfulness test performs a sanity check on attribution results in the synthetic setting with the ground truth attribution.

Datasets

The paper primarily uses custom synthetic datasets designed to work with their manually weighted models:

  • Multi-color-sum: Images with patches of different colors where the task is to identify the dominant color. This creates both positive (target color) and negative (other colors) contributing features.
  • Single-color-modulo: A regression-like task where the model counts pixels and outputs a modulo result.
  • Validation Set: To ensure their findings generalize, they also apply the attribution methods to an ImageNet-pretrained VGG16 and ViT, comparing the results qualitatively to the synthetic findings.

Key Insights and Ideas

  • The Rashomon Effect is Real: Simply having a "ground truth" dataset isn't enough to evaluate XAI. If you don't control the model weights, you don't actually know what the model is doing.
  • Perturbation Metrics are Flawed: Common metrics like "Insertion" and "Deletion" (which remove pixels to see how the output changes) are highly sensitive to the Unseen Data Effect. A drop in confidence might happen because the model is confused by a weird OOD input, not because a "relevant" pixel was removed.
  • DeepSHAP's Sign Struggle: While DeepSHAP is excellent at locating relevant features, it often struggles to correctly identify whether a feature's contribution is positive or negative.
  • Segmentation is the Bottleneck for LIME: LIME’s faithfulness is almost entirely dependent on its segmentation prior. Using advanced models like SAM (Segment Anything Model) drastically improves LIME's performance compared to older methods like Quickshift.
LIME's performance varies wildly based on the segmentation method used, with SAM providing the most faithful results.

Key Results

  • Baseline Sensitivity: Integrated Gradients (IG) and Occlusion only passed faithfulness tests when provided with the exact ground truth baseline (e.g., the specific background color). Using a default black baseline (0,0,0) led to failure.
  • Metric Correlation: In the presence of the "Unseen Data Effect," the correlation between perturbation-based rankings and ground-truth rankings dropped significantly (e.g., Insertion correlation dropped from 0.42 to 0.02).
  • Positive-Only Methods: Methods like GradCAM and IBA were found to be faithful at identifying positive contributions but are fundamentally incapable of showing negative evidence by design.

Limitations and Future Work

The authors acknowledge that while their manually designed models follow conventional architectures (CNNs, MLPs), they do not fully capture the messy, complex behaviors of a model emerged through stochastic gradient descent.

Currently, AttributionLab is focused on vision tasks. The authors suggest that future work should expand this "laboratory" approach to Transformers (by adding self-attention modules) and other data modalities like natural language or time-series data. They also encourage the community to focus on finding better configurations (like baselines and segmentation priors) for existing methods rather than just proposing new ones.

Summary updated

BibTeX
@inproceedings{zhang2023attributionlab,
  author = {Yang Zhang and Yawei Li and Hannah Brown and Mina Rezaei and Bernd Bischl and Philip Torr and Ashkan Khakzar and Kenji Kawaguchi},
  title = {{AttributionLab: Faithfulness of Feature Attribution Under Controllable Environments}},
  booktitle = {XAIA @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=h5usKrxCH2},
}
Figure