Sampling Based On Natural Image Statistics Improves Local Surrogate Explainers

Ricardo Kleinlein, Alexander Hepburn, Raúl Santos-Rodríguez, Fernando Fernández Martínez

Abstract

Local surrogate explainers, such as LIME, are widely used to interpret the decisions of complex deep learning models. However, these methods often rely on perturbation techniques that generate "unnatural" samples, such as images with gray or black occlusions. These samples fall outside the data distribution the model was originally trained on, leading to inconsistent and unreliable explanations. This paper proposes improving surrogate explainers by aligning sampling methods and distance metrics with natural image statistics. By utilizing distortions like Gaussian blurring and perceptual metrics such as MS-SSIM, the authors demonstrate that explanations become more robust, stable, and human-consistent.

Introduction

As deep neural networks become increasingly integrated into critical decision-making processes, the need for interpretability grows. Local surrogate explainers have emerged as a popular solution, providing post-hoc explanations by approximating a complex "black-box" model with a simpler, interpretable model (e.g., a linear regressor) in the local neighborhood of a specific input.

While effective in theory, the practical application of tools like LIME (Local Interpretable Model-agnostic Explanations) often suffers from a fundamental flaw: the "out-of-distribution" (OOD) problem. When LIME perturbs an image to see which features are important, it typically replaces superpixels with flat gray or black patches. These "Frankenstein" images do not resemble natural data, causing the model to behave in unpredictable ways. This paper addresses this gap by forcing the local neighborhood of the explainer to remain within the manifold of natural images.

Methodology

The authors propose two primary interventions to align surrogate explainers with the statistics of natural images: Aligned Sampling and Perceptual Distance Metrics.

1. Aligned Sampling

Traditional occlusion methods (zero-patching or mean color) create sharp edges and unnatural artifacts. The authors suggest replacing these with distortions that are more likely to be encountered in real-world scenarios or during data augmentation. These include:

  • Additive Gaussian Noise
  • Gaussian Blurring
  • Contrast Adjustments

The hypothesis is that a model trained on natural images will provide a more semantically meaningful response to a blurred region than to a perfectly uniform gray square, as blurring preserves some level of natural image structure.

2. Perceptual Distance Metrics

Surrogate explainers must weigh the generated samples based on their similarity to the original query image. LIME traditionally uses Cosine Distance on binary masks to determine this weight. However, binary masks do not capture how humans—or models—perceive image similarity.

The authors introduce the Multi-Scale Structural Similarity Index (MS-SSIM) as a distance metric. MS-SSIM is designed to mimic human visual perception by focusing on structural changes rather than pixel-wise differences. By using MS-SSIM, the explainer implicitly weights samples based on how well they respect the manifold of natural images.

Experimental Design

The researchers evaluated their approach across three distinct environments:

  1. Synthetic Data: Using the "Two Moons" dataset, they applied a Quantile Transformation to demonstrate how moving from uniform sampling to distribution-aware sampling improves the accuracy of the surrogate model.
  2. Natural Images: The team utilized the TID2008 dataset, which contains 25 reference images subjected to various types of distortions (noise, blur, etc.).
  3. Black-Box Model: A Vision Transformer (ViT) pretrained on ImageNet-21K served as the primary model to be explained.

Key Insights and Results

Robustness to Noise and Blur

A primary metric for success was the "explanation distance" ($D_{exp}$), which measures the consistency between an explanation for a clear image and an explanation for a distorted version of that same image. The results indicated that using MS-SSIM as a distance metric consistently lowered $D_{exp}$ compared to standard Cosine distance, suggesting that perceptual metrics make explanations significantly more robust to environmental noise.

Sampling Synergy

The study found a strong synergy between the type of distortion present in the data and the sampling method used by the explainer. For instance, when explaining a blurred image, using blur-based sampling (rather than gray-patching) significantly improved the reliability of the resulting feature importance map.

Visual Coherence

Qualitatively, the proposed method produced heatmaps that were more coherent and aligned with human intuition. While default LIME often produces scattered, noisy importance scores, the natural-statistics-aligned approach identified clear, continuous regions of interest that corresponded to the actual objects in the images.

Discussion and Future Work

While the use of MS-SSIM and natural distortions provides a significant step forward, the authors note that these are still approximations of the true natural image manifold. Furthermore, the computational cost of calculating perceptual metrics for thousands of samples remains a challenge for real-time applications.

The paper concludes by pointing toward the next evolution of this work: Semantic In-painting. Rather than blurring a region, future explainers could use generative models (like DALL-E 2 or Imagen) to replace parts of an image with statistically likely alternatives. For example, instead of occluding a dog's ear with a gray box, a generative model could fill that space with more grass or background texture, keeping the image entirely within the natural distribution while still allowing the explainer to measure the importance of the ear feature.

Summary updated

BibTeX
@inproceedings{kleinlein2022sampling,
  author = {Ricardo Kleinlein and Alexander Hepburn and Raúl Santos-Rodríguez and Fernando Fernández Martínez},
  title = {{Sampling Based On Natural Image Statistics Improves Local Surrogate Explainers}},
  booktitle = {BMVC},
  year = {2022},
}
Figure