Histopathological Image Classification based on Self-Supervised Vision Transformer and Weak Labels

Ahmet Gokberk Gul, Özdemir Çetin, Christoph Reich, Tim Prangemeier, Nadine Flinner, Heinz Koeppl

Abstract

Automated analysis of Whole Slide Images (WSIs) in digital pathology is often hindered by the massive resolution of images and the scarcity of pixel-level annotations. This paper introduces Self-ViT-MIL, a novel framework that combines self-supervised Vision Transformers (ViTs) with Multiple Instance Learning (MIL). By leveraging the DINO self-supervised learning algorithm to extract domain-specific features and a dual-stream MIL aggregator for slide-level classification, the proposed method achieves state-of-the-art performance on the Camelyon16 dataset. Notably, this weakly-supervised approach matches or exceeds the performance of fully-supervised baselines, offering a scalable solution for automated cancer detection.

Introduction

In digital pathology, a single Whole Slide Image (WSI) can reach resolutions as high as 100,000 x 100,000 pixels—roughly 1,200 times the resolution of a standard 4K monitor. Manually analyzing these data-heavy images is a Herculean task for pathologists. While deep learning offers a potential solution, traditional supervised models typically require "pixel-level" annotations, where experts must painstakingly delineate every cancerous cell.

To address this, researchers have turned to Multiple Instance Learning (MIL), where a slide is treated as a "bag" of smaller image patches. In this paradigm, only a single label (e.g., "cancer" or "no cancer") is required for the entire slide. However, the effectiveness of MIL depends heavily on the quality of the features extracted from these patches. Most existing models rely on Convolutional Neural Networks (CNNs) pre-trained on natural images (like ImageNet), which often fail to capture the subtle, complex textures of human tissue.

Methodology: The Self-ViT-MIL Framework

The proposed Self-ViT-MIL framework addresses these limitations through a two-stage process designed to maximize feature relevance and classification accuracy.

Stage 1: Self-Supervised Feature Extraction

Instead of utilizing a standard pre-trained CNN, the researchers employed a Vision Transformer (ViT) trained via DINO, a self-supervised learning technique. DINO allows the model to learn representations by comparing different "views" of the same tissue patch without requiring any labels. This process forces the ViT to learn rich, domain-specific features—such as cell density and nuclear polymorphism—directly from histopathology data. The attention mechanisms inherent in ViTs are particularly well-suited for capturing the repetitive and intricate textures found in microscopic samples.

Stage 2: Dual-Stream MIL Aggregator

Once the ViT is trained, its weights are frozen, and it serves as a high-fidelity encoder. The extracted feature vectors are then processed by a Dual-Stream MIL (DSMIL) aggregator, which employs two distinct logic paths:

  1. Instance Stream: Identifies the most "critical" patch (the one most likely to contain a malignancy) using max pooling.
  2. Bag Stream: Utilizes a global self-attention mechanism to evaluate all patches simultaneously, calculating a summary score for the entire slide.

The final diagnostic prediction is derived from the average of these two scores, balancing local evidence with global context.

Experimental Results

The model was evaluated using the Camelyon16 dataset, a standard benchmark for metastasis detection in breast cancer. The dataset consists of 270 training slides and 129 test slides, resulting in over 1.2 million individual patches at 20× magnification.

Self-ViT-MIL demonstrated superior performance compared to existing MIL-based approaches and even rivaled fully-supervised models:

Model Accuracy AUC (Area Under Curve)
DSMIL (CNN-based) 0.8682 0.8944
TransMIL 0.8837 0.9309
Self-ViT-MIL (Ours) 0.9147 0.9426
Fully-supervised Baseline 0.9147 0.9362

The results indicate that self-supervised ViTs provide a more robust feature set for pathology than traditional CNNs. Qualitatively, the model showed high precision in localization; while it did not always cover the entire extent of a tumor, it produced virtually zero false positives on the test set—a vital characteristic for clinical decision support systems.

Discussion and Future Work

While Self-ViT-MIL represents a significant step forward, several challenges remain. Training Vision Transformers in a self-supervised manner is computationally intensive, requiring substantial GPU resources. Furthermore, the current model operates at a single scale (20× magnification), whereas pathologists typically utilize multi-scale analysis (zooming in and out) to confirm diagnoses. Future iterations of this work aim to incorporate multi-scale data to improve tumor coverage and further refine diagnostic accuracy.

Conclusion

By combining self-supervised Vision Transformers with a dual-stream MIL architecture, this research demonstrates that high-performance cancer detection is possible without the need for exhaustive, pixel-level annotations. Self-ViT-MIL not only outperforms current state-of-the-art weakly supervised methods but also matches the performance of fully supervised systems, paving the way for more efficient and scalable AI tools in digital pathology.

Summary updated

BibTeX
@inproceedings{gul2022histopathological,
  author = {Ahmet Gokberk Gul and Özdemir Çetin and Christoph Reich and Tim Prangemeier and Nadine Flinner and Heinz Koeppl},
  title = {{Histopathological Image Classification based on Self-Supervised Vision Transformer and Weak Labels}},
  booktitle = {Digital and Computational Pathology},
  year = {2022},
}
Figure