Token Transformation Matters: Towards Faithful Post-hoc Explanation for Vision Transformer
About
While Transformers have rapidly gained popularity in various computer vision applications, post-hoc explanations of their internal mechanisms remain largely unexplored. Vision Transformers extract visual information by representing image regions as transformed tokens and integrating them via attention weights. However, existing post-hoc explanation methods merely consider these attention weights, neglecting crucial information from the transformed tokens, which fails to accurately illustrate the rationales behind the models' predictions. To incorporate the influence of token transformation into interpretation, we propose TokenTM, a novel post-hoc explanation method that utilizes our introduced measurement of token transformation effects. Specifically, we quantify token transformation effects by measuring changes in token lengths and correlations in their directions pre- and post-transformation. Moreover, we develop initialization and aggregation rules to integrate both attention weights and token transformation effects across all layers, capturing holistic token contributions throughout the model. Experimental results on segmentation and perturbation tests demonstrate the superiority of our proposed TokenTM compared to state-of-the-art Vision Transformer explanation methods.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Explanation Faithfulness | ImageNet 2015 (test) | AOPC0.755 | 22 | |
| Segmentation | ImageNet segmentation | Pixel Accuracy81.43 | 22 | |
| Perturbation Test | ImageNet (test) | AOPC0.764 | 18 | |
| Perturbation Test | ImageNet (val) | Neg Score58.12 | 18 | |
| Perturbation Test | CIFAR-100 1.0 (test) | AUC (Predicted, Neg)0.5478 | 9 | |
| Perturbation Test (Impact on Accuracy) | CIFAR-10 | Accuracy (Predicted Neg)74.9 | 9 | |
| Semantic segmentation | ImageNet Segmentation 21 (test) | Pixel Accuracy81.79 | 9 |