Sawji, Shreyas Mukund (2025) Hybrid SHAP-LRP for Adversarial Debugging in Vision Transformers: A Layer-Wise Explainability Approach. Masters thesis, Dublin, National College of Ireland.
Preview |
PDF (Master of Science)
Download (1MB) | Preview |
Preview |
PDF (Configuration Manual)
Download (717kB) | Preview |
Abstract
Vision Transformers (ViTs) have been shown to perform well on image classification tasks but tend to be difficult to interpret and susceptible to adversarial attacks where small, often imperceptible, changes to input images result in incorrect predictions. This paper addresses the urgent needs of interpretability and robustness in ViTs through a new hybrid model that integrates SHAP (Shapley Additive Explanations) and Layer-wise Relevance Propagation (LRP) to explain and to diagnose adversarial vulnerability.
We trained a ViT-tiny Patch16-224 model on the CIFAR-10 dataset and applied adversarial attacks created by the Fast Gradient Sign Method (FGSM) to it. Our solution paired SHAP to map global feature importance and LRP to determine which internal transformer blocks were most impacted by attacks. Results revealed that adversarial perturbations caused obvious changes in SHAP attributions, and the model's attention shifted away from semantically important areas. At the same time, LRP manifested irregular behaviour in early transformer layers, indicating internal instability. By tracing those patterns, our method effectively identified not only misclassifications but also internal, subtle perturbations caused by adversarial inputs transmitting real-time alerts upon assessment.
This paper demonstrates that combining input and layer-level attribution methods provides actionable interpretability and improves the safety profile of ViT models. Even though the current work is evaluated on CIFAR-10 and FGSM attacks, future work will apply this hybrid mechanism to more advanced datasets, more powerful adversarial environments, and real-world applications such as diagnosis of medical imaging and autonomous systems.
Actions (login required)
![]() |
View Item |
Tools
Tools