Abstract
MambaMIL+ is a novel framework designed to adapt State Space Models (SSMs), specifically the Mamba architecture, for the analysis of gigapixel whole-slide images (WSIs) in digital pathology. While Mamba offers linear computational scaling compared to the quadratic cost of Transformers, it traditionally struggles with 2D spatial context and "memory decay" in ultra-long sequences. MambaMIL+ addresses these challenges through three key innovations: overlapping scanning, a selective stripe position encoder ($S^2PE$), and a supervised contextual token selection (CTS) mechanism. Evaluated across 20 clinical benchmarks, MambaMIL+ sets new performance records in diagnostic classification, molecular prediction, and survival analysis while maintaining high inference efficiency.
Introduction
In computational pathology, Whole Slide Images (WSIs) are massive "gigapixel" files containing billions of pixels. To process these, researchers typically employ Multiple Instance Learning (MIL), partitioning the image into thousands of small patches (instances) treated as a single "bag."
Two primary hurdles have limited the effectiveness of current models:
- Computational Complexity: Transformers, the standard for sequence modeling, possess a quadratic cost ($O(N^2)$). For slides with 10,000+ patches, they become prohibitively memory-intensive.
- Contextual Blindness and Memory Decay: The Mamba architecture offers linear scaling ($O(N)$) but was designed for 1D sequences. When applied to 2D pathology slides, it often ignores spatial relationships. Furthermore, Mamba suffers from exponential memory decay; in the ultra-long sequences typical of WSIs, the model "forgets" information from the beginning of the sequence by the time it reaches the end.
Methods
MambaMIL+ introduces a suite of architectural enhancements to make the Mamba framework "pathology-aware."
Overlapping Scanning
Traditional grid-based partitioning often treats patches as independent entities, leading to spatial discontinuity. MambaMIL+ utilizes overlapping patches during the scanning process. This ensures that spatial continuity is preserved in the feature space, allowing the model to capture transitions between adjacent tissue regions more effectively.
Selective Stripe Position Encoder ($S^2PE$)
To provide the model with a sense of 2D geometry without the overhead of complex 2D scanning paths, the authors introduce $S^2PE$. This component uses a lightweight 1D dilated convolution along the vertical axis. Since Mamba naturally processes rows (horizontal scanning), this vertical encoder provides the necessary 2D link, enriching the feature representation with spatial context.
Contextual Token Selection (CTS)
To mitigate memory decay, MambaMIL+ incorporates a supervised "instance learner" branch. This mechanism identifies informative patches and filters out background noise or low-entropy regions. By masking these "junk" tokens, the Mamba hidden state can focus its limited memory capacity on the most relevant diagnostic regions, effectively compressing the sequence without losing vital information.
Experimental Results
The model was rigorously evaluated on 20 benchmarks across three critical clinical domains:
- Diagnostic Classification: Including breast cancer (BRACS), metastasis detection (Camelyon), and lung cancer subtyping (NSCLC).
- Molecular Prediction: Predicting gene mutations (e.g., KRAS, TP53) and biomarker expressions (ER, PR, HER2) directly from H&E slides.
- Survival Analysis: Predicting patient outcomes across six different TCGA cancer types.
Performance and Efficiency
MambaMIL+ consistently outperformed 11 state-of-the-art MIL methods, including TransMIL and the original MambaMIL. On ResNet-50 features, it achieved an average relative improvement of 1.5% in AUC and 2.9% in Accuracy over the next best method. In molecular prediction, the gains were even more pronounced (1.4% to 3.4% in AUC), suggesting the model is particularly adept at identifying subtle morphological cues linked to genetics. Despite processing 4x more tokens due to overlapping scanning, MambaMIL+ maintained higher throughput and lower inference times than Transformer-based alternatives.
Discussion and Conclusion
MambaMIL+ demonstrates that spatial context remains a critical signal even after patches are converted into abstract embeddings. The success of the CTS mechanism highlights that "smart filtering" is essential for applying SSMs to ultra-long sequences like WSIs. While the current instance learner is relatively simple, future work may involve more sophisticated supervision or end-to-end training with foundation model feature extractors (e.g., CONCH) to further push the boundaries of gigapixel image analysis.
Summary updated