Probabilistic Attention Based on Gaussian Processes for Deep Multiple Instance Learning

Arne Schmidt, Pablo Morales-Álvarez, Rafael Molina

Abstract

Multiple Instance Learning (MIL) is a cornerstone of medical image analysis, particularly for whole-slide imaging where labels are often weak. While deterministic attention mechanisms have improved MIL performance, they lack the ability to quantify predictive uncertainty. This paper introduces the Attention Gaussian Process (AGP), which integrates a Sparse Gaussian Process into the attention layer. This probabilistic approach enables state-of-the-art accuracy while providing a principled measure of confidence, allowing for safer clinical decision-making by identifying ambiguous cases.

Introduction

In clinical settings, such as cancer detection from biopsy slides, models often deal with "weak labels" where a diagnosis is provided for an entire slide (a "bag") without pixel-level annotations for individual patches ("instances"). Standard deep MIL models utilize deterministic attention mechanisms to weight the importance of these patches. However, these models provide single-point predictions without any measure of confidence. A model that is 51% certain is indistinguishable from one that is 99% certain, which is problematic for high-stakes medical applications. Furthermore, deterministic models are prone to overfitting on small datasets.

To address these limitations, we propose the Attention Gaussian Process (AGP). By treating attention as a stochastic process, AGP provides both improved generalization and actionable uncertainty metrics, bridging the gap between deep learning and Bayesian inference.

Methods

The AGP framework transforms the standard MIL pipeline into a probabilistic one.

Architecture of the Attention Gaussian Process (AGP) for Multiple Instance Learning.
  1. Feature Extraction: Image patches are processed through a CNN (e.g., EfficientNet) to generate feature vectors $h_{bi}$.
  2. GP Attention Layer: Instead of a standard fully connected layer, a Sparse Gaussian Process (SGP) calculates attention weights. The SGP outputs a probability distribution over weights rather than a single value. To maintain computational efficiency for large-scale slides, "inducing points" are used to approximate the full GP.
  3. Training and Inference: The model is trained end-to-end using Variational Inference by maximizing the Evidence Lower Bound (ELBO). During inference, Monte Carlo sampling produces a final bag-level prediction $T_b$, where the variance across samples serves as a measure of predictive uncertainty.

Experimental Evaluation

The AGP model was validated across several datasets:

  • Synthetic MIL: MNIST and CIFAR-10 variants were used to test controlled behavior (e.g., detecting the digit '0' in a bag of digits).
  • SICAPv2: A challenging prostate cancer dataset with limited labeled biopsies (<100).
  • PANDA: A large-scale prostate cancer dataset with over 10,000 whole-slide images.
  • External Validation: Models trained on PANDA were tested on SICAPv2 to evaluate cross-center generalization.

Results and Discussion

AGP achieved state-of-the-art performance, particularly on small datasets where its natural regularization prevented overfitting. On SICAPv2, AGP reached a Cohen’s quadratic kappa of 0.847, surpassing deterministic baselines (0.814). On the large-scale PANDA dataset, it matched benchmark performance with a kappa of 0.817.

Visualization of attention weights and bag predictions on MNIST. The model provides both mean predictions and standard deviations, reflecting its confidence.

A key finding is the strong correlation between predictive uncertainty and error. In MNIST experiments, incorrectly classified bags exhibited a standard deviation ten times higher than correctly classified ones. By filtering for high-confidence predictions (standard deviation < 0.02) on the PANDA test set, the kappa score improved from 0.817 to 0.864. This demonstrates that uncertainty can serve as a reliable safety filter, flagging cases for human expert review.

Conclusion

The Attention Gaussian Process introduces a robust, probabilistic framework for MIL. By providing reliable uncertainty estimates and superior generalization on small datasets, AGP offers a significant step toward deploying deep learning models in sensitive clinical environments. Future work will explore deeper GP architectures and integration with self-attention mechanisms in Transformers.

Summary updated

BibTeX
@article{schmidt2024probabilistic,
  author = {Arne Schmidt and Pablo Morales-Álvarez and Rafael Molina},
  title = {{Probabilistic Attention Based on Gaussian Processes for Deep Multiple Instance Learning}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2024},
  doi = {10.1109/tnnls.2023.3245329},
}
Figure