A Hierarchical Transformer Encoder to Improve Entire Neoplasm Segmentation on Whole Slide Images of Hepatocellular Carcinoma

Zhuxian Guo, Qitong Wang, Henning Müller, Themis Palpanas, Nicolas Loménie, Camille Kurtz

Abstract

Segmenting entire neoplasms in Whole Slide Images (WSIs) is a fundamental challenge in digital pathology, particularly for Hepatocellular Carcinoma (HCC) due to its high intra-tumor heterogeneity. Traditional patch-based Convolutional Neural Networks (CNNs) often suffer from "tunnel vision," limited by small receptive fields that fail to capture large-scale architectural patterns. This paper introduces HiTrans, a novel framework that integrates a hierarchical Transformer encoder to process significantly larger image patches (4096×4096 pixels). By capturing both local regional features and long-range global dependencies, HiTrans achieves superior segmentation accuracy, reaching a Jaccard index of 0.7513 on the PAIP 2019 dataset.

Introduction

In digital pathology, WSIs are gigapixel scans that require automated analysis for efficient diagnosis. A critical step is the segmentation of the entire neoplasm. However, HCC presents significant challenges because its appearance varies widely across a single sample, including features like macro-trabeculae or necrotic foci. Current state-of-the-art models typically utilize small patches (e.g., 512×512) due to GPU memory constraints, preventing them from recognizing the global context necessary for precise boundary identification. The authors propose HiTrans to bridge this gap, expanding the model's field of view by 64x without sacrificing local detail.

Methods

The HiTrans architecture combines the strengths of specialized CNNs and hierarchical Transformers to handle massive input patches.

1. CNN Feature Extractor

The model utilizes an 18-layer ResNet backbone pre-trained via self-supervised learning (SimCLR) on 57 diverse histopathology datasets. This domain-specific pre-training ensures the extractor is highly sensitive to histological features compared to generic ImageNet-based models.

2. Hierarchical Transformer Encoder

The core innovation is a two-stage Transformer module designed for memory efficiency and global attention:

  • Transformer Encoder I: Processes 16×16 sub-patches to learn regional features and local dependencies.
  • Transformer Encoder II: Aggregates the summarized outputs (SEG embeddings) from the first stage to learn global dependencies across the entire 4096×4096 field of view.
The HiTrans architecture featuring the hierarchical Transformer encoder module.

3. Decoder and Training

A modified U-Net decoder with skip connections integrates fine-grained information from the Transformer stages to produce precise segmentation maps. To optimize the complex architecture, the authors employed an "alternate training" strategy, toggling between the ResNet extractor and the Transformer encoders.

Experimental Results

The study utilized the PAIP 2019 liver cancer segmentation challenge dataset, consisting of 50 WSIs of HCC. The model was trained to identify the "whole tumor area," including viable cells, necrosis, and tumor capsules.

Quantitative Performance

HiTrans significantly outperformed standard architectures:

  • HiTrans: 0.7513 Jaccard Index
  • DeepLabV3 (ResNet-50): 0.6803 Jaccard Index
  • Standard U-Net: 0.6659 Jaccard Index

Ablation studies confirmed that removing the second Transformer stage (global dependency) reduced performance to 0.7172, highlighting the importance of the hierarchical design.

Qualitative Analysis

Visual evaluations demonstrate that HiTrans produces smoother, more cohesive tumor masks. While baseline models often fragment the tumor area or miss large-scale structures, HiTrans successfully captures the global architecture of the neoplasm.

Qualitative comparison of segmentation results showing HiTrans's superior ability to capture the ground truth compared to baseline models.

Conclusion

HiTrans demonstrates that a hierarchical Transformer approach can effectively scale the field of view in WSI segmentation. By mimicking a pathologist's ability to "zoom out" and see the big picture, the model overcomes the limitations of traditional CNNs in identifying heterogeneous cancer structures. Future work will explore the integration of Graph Neural Networks (GNNs) and validation on larger, multi-center cohorts.

Summary updated

BibTeX
@inproceedings{guo2023hierarchical,
  author = {Zhuxian Guo and Qitong Wang and Henning Müller and Themis Palpanas and Nicolas Loménie and Camille Kurtz},
  title = {{A Hierarchical Transformer Encoder to Improve Entire Neoplasm Segmentation on Whole Slide Images of Hepatocellular Carcinoma}},
  booktitle = {ISBI},
  year = {2023},
  url = {https://openreview.net/forum?id=kiPy1OCOAE},
}
Figure