Multi-Head Explainer: A General Framework to Improve Explainability in CNNs and Transformers

Bohang Sun, Pietro LiòarXiv 2025 · DOI

Abstract

The Multi-Head Explainer (MHEX) is a versatile, modular framework designed to enhance the interpretability of deep learning models. By integrating components such as Attention Gates and Deep Supervision into existing Convolutional Neural Network (CNN) and Transformer architectures, MHEX generates high-resolution, "near-segmentation" quality saliency maps. Crucially, the framework not only provides superior explanations but also consistently boosts model accuracy across diverse benchmarks, including medical imaging and text classification.

Introduction

Despite the state-of-the-art performance of deep learning models, their "black box" nature remains a significant barrier to adoption in high-stakes fields like medical diagnostics. Standard explainability (XAI) tools, such as Grad-CAM, often produce coarse, "blob-like" heatmaps that fail to capture the subtle textures and fine-grained details—such as specific cellular structures—required by clinicians for trust. Furthermore, Transformer-based models often suffer from "over-smoothing," where attention weights become increasingly uniform across layers, diluting their interpretative value.

The Multi-Head Explainer (MHEX) addresses these limitations by providing a unified, scalable "scaffold" that can be seamlessly integrated into existing architectures like ResNet or BERT without requiring a total overhaul of the base model.

Methods

The MHEX framework acts as an auxiliary structure integrated during training and fine-tuning. Its architecture is built upon three core pillars:

  1. Attention Gate: This component dynamically generates channel-wise weights to highlight task-relevant features while suppressing background noise.
  2. Deep Supervision: By adding auxiliary prediction heads to early layers, the model is forced to capture fine-grained details pertinent to the target class early in the network hierarchy.
  3. Equivalent Matrix ($W_{equiv}$): This mathematical construct ($W_2 W_1$) unifies local and global representations into a single interpretable weight matrix.
The internal architecture of the MHEX module, featuring the Attention Gate, Deep Supervision, and the equivalent matrix components.

A key technical innovation is the Non-Negativity Constraint. By applying a ReLU activation to the weights, the authors mathematically demonstrate a reduction in differential entropy (information uncertainty). This constraint filters out "negative" feature contributions, resulting in significantly cleaner and sharper saliency maps. Additionally, the introduction of Salience Sharpness (SS) as a hyperparameter allows the model to focus on features with high specificity to the target class.

Results and Discussion

The authors evaluated MHEX across several domains, including ImageNet1k, MedMNIST (biomedical imaging), and AG News (text classification).

Accuracy and Explainability

One of the most notable findings is that MHEX serves as both an explainer and an accuracy booster. On the PathMNIST dataset, MHEX-Net achieved an accuracy of 95.18%, a substantial improvement over the ResNet-18 benchmark of 90.90%. This suggests that the "Deep Supervision" mechanism forces the network to learn more robust and discriminative features during the training process.

Qualitatively, MHEX produces saliency maps with exceptional localization precision. As shown in the comparison with Grad-CAM, MHEX generates detailed maps that closely resemble manual segmentations of the target objects, providing the fine-grained detail necessary for high-stakes interpretation.

Qualitative comparison of saliency maps generated by MHEX versus Grad-CAM on ImageNet samples (Limpkin and Sandpiper). MHEX provides significantly higher resolution and better localization.

Quantitative Evaluation

To quantify XAI performance, the authors utilized the Effective Average Drop (EAD) metric, which penalizes maps that are either overly sparse or excessively noisy. MHEX consistently outperformed traditional methods; for instance, on the BloodMNIST dataset, MHEX achieved an EAD score of 0.1894, compared to 0.1106 for Grad-CAM.

Conclusion

The Multi-Head Explainer (MHEX) provides a powerful, modular solution for improving both the performance and transparency of deep learning models. By reducing entropy through non-negativity constraints and leveraging deep supervision, it bridges the gap between high-performance "black boxes" and interpretable AI. Future research will explore extending MHEX to Large Language Models (LLMs) and Graph Neural Networks (GNNs), as well as adapting the framework for direct medical image segmentation tasks.

Summary updated

BibTeX
@misc{sun2025multi,
  author = {Bohang Sun and Pietro Liò},
  title = {{Multi-Head Explainer: A General Framework to Improve Explainability in CNNs and Transformers}},
  year = {2025},
  eprint = {2501.01311},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.01311},
}
Figure