Skip to main content
QUICK REVIEW

[Paper Review] Language models are good pathologists: using attention-based sequence reduction and text-pretrained transformers for efficient WSI classification

Juan I. Pisula, Katarzyna Bożek|arXiv (Cornell University)|Nov 14, 2022
AI in cancer detectionComputer Science5 citations
TL;DR

This paper proposes SeqShort, a multi-head attention-based sequence reduction layer that compresses whole slide images (WSIs) into a fixed-length, ordered sequence of feature vectors, enabling efficient and accurate classification using text-pretrained transformers. By combining this with a frozen RoBERTa-based transformer and fine-tuning only 0.04% of parameters, the method achieves state-of-the-art performance in lymph node metastasis and cancer subtyping tasks with minimal compute and trainable parameters.

ABSTRACT

In digital pathology, Whole Slide Image (WSI) analysis is usually formulated as a Multiple Instance Learning (MIL) problem. Although transformer-based architectures have been used for WSI classification, these methods require modifications to adapt them to specific challenges of this type of image data. Among these challenges is the amount of memory and compute required by deep transformer models to process long inputs, such as the thousands of image patches that can compose a WSI at $ imes 10$ or $ imes 20$ magnification. We introduce extit{SeqShort}, a multi-head attention-based sequence shortening layer to summarize each WSI in a fixed- and short-sized sequence of instances, that allows us to reduce the computational costs of self-attention on long sequences, and to include positional information that is unavailable in other MIL approaches. Furthermore, we show that WSI classification performance can be improved when the downstream transformer architecture has been pre-trained on a large corpus of text data, and only fine-tuning less than 0.1\% of its parameters. We demonstrate the effectiveness of our method in lymph node metastases classification and cancer subtype classification tasks, without the need of designing a WSI-specific transformer nor doing in-domain pre-training, keeping a reduced compute budget and low number of trainable parameters.

Motivation & Objective

  • To address the high computational cost of applying transformers to whole slide images (WSIs) due to their long input sequences of image patches.
  • To enable the use of powerful, pre-trained language models in digital pathology without domain-specific fine-tuning or architectural redesign.
  • To preserve spatial and contextual information in WSI embeddings through learnable positional encoding and attention-based summarization.
  • To reduce the number of trainable parameters in WSI classification models while maintaining or improving performance.
  • To demonstrate that text-pretrained transformers can be effectively repurposed for histopathology classification with minimal fine-tuning.

Proposed method

  • A multi-head attention-based sequence shortening layer (SeqShort) is introduced to compress thousands of WSI patches into a fixed-length, ordered sequence of feature vectors.
  • SeqShort uses learnable query vectors to attend over the full set of patch embeddings, capturing salient features through self-attention mechanisms.
  • The method incorporates learnable positional embeddings to preserve spatial order, addressing a limitation of standard MIL approaches.
  • A pre-trained RoBERTa-base language model is used as the transformer encoder, with only 0.04% of its parameters fine-tuned.
  • Instance-level features are extracted from WSIs using an EfficientNetV2-L backbone pre-trained on ImageNet.
  • The final classification head is a multilayer perceptron (MLP) using the [CLS] token representation from the transformer encoder.

Experimental results

Research questions

  • RQ1Can attention-based sequence reduction effectively compress WSI patch sequences while preserving discriminative information for classification?
  • RQ2Does leveraging a text-pretrained transformer like RoBERTa improve WSI classification performance without domain-specific pre-training?
  • RQ3Can a minimal number of fine-tuned parameters (less than 0.1%) achieve state-of-the-art results in WSI classification tasks?
  • RQ4How does the inclusion of learnable positional embeddings in the sequence shortening layer affect model performance compared to standard MIL methods?
  • RQ5Can a generic, non-WSI-specific transformer architecture achieve strong performance in digital pathology when combined with efficient sequence compression?

Key findings

  • The proposed method achieves state-of-the-art performance on the CAMELYON16 lymph node metastasis classification benchmark with an AUC of 0.948 and accuracy of 0.882.
  • In the TCGA-BRCA invasive breast carcinoma subtyping task, the model achieves an AUC of 0.917 and accuracy of 0.841 using 10-fold cross-validation.
  • For renal cell carcinoma subtyping, the model reaches an AUC of 0.892 and accuracy of 0.815, demonstrating robustness across cancer types.
  • The model reduces the number of trainable parameters from 85 million to 3.3 million (0.04% of total parameters), significantly lowering computational cost.
  • Fine-tuning less than 0.1% of the RoBERTa-base parameters yields performance comparable to or better than models with full fine-tuning or custom-designed architectures.
  • The inclusion of learnable positional embeddings in SeqShort improves performance over standard MIL approaches that lack positional information.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.