xMIL: Insightful Explanations for Multiple Instance Learning in Histopathology

Julius Hense, Mina Jamshidi Idaji, Oliver Eberle, Thomas Schnake, Jonas Dippel, Laure Ciernik, Oliver Buchstab, Andreas Mock, Frederick Klauschen, Klaus Robert Muller

Multiple Instance Learning (MIL) has become a cornerstone technique for weakly supervised machine learning in digital pathology. While MIL models excel at tasks like tumor detection and biomarker prediction, understanding why they make specific predictions remains a significant challenge. To address this, researchers have introduced xMIL, a novel framework, and xMIL-LRP, an adaptation of Layer-wise Relevance Propagation (LRP) designed specifically for histopathology. Unlike standard attention maps, xMIL-LRP provides "faithful" explanations that account for complex patch interactions and distinguish between evidence for and against a diagnosis.

The Challenge of Explainability in Digital Pathology

In digital pathology, Whole Slide Images (WSIs) are gigapixel-scale files that are far too large to be processed by standard deep learning models all at once. To overcome this, researchers employ MIL: a slide is divided into thousands of small "patches" (instances) that are grouped into a "bag." The model then predicts a single label for the entire bag.

While MIL models are highly accurate, their decision-making process is notoriously opaque. Historically, researchers have relied on attention scores to generate heatmaps, operating under the assumption that high attention equates to high importance. However, recent studies reveal that attention is often "unfaithful"—removing high-attention patches does not consistently change the model's prediction. Furthermore, attention mechanisms are strictly positive and cannot represent "negative evidence" (features suggesting a disease is absent), which is a critical component of clinical decision-making.

The xMIL Framework and xMIL-LRP

To move beyond simple instance labels, the authors propose the xMIL framework, which generates "context-aware evidence scores." To estimate these scores accurately, they introduce xMIL-LRP.

The xMIL framework: Panel A shows the standard MIL pipeline, while Panel B illustrates how xMIL-LRP backpropagates relevance from the output to individual patches.

The technical innovations of this approach include:

  • Adaptation of LRP: The researchers adapted Layer-wise Relevance Propagation (LRP) to function seamlessly with common MIL architectures, including Attention MIL and TransMIL (a Transformer-based model).
  • The AH-rule: They utilize the "Attention-Head" (AH) rule to propagate relevance through the attention mechanism. By treating attention scores as constant weights during the backward pass, they ensure the resulting explanation is deeply rooted in the model's actual logic.
  • Positive and Negative Evidence: Unlike attention, which only highlights "importance," xMIL-LRP produces real-valued scores. Red indicates evidence for a specific class, while blue indicates evidence against it.

Datasets and Evaluation

The methodology was rigorously evaluated across both synthetic and real-world datasets:

  1. Toy MNIST Tasks: Three custom benchmarks (4-Bags, Pos-Neg, and Adjacent Pairs) designed to test the handling of instance interactions and negative evidence.
  2. CAMELYON16: A standard benchmark for detecting breast cancer metastasis in lymph nodes.
  3. TCGA NSCLC: A dataset for subtyping lung cancer (LUAD vs. LUSC).
  4. TCGA HNSC HPV: A challenging biomarker task predicting HPV status in head and neck cancer.
  5. TCGA LUAD TP53: Predicting TP53 gene mutations from lung cancer slides.

Key Insights and Results

The paper's findings strongly reinforce that attention is not explanation. In complex tasks like biomarker prediction, standard attention maps consistently failed to provide faithful explanations, whereas xMIL-LRP succeeded.

Context also proved crucial. In the "Adjacent Pairs" toy task, where a patch's meaning changes based on its neighbors, xMIL-LRP was the only method robust enough to capture these contextual dependencies.

Perhaps most importantly, xMIL-LRP successfully visualizes negative evidence. For example, in a head and neck tumor slide, the model might identify evidence for HPV at the tumor border, but even stronger evidence against it inside the tumor. Standard attention maps completely miss this nuance, showing only generic "importance" without directional context.

Comparison of explanation methods on a head and neck tumor slide. xMIL-LRP (second column) is the only method that distinguishes between positive (red) and negative (blue) evidence.

To quantify these improvements, the researchers used the Area Under the Perturbation Curve (AUPC) to measure "faithfulness." A lower AUPC indicates that removing the patches deemed important by the explanation causes the model's confidence to drop rapidly.

  • Toy Tasks: xMIL-LRP consistently outperformed baselines (Attention, Integrated Gradients, etc.) across all settings.
  • Real-World Faithfulness: On the difficult TP53 mutation task using TransMIL, xMIL-LRP achieved an impressive AUPC of 0.24, significantly outperforming attention (0.64) and random baselines (0.94).
  • Pathologist Validation: Qualitative reviews by pathologists confirmed that xMIL-LRP highlighted clinically relevant features, such as lymphocyte density, that other methods either ignored or conflated.

Limitations and Future Directions

While xMIL represents a significant leap forward, it does have limitations. Explaining models with massive bag sizes (e.g., >24,000 patches) in a Transformer architecture remains computationally demanding, though xMIL-LRP scales better than perturbation-based methods like SHAP. Additionally, while the method works well for AttnMIL and TransMIL, new propagation rules may be required for emerging, more exotic MIL architectures.

Looking ahead, the authors suggest that the xMIL framework could be highly valuable in other domains with similar structural challenges, such as video analysis, audio processing, or multi-modal inputs where instance interactions are paramount.

Summary updated

BibTeX
@inproceedings{hense2024xmil,
  author = {Julius Hense and Mina Jamshidi Idaji and Oliver Eberle and Thomas Schnake and Jonas Dippel and Laure Ciernik and Oliver Buchstab and Andreas Mock and Frederick Klauschen and Klaus Robert Muller},
  title = {{xMIL: Insightful Explanations for Multiple Instance Learning in Histopathology}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=Y1fPxGevQj},
}
Figure