Abstract: In image classification scenarios where both prediction and explanation efficiency are required, self-explaining models that perform both tasks in a single inference are effective. However, for users who already have prediction-only models, training a new self-explaining model from scratch imposes significant costs in terms of both labeling and computation. This study proposes a method to transfer the visual explanation capability of self-explaining models learned in a source domain to prediction-only models in a target domain based on a task arithmetic framework. Our self-explaining model comprises an architecture that extends Vision Transformer-based prediction-only models, enabling the proposed method to endow explanation capability to many trained prediction-only models without additional training. Experiments on various image classification datasets demonstrate that, except for transfers between less-related domains, the transfer of visual explanation capability from source to target domains is successful, and explanation quality in the target domain improves without substantially sacrificing classification accuracy.
Introduction
In computer vision, generating visual explanations (e.g., heatmaps) is crucial for model interpretability. Currently, two main approaches exist: post-hoc methods like SHAP or Grad-CAM, and Self-Explaining Models (SEMs). While post-hoc methods are flexible, they are computationally expensive during inference. Conversely, SEMs provide predictions and explanations in a single pass but require specialized training on large datasets with ground-truth explanation labels—labels that are rare and costly to produce. This paper addresses the challenge of endowing existing prediction-only models with self-explaining capabilities without the need for expensive retraining on the target domain.
Methodology
The proposed method leverages Task Arithmetic, which posits that specific model capabilities are encoded as vectors within the parameter space.
Architecture
The framework utilizes a Vision Transformer (ViT) backbone. As shown in Figure 1, the standard prediction-only model is extended to a self-explaining architecture. While the base model typically uses the [CLS] token for classification, the self-explaining version incorporates a domain-specific head $g_W$ that processes individual image patches to generate "patch-level attributions" ($\tilde{\phi}_1, \dots, \tilde{\phi}_M$).
Explainability Vector Transfer
The transfer process involves three steps:
- Source Training: In a source domain with available explanation labels, two models are trained: a prediction-only model ($\theta_{ft}$) and a self-explaining model ($\theta_{ft*}$).
- Vector Extraction: An "explainability vector" is calculated as the difference between these weights: $\tau_* = \theta_{ft*} - \theta_{ft}$.
- Target Upgrade: This vector is added to the weights of a prediction-only model in a new target domain. This "arithmetic" upgrade requires no additional training on target data.
The Analogy Principle
The mathematical foundation relies on a linguistic-style analogy: "Source-Prediction is to Source-Explanation as Target-Prediction is to Target-Explanation." If this relationship holds in the model's weight space, the vector addition effectively transfers the skill.
Experimental Setup
The method was evaluated across 56 cross-domain pairs using diverse datasets including Cars, DTD (textures), EuroSAT (satellite), and MNIST (digits). To create a robust source for transfer, the authors introduced ImageNet+X, an extension of ImageNet-1k augmented with patch-level attributions generated via Kernel SHAP.
Results and Discussion
The experiments demonstrate that visual explanation capability can be successfully transferred across domains.
Performance and Fidelity
As illustrated in Figure 2, the transferred models maintain high classification accuracy while significantly reducing explanation error (E-RMSE) compared to zero-shot baselines. Most transferred models achieved over 90% of the explanation quality of fully supervised models. Furthermore, the method offers a massive speedup over post-hoc explainers like Kernel SHAP, as it requires only a single forward pass.
Domain Sensitivity
The success of the transfer is tied to the visual similarity between domains. For instance, transferring from a diverse source like SUN397 or ImageNet+X works well for various tasks. However, transfers between highly dissimilar domains (e.g., MNIST to Cars) can lead to performance degradation, as the underlying feature representations do not align.
Conclusion
This study introduces a cost-effective way to add explainability to trained models using task arithmetic. By extracting an explainability vector from a source domain, users can upgrade target models instantly. Future work will focus on bridging larger domain gaps and developing more universal explainability vectors using even larger-scale datasets.
Summary updated