Accurate and Robust Feature Importance Estimation under Distribution Shifts

Jayaraman J. Thiagarajan, Vivek Sivaraman Narayanaswamy, Rushil Anirudh, Peer-Timo Bremer, Andreas Spanias

Abstract

As machine learning models are increasingly deployed in high-stakes environments, understanding the rationale behind specific predictions becomes critical. However, existing feature attribution methods often suffer from high computational complexity, brittleness under distribution shifts, and sensitivity to masking strategies. We present PRoFILE (Producing Robust Feature Importances using Loss Estimates), a novel post-hoc explainability method that jointly trains a loss estimator alongside a predictive model. PRoFILE generates feature importance scores by measuring the estimated increase in model error when specific features are masked. Our results demonstrate that PRoFILE is significantly more robust to distribution shifts and computationally efficient compared to established methods like SHAP and LIME.

Introduction

The deployment of black-box models in medicine, finance, and other critical sectors necessitates reliable interpretability tools. Current feature attribution methods, which rank input features by their importance to a prediction, face three primary hurdles:

  1. Computational Complexity: Sampling-based methods like SHAP and LIME require numerous model evaluations per explanation, hindering real-time application.
  2. Brittleness under Distribution Shift: Explanations often degrade when input data deviates from the training distribution, even if the underlying model remains performant.
  3. Masking Sensitivity: Many tools are tied to specific feature-hiding strategies, requiring complete retraining if the strategy changes.

PRoFILE addresses these challenges by providing a fast, consistent, and robust framework for feature importance estimation.

Methodology

The core of PRoFILE is the Loss Estimator ($G$), an auxiliary network trained to predict the loss of the primary model by observing its internal latent representations.

Joint Training and Objectives

The loss estimator is trained concurrently with the main model to "know when the model is likely to be wrong." Two training objectives are proposed:

  • Contrastive Training: Focuses on correctly ranking samples by their relative loss.
  • Dropout Calibration: Employs Monte Carlo dropout to establish uncertainty intervals, ensuring loss estimates remain within a predicted error range.

Granger Causality for Attribution

Feature importance is determined by comparing the estimated loss of the full input $\mathbf{x}$ to the estimated loss when a specific feature $j$ is masked ($\hat{\mathbf{x}}_{\setminus \{j\}}$). A significant spike in estimated loss indicates high feature importance.

The PRoFILE framework: Joint training of the loss estimator (top) and the post-hoc explanation generation process using Granger causality (bottom).

Unlike previous methods, PRoFILE can accommodate various masking strategies (e.g., zero-masking, mean-masking) at test time without retraining.

Experimental Setup

PRoFILE was evaluated across several standard and distribution-shift benchmarks:

  • Standard Benchmarks: UCI Handwritten Digits, OpenML (Kropt, Letter, Pokerhand, RBF), and CIFAR-10.
  • Distribution Shift: CIFAR-10C (19 corruption types), MNIST to USPS transfer, and synthetic datasets simulating feature correlation shifts.

Results and Discussion

PRoFILE consistently demonstrates superior performance in both fidelity and robustness.

Fidelity and Efficiency

Using the $\Delta$log-odds metric—which measures the drop in model confidence when important features are removed—PRoFILE outperformed LIME, SHAP, and CXPlain across multiple datasets. Furthermore, because it leverages a pre-trained estimator, PRoFILE is orders of magnitude faster than sampling-based alternatives.

Comparison of PRoFILE (C and DC) against LIME, SHAP, and CXplain on various datasets using the Δ Log Odds metric.

Robustness to Corruption

On the CIFAR-10C dataset, PRoFILE maintained high-quality explanations across diverse corruption types (e.g., noise, weather, blur), whereas competing methods showed significant degradation as corruption severity increased. This robustness is "inherited" from the primary model; as the model architecture improves, the loss estimator's performance scales accordingly.

Conclusion

PRoFILE offers a robust and efficient solution for post-hoc model explanations. By framing feature importance through the lens of causal loss estimation, it avoids the noise associated with gradient-based methods and the overhead of sampling. While it requires access to internal model representations during training, its ability to handle distribution shifts and arbitrary masking makes it a powerful tool for reliable AI deployment. Future work will explore the use of the loss estimator for out-of-distribution detection.

Summary updated

BibTeX
@inproceedings{thiagarajan2021accurate,
  author = {Jayaraman J. Thiagarajan and Vivek Sivaraman Narayanaswamy and Rushil Anirudh and Peer-Timo Bremer and Andreas Spanias},
  title = {{Accurate and Robust Feature Importance Estimation under Distribution Shifts}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i9.16963},
}
Figure