EfficientMIL: Efficient Linear-Complexity MIL Method for WSI Classification

Chengying She, Ben Wang, Xinran Zhang, Dongjie Fan, Jialu Zhang, Chengwei Chen, Lizhuang LiuarXiv 2025 · DOI

Introduction

Whole Slide Image (WSI) classification is a cornerstone of modern computational pathology, yet it faces significant scalability challenges. WSIs are typically "gigapixel" images, often exceeding 100,000 pixels in both dimensions. To process these, researchers employ Multiple Instance Learning (MIL), treating an image as a "bag" of thousands of small patches. While Transformer-based models currently define the state-of-the-art by capturing long-range dependencies via self-attention, their quadratic computational complexity ($O(N^2)$) creates a bottleneck as the number of patches ($N$) grows.

EfficientMIL addresses this challenge by replacing traditional attention mechanisms with linear-complexity sequence models, such as Mamba and Gated Recurrent Units (GRUs). By integrating these efficient backbones with a novel "Adaptive Patches Selector" (APS), the framework achieves state-of-the-art accuracy with a fraction of the computational cost of traditional Transformer-based approaches.

Methodology: The EfficientMIL Framework

The EfficientMIL pipeline is divided into three primary stages: feature extraction, intelligent patch selection, and sequence-based regression.

The EfficientMIL architecture, featuring the WSI Features Extractor, Adaptive Patches Selector, and MIL Regressor.

1. WSI Features Extractor

The process begins by segmenting the tissue from the background and cropping it into patches. These patches are then passed through a fine-tuned feature extractor (leveraging foundation models like UNI2) to generate high-dimensional feature vectors.

2. Adaptive Patches Selector (APS)

A key innovation of this work is the APS module, which moves beyond simple "top-k" selection. Instead, it evaluates patches based on a multi-criteria "Combined Score":

  • Relevance Score: Measures the model's confidence in a patch's contribution to a specific class.
  • Diversity Score: Uses cosine similarity to ensure the selected subset represents a wide range of morphological features, reducing redundancy.
  • Uncertainty Score: Prioritizes "hard" patches with high prediction entropy, which often contain critical diagnostic information.

3. MIL Regressor with Linear Complexity

The selected features are processed by a sequence model that scales linearly ($O(N)$). The authors evaluated Bidirectional LSTMs, Bidirectional GRUs, and the State Space Model (SSM) Mamba. These models capture inter-patch dependencies effectively without the memory overhead of self-attention. The final output is refined through an "Add & Norm" layer and a Multi-Layer Perceptron (MLP) for classification.

Experimental Setup and Datasets

The performance of EfficientMIL was validated across diverse benchmarks, utilizing a standardized software and hardware environment to ensure reproducibility.

Summary of reagents, resources, and software used in the study.
  • TCGA-Lung: A large-scale dataset for classifying lung cancer subtypes (LUAD vs. LUSC).
  • CAMELYON16: A challenging dataset for detecting breast cancer metastasis in lymph nodes.
  • Standard MIL Benchmarks: Versatility tests using the MUSK1, MUSK2, and ELEPHANT datasets.

Results and Performance Analysis

EfficientMIL demonstrates that high performance does not require quadratic complexity.

  • Accuracy and AUC: On the CAMELYON16 dataset, the GRU-based variant of EfficientMIL achieved an AUC of 0.990 and an accuracy of 0.975. This represents a 3.4% improvement in AUC over the previous leading method, Snuffy.
  • Computational Efficiency: The efficiency gains are most evident in the TCGA-Lung task. The Mamba-based EfficientMIL required only 3 Million FLOPs, a staggering reduction compared to TransMIL (2,989 Million FLOPs) and Snuffy (90,803 Million FLOPs).
  • Robustness: The framework maintained high performance across different feature extractors, indicating that the APS module and linear backbones are highly adaptable to various front-end configurations.

Discussion and Future Directions

The success of EfficientMIL suggests that the "global view" of self-attention may be redundant for many WSI tasks, where linear sequence models can sufficiently capture relevant patterns. The inclusion of diversity and uncertainty in patch selection mimics the diagnostic workflow of human pathologists, who scan slides for both typical and atypical features.

Limitations

Despite its efficiency, the model has two main constraints:

  1. Parallelization Constraints: Unlike Transformers, RNNs and SSMs are inherently sequential, which can limit GPU parallelization across the sequence length during training.
  2. Spatial Awareness: The current model treats patches as a sequence and does not explicitly encode their 2D spatial coordinates, potentially missing context related to tissue architecture.

Future research will focus on integrating spatial encoding and optimizing sequential processing to further accelerate inference in clinical environments.

Summary updated

BibTeX
@misc{she2025efficientmil,
  author = {Chengying She and Ben Wang and Xinran Zhang and Dongjie Fan and Jialu Zhang and Chengwei Chen and Lizhuang Liu},
  title = {{EfficientMIL: Efficient Linear-Complexity MIL Method for WSI Classification}},
  year = {2025},
  eprint = {2509.23640},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.23640},
}
Figure