[Paper Review] Learning to Estimate Shapley Values with Vision Transformers
This paper proposes a learnable explainer model based on Vision Transformers (ViTs) to efficiently and accurately estimate Shapley values for vision models, overcoming the computational intractability of exact Shapley computation. By training a ViT with a novel loss function that bounds estimation error without ground-truth values, the method achieves high-fidelity explanations up to 100x faster than KernelSHAP, outperforming attention-based, gradient-based, and removal-based methods across multiple datasets.
Transformers have become a default architecture in computer vision, but understanding what drives their predictions remains a challenging problem. Current explanation approaches rely on attention values or input gradients, but these provide a limited view of a model's dependencies. Shapley values offer a theoretically sound alternative, but their computational cost makes them impractical for large, high-dimensional models. In this work, we aim to make Shapley values practical for vision transformers (ViTs). To do so, we first leverage an attention masking approach to evaluate ViTs with partial information, and we then develop a procedure to generate Shapley value explanations via a separate, learned explainer model. Our experiments compare Shapley values to many baseline methods (e.g., attention rollout, GradCAM, LRP), and we find that our approach provides more accurate explanations than existing methods for ViTs.
Motivation & Objective
- To make Shapley values practical for Vision Transformers (ViTs), which are computationally prohibitive due to exponential complexity.
- To investigate how ViTs handle missing input patches via attention masking, ensuring robustness to partial inputs.
- To develop a learnable explainer model that estimates Shapley values efficiently and accurately using a specialized training loss.
- To compare the proposed method against attention-based, gradient-based, and removal-based explanation methods in terms of fidelity and accuracy.
- To validate that Shapley values provide a more reliable and consistent explanation of model behavior than attention or gradients in ViTs.
Proposed method
- The method uses an attention masking strategy to simulate missing image patches during inference, enabling ViTs to process partial inputs.
- A separate, fine-tuned ViT explainer model is trained using a novel loss function designed to minimize Shapley value estimation error without requiring ground-truth values.
- The loss function is theoretically grounded and bounds the estimation error, ensuring convergence to accurate Shapley values during training.
- The explainer model generates full Shapley value explanations in a single forward pass, achieving significant speedups over sampling-based methods like KernelSHAP.
- The approach leverages the inductive bias of ViTs to model complex feature interactions and dependencies across image patches.
- Explanations are visualized using a diverging colormap (icefire) to highlight both positive and negative contributions of image patches.
Experimental results
Research questions
- RQ1Can Vision Transformers be effectively adapted to handle partial input patches through attention masking, enabling the computation of Shapley values?
- RQ2Can a learnable ViT explainer model estimate Shapley values with high accuracy and low computational cost, without requiring ground-truth Shapley values during training?
- RQ3How do Shapley value explanations compare to attention-based, gradient-based, and removal-based methods in terms of fidelity and consistency across different image classes and datasets?
- RQ4Do Shapley value explanations correctly identify both influential and non-influential patches for both target and non-target classes?
- RQ5Can the proposed method reveal model confounders (e.g., background features) that influence predictions, which other methods may miss?
Key findings
- The proposed ViT Shapley explainer achieves explanation quality nearly identical to KernelSHAP, with a 95% confidence interval overlap in estimates.
- ViT Shapley generates explanations up to 100x faster than KernelSHAP, requiring only a single forward pass per image.
- On ImageNette, ViT Shapley outperforms all baselines (e.g., attention rollout, GradCAM, LRP) in identifying relevant and irrelevant patches for both target and non-target classes.
- On MURA, ViT Shapley consistently highlights signs of abnormality, outperforming LRP and other baselines in detecting pathology-relevant features.
- On Pets, ViT Shapley accurately captures breed-specific features (e.g., mouth shape, fur patterns), while minimizing attention to background, unlike other methods.
- For non-target class explanations, ViT Shapley correctly identifies background features (e.g., grass, sky, metal) that could mislead the model, revealing model confounders that other methods fail to detect.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.