eWSI Trains Cancer-Detecting Vision Models on a Single Consumer GPU
A new MIDL 2026 paper shows that combining LoRA with a lightweight max-pooling aggregator can match domain-specific pretraining on gigapixel pathology slides.
ProTakeaways
- MIDL 2026 paper proposes eWSI, combining LoRA fine-tuning with a max-pooling MIL aggregator for end-to-end WSI training.
- ImageNet encoders plus eWSI match or beat MILs using histopathology-pretrained encoders on Camelyon16, TCGA, and BRACS.
- New LinMax aggregator stacks linear layers with tanh and max-pools, staying robust when only 64 patches are sampled.
- LoRA on query and MLP layers at rank 4 works best; higher ranks and full fine-tuning degrade performance.
- Trains Camelyon16 in 25 minutes on an RTX 3090 versus an estimated 45 hours for C2C end-to-end training.
- Code, checkpoints, and Hist-SSL encoder released at github.com/umarikkar/eWSI.
Training vision models on whole slide images (WSIs), the gigapixel scans pathologists use to diagnose cancer, has long been a game of compromise. The images are too large to feed through a network in one shot, so almost every pipeline resorts to pre-computing frozen patch features and stitching them together with Multiple Instance Learning (MIL). A new paper accepted at MIDL 2026, Domain Adaptation Without the Compute Burden for Efficient Whole Slide Image Analysis by Umar Marikkar, Muhammad Awais, and Sara Atito, argues that this compromise is no longer necessary.
Their method, EfficientWSI (eWSI), threads parameter-efficient fine-tuning (LoRA) through a lightweight MIL aggregator so that the patch encoder itself becomes trainable end-to-end on a single consumer GPU. Starting from a plain ImageNet checkpoint, eWSI matches or beats MIL pipelines that rely on encoders pretrained on millions of histopathology patches.
Why WSI training is stuck
The extreme resolution of WSIs makes end-to-end training impractical compared to typical image analysis tasks. Most approaches sidestep the problem with pre-trained feature extractors that produce fixed representations of whole slides, which are then combined with MIL for downstream tasks. A single slide can contain roughly 10,000 patches at 224x224 resolution, which is why the field freezes the encoder and only learns the aggregator on top.
The workaround has two failure modes:
- ImageNet features miss the domain. Natural-image encoders were never trained on stained tissue, so they leave signal on the table.
- In-domain pretraining is expensive. Self-supervised runs on millions of pathology patches are the current fix, but they still yield fixed features that cannot adapt to the specific downstream task.
The eWSI recipe
Instead of pretraining a better frozen encoder, the authors let the encoder learn during the downstream task itself, keeping compute in check with three deliberate choices.
- Sparse random patch sampling. Rather than the 8,192 patches per slide used by frozen-encoder baselines, eWSI samples as few as 64 patches per iteration during training, using every available patch only at inference.
- LoRA on the right layers. A Low-Rank Adaptation (LoRA) encoder replaces the frozen patch encoder, selectively fine-tuning only the query (q) and feed-forward (mlp) parameters. This targeted adaptation focuses on the components that act as the latent signal (q) and the overall knowledge base (mlp). A LoRA rank of just 4 gave the best results; larger ranks actually hurt performance, which the authors attribute to LoRA acting as implicit regularization against domain shift.
- A MIL aggregator called LinMax. Attention-based MILs like ABMIL and ACMIL collapse when the number of sampled patches is small. LinMax replaces attention with a stack of three fully connected layers with tanh activations, followed by an element-wise max over patches. Max-pooling preserves the classic MIL assumption that a positive slide only needs one positive patch, and the extra depth gives the aggregator representational room without inflating parameter count.

What the numbers show
The authors evaluate on seven WSI tasks across Camelyon16 (tumor metastasis), TCGA (BRCA and NSCLC subtyping, plus mHRD, tHRD, TNBC molecular prediction), and BRACS (three-way tumor classification). A few results stand out:
- On Camelyon16 with a plain supervised ImageNet ViT-S/16, eWSI hits 93.4% AUC at 512 sampled patches, versus 77.2% for ACMIL under a frozen encoder with the same initialization.
- eWSI on ImageNet-SSL reaches 95.1% AUC, edging out MIL methods that rely on the in-house Hist-SSL encoder pretrained on 4 million TCGA patches.
- Layering eWSI on top of Hist-SSL still helps, pushing Camelyon16 to 98.5% AUC and improving four of five TCGA tasks.
Compute costs are the other headline. On an RTX 3090 at 64 sampled patches, eWSI trains for 100 epochs in about 25 minutes and needs roughly 1.1 GB of VRAM. The comparable end-to-end baseline C2C would take an estimated 45 hours because it re-clusters all patch features every epoch. StreamingCLAM, another end-to-end approach, reportedly needs 165 seconds per forward pass on a 40 GB V100.
The catch: threshold bias from sparse sampling
Sparse random sampling has a subtle side effect. On Camelyon16, where tumor regions cover roughly 5% of the tissue, many sampled bags contain no tumor patches even in positive slides, which pushes predicted probabilities upward. AUC stays high (95.8%), but accuracy at the default 0.5 threshold collapses to 45%. The paper offers two fixes: manually bump the decision threshold to around 0.98, or run a short frozen-encoder fine-tune afterward with dense sampling, which restores accuracy to 94.6% without threshold tuning.
The bigger idea
The real contribution is the argument that task-specific adaptation can substitute for domain-specific pretraining when you engineer the MIL stack around sparse sampling. LoRA and MIL are both well known; what the authors show is that most existing MIL aggregators are too brittle at low sampling rates to benefit from a trainable encoder, and that a simpler max-pooling design fixes it.
Code, pretrained models, and fine-tuned checkpoints are released at github.com/umarikkar/eWSI, including the Hist-SSL encoder trained on 4 million TCGA patches. For anyone working on computational pathology without access to a foundation-model-scale compute budget, eWSI closes much of the gap on a single GPU.