A self-supervised framework for learning whole slide representations

Xinhai Hou, Cheng Jiang, Akhil Kondepudi, Yiwei Lyu, Asadur Zaman Chowdury, Honglak Lee, Todd C Hollon

TL;DR

This paper introduces Slide Pre-trained Transformers (SPT), a novel self-supervised learning framework for whole slide images (WSIs). SPT effectively learns transferable representations from gigapixel-sized WSIs without requiring manual annotations, outperforming existing methods on various diagnostic tasks and demonstrating broad applicability across different patch encoders.

What Problem Does This Paper Address?

Whole slide images (WSIs) are crucial for modern computational pathology, enabling automated analysis for tasks like cancer detection and subtyping. However, WSIs are massive (gigapixel resolution), containing diverse and spatially heterogeneous features. Traditional methods often rely on weakly supervised multiple instance learning (MIL), which uses limited slide-level labels. This approach struggles to capture the full complexity of WSIs due to sparse, incomplete, and expensive annotations. Furthermore, existing self-supervised learning (SSL) methods have primarily focused on learning representations for individual patches, leaving a gap in learning effective whole-slide representations directly from unlabeled data. This paper aims to bridge this gap by developing a general and unified SSL framework for learning high-quality, transferable whole-slide representations.

Methods

The core of the proposed method is the Slide Pre-trained Transformers (SPT) framework, which operates in two stages:

  1. Pre-trained Patch Encoder: An existing patch encoder (e.g., ResNet) is used to extract features from individual WSI patches. This encoder is typically frozen during the whole-slide learning phase to manage computational complexity.
  2. Transformer Whole Slide Encoder: A transformer-based encoder then aggregates these patch-level features and their spatial coordinates to learn a whole-slide representation.

The novelty lies in SPT's self-supervised pretraining strategy. It treats WSIs as sequences of patch tokens and applies a combination of domain-informed data transformations inspired by both vision and language modeling. These transformations aim to create "views" of the WSI for SSL:

  • Splitting: Randomly partitions patch tokens into mutually exclusive sets for two views, reducing mutual information.
  • Cropping: Generates spatially diverse views by randomly selecting regions, capturing regional heterogeneity.
  • Masking: Randomly removes patch tokens to reduce redundancy and improve training efficiency.

These transformations are applied to generate positive pairs, which are then fed into the transformer encoder. The framework is compatible with various SSL objectives (e.g., SimCLR, BYOL, VICReg) and can also be adapted for supervised learning (suSPT) using contrastive loss.

Datasets

The authors evaluated SPT on five benchmarks across three clinical tasks and two imaging modalities:

  • SRH CNS benchmark: Stimulated Raman Histology (SRH) data for six central nervous system tumors and normal brains.
  • H&E glioma molecular classification benchmark: Diffuse glioma H&E stained WSIs from The Cancer Genome Atlas (TCGA) and Digital Brain Tumour Atlas (DBTA).
  • TCGA BRCA, TCGA NSCLC, and TCGA RCC benchmarks: Widely used TCGA datasets for invasive breast carcinoma (BRCA) subtyping, non-small cell lung carcinoma (NSCLC) subtyping, and renal cell carcinoma (RCC) subtyping.

Key Insights and Ideas

  • Domain-informed transformations are key: The paper argues that simple pixel-level augmentations are insufficient for WSIs. Instead, transformations like splitting, cropping, and masking, which leverage the inherent structure and heterogeneity of WSIs, are crucial for generating effective views for self-supervised learning.
  • Cropping is the most impactful transformation: Ablation studies highlight cropping as the most critical transformation, likely because capturing regional heterogeneity is a challenging yet vital aspect of WSI analysis.
  • SPT generalizes across patch encoders: The framework demonstrates significant performance improvements when used with various patch encoders, including off-the-shelf, in-domain, and even out-of-distribution foundation models, reducing the need for specialized patch encoders.
  • Self-supervision can rival supervision: The self-supervised SPT (ssSPT) approach achieves performance comparable to or even exceeding previous fully supervised methods on several benchmarks, showcasing the power of SSL for WSI representation learning.
  • Attention maps reveal biological relevance: Visualizing self-attention maps from the trained transformer encoder shows that the model learns to focus on clinically significant regions (e.g., dense tumors, tumor infiltration) and ignore non-diagnostic areas.

Key Results

  • Superior performance: SPT significantly outperforms existing self-supervised and supervised methods across five diagnostic tasks (histopathologic diagnosis, cancer subtyping, genetic mutation prediction). For example, ssSPT achieved a 10-point increase in Mean Class Accuracy (MCA) on the SRH CNS benchmark compared to the previous best self-supervised method.
  • Consistent improvement: SPT consistently boosts performance when used with a wide range of patch encoders, including off-the-shelf (ImageNet), near-domain (HIPT), and foundation models (PLIP, UNI). For instance, using the ImageNet encoder with SPT led to an 18.6% MCA boost on the SRH CNS benchmark.
  • Competitive with supervised methods: The supervised variant (suSPT) achieved performance comparable to or better than state-of-the-art MIL methods, even outperforming ABMIL with UNI features on several benchmarks.
  • Efficiency: SPT training is relatively efficient, taking 6-8 GPU hours, compared to the often 80+ GPU hours required for training patch encoders.

Limitations and Future Work

  • Limited modalities and SSL paradigms: The current experimentation was limited to two microscopy modalities and three major SSL paradigms. Future work could explore other modalities (e.g., fluorescent microscopy) and generative SSL approaches.
  • Hyperparameter tuning: SPT's performance can be sensitive to hyperparameter tuning, which may be domain and dataset-specific.
  • End-to-end training: The current approach freezes the patch encoder. Future work aims to enable efficient end-to-end training of both patch and slide encoders.
  • Broader impact: The authors envision SPT as a foundation for automated diagnostic support systems, promoting data privacy, and developing medical foundation models. They also suggest potential impact on other gigapixel image modalities like geospatial and astronomical images.

Summary updated

BibTeX
@inproceedings{hou2024self,
  author = {Xinhai Hou and Cheng Jiang and Akhil Kondepudi and Yiwei Lyu and Asadur Zaman Chowdury and Honglak Lee and Todd C Hollon},
  title = {{A self-supervised framework for learning whole slide representations}},
  booktitle = {AIM-FM @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=JHZfCc0kt5},
}
Figure