TL;DR
Evaluating how well explainability methods highlight important pixels in an image usually involves destroying those pixels and watching the model's accuracy drop. However, standard destruction techniques (like blurring or deleting pixels) create unnatural, out-of-distribution artifacts that confuse the model regardless of pixel importance. This paper introduces Stratified Inpainting, a novel evaluation metric that uses Stable Diffusion to seamlessly replace important pixels with a plausible alternative class, providing a much more reliable and human-aligned benchmark for explainability.
What Problem Does This Paper Address?
Deep Neural Networks (DNNs) are notoriously opaque. To understand why a vision model makes a prediction, researchers use "attribution methods" (like Grad-CAM or SmoothGrad) to generate heatmaps showing which pixels were most important to the decision. But how do we know if these heatmaps are actually accurate ("faithful") to the model's internal logic?
The standard approach is perturbation: remove the "important" pixels and see if the model's prediction changes. If the prediction changes quickly, the attribution method is deemed good. However, the authors show that common removal techniques—such as deleting pixels, blurring them, or replacing them with the mean channel value—introduce severe Out-of-Distribution (OOD) artifacts. The model's prediction changes not because vital semantic information was removed, but simply because the image now looks bizarre and unnatural. In fact, existing metrics often cannot tell the difference between a real attribution map and a completely random mask.
Methods
The authors propose Stratified Inpainting, which evaluates attribution maps by making natural modifications to the image rather than destructive ones:
- Targeted Class Transition: Instead of changing pixels to random noise or black boxes, the metric attempts to transition the image's prediction to a specific, plausible alternative: the class with the second-highest prediction score (the top-2 class).
- Generative Inpainting: Using a pre-trained Stable Diffusion model, the top $p\%$ ($p \in [10\%, 50\%]$) most relevant pixels are masked out. To maintain generative coherence, pixels are grouped into 16x16 patches. These patches are then inpainted using the text prompt of the top-2 class.
- Verification & Weighting: If the model's prediction successfully shifts to the top-2 class, the metric applies a novel weighting function that compares the attribution maps before and after inpainting. This ensures that the prediction shift was truly caused by the meaningful alteration of the highlighted pixels, rather than an accidental artifact of the generation process.
Datasets
- ImageNet Validation Set: The authors curated a subset of classes ($S$) that Stable Diffusion is reliably capable of generating and inpainting (resulting in 661 classes for CNNs and 704 classes for ViTs).
- Cat-Dog Dataset (Kaggle): A binary classification dataset used specifically to evaluate older architectures like AlexNet.
Key Insights and Ideas
- The Random Baseline Trap: Traditional evaluation metrics are so sensitive to OOD noise that they show a massive drop in model accuracy even when pixels are deleted completely at random. This makes them highly unreliable for ranking different explainability methods.
- Faithfulness Requires Plausibility: Historically, machine learning researchers treated "faithfulness" (being true to the model) and "plausibility" (looking good to humans) as separate or even conflicting goals. This paper demonstrates that by keeping the image in-distribution (plausible), we get a much cleaner, unconfounded measure of true model faithfulness.
- Architecture Robustness: Vision Transformers (ViTs) appear to be inherently more robust to OOD perturbation noise than traditional Convolutional Neural Networks (CNNs), as evidenced by smaller baseline gaps on traditional metrics.
Key Results
- Clearer Separation: Unlike traditional baselines where all attribution methods cluster tightly together and barely beat a random mask, Stratified Inpainting provides a distinct, statistically significant ranking of explainability methods.
- Quantifying the Gap: The authors measured the average distance between viable attribution algorithms and the random baseline. Stratified Inpainting outperformed the best baselines by at least 37% on a binary classifier and 13% on VGG, proving its robustness against OOD effects.
- Human Alignment: A user study with 22 participants and 656 responses showed that when Stratified Inpainting disagreed with traditional baselines on which explainability map was better, humans overwhelmingly preferred the ranking produced by the authors' metric.
Limitations and Future Work
- Top-1 Restriction: The metric currently only evaluates the faithfulness of the explanation for the top-1 predicted class, rather than evaluating class-specific signals across all potential target classes.
- Generative Model Dependencies: The evaluation is restricted to images whose top-2 classes can be successfully recognized and generated by the underlying inpainting engine (Stable Diffusion). Fine-tuning the inpainting engine on all classifier classes is suggested as a potential future solution.
- Computational Overhead: Running a diffusion model for evaluation is significantly slower than simple pixel deletion, though the authors optimized it down to just 10 iterations per step to mitigate this hurdle.
Summary updated