Beyond Multiple Instance Learning: Full Resolution All-In-Memory End-To-End Pathology Slide Modeling

Gabriele Campanella, Eugene Fluder, Jennifer Zeng, Chad M. Vanderbilt, Thomas J. FuchsarXiv 2024 · DOI

Introduction

In computational pathology, the standard approach to analyzing gigapixel whole slide images (WSIs) has long been Multiple Instance Learning (MIL). Because a single slide can contain over 100,000 pixels in each dimension, it is impossible to fit the entire image into GPU memory for standard backpropagation. Consequently, MIL strategies typically use frozen, pre-trained encoders to extract features from small image tiles, which are then processed by a slide-level aggregator. This "discontinuity" prevents the encoder from learning task-specific features, often leaving significant performance on the table.

Distributed All-In-Memory Architecture

To overcome the limitations of frozen encoders, this research introduces a novel framework for training pathology models end-to-end on full-resolution slides entirely in memory. The system leverages massive GPU parallelism by splitting the workload across a cluster.

Distributed training architecture for end-to-end pathology modeling.

As illustrated in the architecture above, $N$ "encoder" GPUs process batches of tiles in parallel (the DDP Group), while a dedicated "Rank 0" GPU acts as the aggregator. To maintain the gradient chain across multiple GPUs, the authors implemented a "Gradient Scatter" mechanism. Rank 0 calculates the slide-level loss and sends the resulting gradients back to the encoder GPUs. A "pseudo-loss" trick is then used to trigger backpropagation on the encoder nodes, allowing the entire model—from individual pixels to the final diagnosis—to be optimized simultaneously.

Scalability and Memory Efficiency

Unlike previous "streaming" methods that trade compute for memory by re-calculating activations, this all-in-memory approach is designed for speed and architectural flexibility. It supports standard CNNs like ResNet and modern Vision Transformers (ViT), while utilizing Automatic Mixed Precision (AMP) to maximize the number of tiles processed per slide.

Memory consumption across different models and tile counts compared to clinical slide distributions.

The framework demonstrates impressive scalability. By utilizing 11 GPUs, the system can process up to 45,056 tiles per slide. As shown in the tile distribution histogram (Figure c above), this capacity covers the vast majority of clinical slides at 20x magnification, ensuring that almost any slide can be modeled in its entirety without lossy downsampling or patch-level freezing.

Experimental Results

The benefits of end-to-end training were validated across several large-scale clinical tasks:

  • EGFR Mutation Prediction: On the LUAD dataset (2,449 slides), the end-to-end approach achieved an AUC of 0.783, significantly outperforming standard MIL (0.680) and specialized aggregators using frozen features (0.766).
  • Fine-Tuning Foundation Models: Even highly optimized foundation models benefit from this approach. Fine-tuning a pre-trained ViT-base model end-to-end raised the AUC from 0.76 to 0.82, proving that "frozen" encoders are suboptimal for specific downstream tasks.
  • Breast Cancer Detection: Training on a massive dataset of over 77,000 H&E slides, the system achieved a high-performance AUC of 0.968 for benign-vs-malignant classification.

Conclusion and Future Work

This framework represents a shift toward truly integrated pathology modeling. By enabling end-to-end optimization at scale, it removes the artificial barrier between tile-level feature extraction and slide-level diagnosis. While the method currently requires high-end GPU clusters (such as NVIDIA H100s), it paves the way for future pathology foundation models trained from scratch on global slide-level signals rather than isolated patches.

Summary updated

BibTeX
@misc{campanella2024beyond,
  author = {Gabriele Campanella and Eugene Fluder and Jennifer Zeng and Chad M. Vanderbilt and Thomas J. Fuchs},
  title = {{Beyond Multiple Instance Learning: Full Resolution All-In-Memory End-To-End Pathology Slide Modeling}},
  year = {2024},
  eprint = {2403.04865},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.04865},
}
Figure