WsiSSM: A Weakly Supervised Subset-Matching Framework for Unified Classification and Segmentation of Histopathology Whole Slide Images

Guangjian Zeng, Siyuan Tao, Chengzhi Zhao, Xiaoqing Li, Na Tang, Wenting Huang, Shenying FangNeurIPS 2026

TL;DR

Finding microscopic tumors in gigapixel pathology slides is like hunting for a needle in a haystack—and manually outlining those needles to train AI is prohibitively expensive. WsiSSM solves this by teaching a model to not only classify whether a slide contains cancer using just slide-level labels, but also to accurately trace the tumor boundaries without ever seeing a single pixel-level annotation. By forcing global and local views of the tissue to agree, it turns fuzzy "interpretability heatmaps" into sharp, clinically useful segmentations.

What Problem Does This Paper Address?

Digital pathology deals with Whole Slide Images (WSIs) that routinely exceed $100,000 \times 100,000$ pixels. Because asking pathologists to draw pixel-by-pixel outlines on images of this scale takes hours per slide, researchers rely on Multiple Instance Learning (MIL)—chopping the giant image into thousands of tiny patches and training models using only a single slide-level diagnosis (e.g., "tumor present").

While modern Transformer-based MIL models are great at classifying slides, they hit two walls:

  1. Computational limits & "Attention Shift": Standard self-attention chokes on ultra-long patch sequences. Sparse attention fixes the compute issue, but often loses global context, causing the model's focus to drift or scatter across irrelevant areas.
  2. Poor Localization: Existing models treat segmentation as an afterthought—usually generating post-hoc attention heatmaps that highlight only the most obvious tumor patches while missing micro-lesions or full boundaries. For a pathologist to trust an AI, knowing where the cancer is matters just as much as knowing if it's there.

Methods

WsiSSM unifies slide classification and region segmentation into a single weakly supervised framework. After standard tissue masking and patch feature extraction (using a frozen Prov-GigaPath foundation model), WsiSSM introduces two novel components:

The WsiSSM pipeline: Global slide patches and 4 spatial subsets pass through Sparse-CAM backbones, forced into agreement via a reconstruction loss.
  • Sparse-CAM Backbone: To handle thousands of patches without losing the big picture, the authors design a multi-scale sparse self-attention encoder. It partitions patch sequences into blocks of varying geometric window sizes and subsampling strides, mixing local details with long-range dependencies. Crucially, instead of generating heatmaps after training, they integrate Class Activation Maps (CAM) directly into the forward pass via a 1D convolution layer and Global Average Pooling (GAP).
  • Subset-Matching Module: Even with Sparse-CAM, models can get lazy and focus only on the loudest tumor signals. To fix this, WsiSSM slices the WSI spatially into four quadrants (unequal-length patch subsets) and runs them through the same backbone independently. Once stitched back together, an $L_1$ reconstruction loss ($\mathcal{L}_3$) forces the merged local CAMs to match the global whole-slide CAM. Training happens in two stages: first converging on standard global classification ($\mathcal{L}_1$), then fine-tuning with subset classification ($\mathcal{L}_2$) and reconstruction ($\mathcal{L}_3$).

Datasets

The authors evaluate WsiSSM across five multi-center datasets:

  • CAMELYON (Camelyon16 + 17): 899 lymph node slides for breast cancer metastasis detection.
  • PANDA: 692 prostate tissue slides for Gleason grading.
  • External A & B: Two private hospital cohorts collected in 2024 for breast cancer lymph node metastasis (743 and 564 slides, respectively, with a subset manually annotated for evaluation).
  • NCPDC (Newly Introduced): Addressing the scarcity of benchmarks with both slide labels and pixel-level ground truth, the authors introduce and plan to release NCPDC—a dataset of 768 frozen-section primary breast cancer WSIs, where test slides were painstakingly annotated by pathologists (~4 hours per slide).

Key Insights and Ideas

  • Consistency breeds completeness: Why does chopping a slide into four pieces make segmentation skyrocket? Without the reconstruction loss ($\mathcal{L}_3$), different quadrants exhibit wildly different activation contrasts—a subtle tumor in one corner gets ignored if there's an obvious tumor in another. Forcing the whole-slide view and quadrant views to match anchors the attention, preventing drift and lighting up entire tumor structures, including tiny micro-metastases.
  • Goldilocks subdivision: In ablation studies, splitting slides into 4 subsets handily beat 9 or 16 subsets (Dice dropped from 81.98% at $k=4$ to 46.75% at $k=16$). Chopping the image too finely starves the subsets of broader tissue context.
  • Moving beyond qualitative heatmaps: Instead of cherry-picking pretty heatmaps, the paper pushes for rigorous quantitative segmentation benchmarks (Dice and IoU) as a new standard for weakly supervised MIL models.

Key Results

WsiSSM achieves state-of-the-art classification across all five datasets—reaching 97.44% AUC on CAMELYON (surpassing pathologists working without time constraints at 96.60%) and 99.64% AUC on PANDA.

However, the headline story is the weakly supervised segmentation performance:

Segmentation performance across five datasets showing WsiSSM's substantial leap in Dice and IoU scores.
  • On CAMELYON, WsiSSM achieves an 81.98% Dice score and 69.57% IoU, leaping past the next best MIL method, BioX-CPath (62.63% Dice) and classic baselines like CLAM (20.85% Dice).
  • On PANDA, it hits 79.26% Dice, more than doubling the runner-up (CLAM at 31.78%).
  • Ablations confirm that the $\mathcal{L}_3$ subset-matching loss does the heavy lifting, single-handedly boosting CAMELYON Dice from 38.89% to 81.98%.

Limitations and Future Work

Not discussed in the paper.

Summary updated

Abstract

Multiple instance learning (MIL) has been increasingly used to analyze histopathology whole slide images (WSIs) and has achieved accurate diagnostic classification and a certain degree of automatic segmentation capability. However, segmentation performance without annotation remains suboptimal due to the immense size of WSIs, despite its essential role in assisting pathologists’ diagnosis. Moreover, existing approaches treat classification and segmentation as independent tasks, with segmentation primarily serving as an interpretability section. To address this limitation, we propose a novel weakly supervised learning algorithm that unifies classification and segmentation within a framework. Specifically, we explore the interconnections between patches and introduce class activation maps in WSI analysis through the proposed Sparse-CAM backbone to activate the segmentation capability, and further enhance feature representation using the proposed subset-matching module to improve both classification and segmentation performance. The proposed method demonstrated superior performance in diagnosis and achieved state-of-the-art performance in segmentation compared to other MIL methods across multiple datasets. In addition, it offered high-precision segmentation that is sensitive to micro-tumor regions without pixel-level annotations. The code will be publicly available on GitHub upon acceptance.
BibTeX
@inproceedings{zeng2026wsissm,
  author = {Guangjian Zeng and Siyuan Tao and Chengzhi Zhao and Xiaoqing Li and Na Tang and Wenting Huang and Shenying Fang},
  title = {{WsiSSM: A Weakly Supervised Subset-Matching Framework for Unified Classification and Segmentation of Histopathology Whole Slide Images}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=VQWwM5ssWe},
}
Figure