Cell Graph Transformer for Nuclei Classification

Wei Lou, Guanbin Li, Xiang Wan, Haofeng Li

Abstract

Accurate classification of cell nuclei in histopathology images is a critical component of computer-aided cancer diagnosis. While Graph Neural Networks (GNNs) have been used to model the spatial distribution of cells, they are often limited by local message-passing constraints. Transformers offer a flexible alternative but face significant training instability on complex cell graphs. This paper introduces the Cell Graph Transformer (CGT), a framework that tokenizes both nodes and edges to capture long-range dependencies. To address convergence issues, we propose Topology-aware Pre-training (TAP), which utilizes a Graph Convolutional Network (GCN) to initialize the model's feature extractor. Our approach achieves state-of-the-art results across four major benchmarks.

Introduction

Identifying nuclei types—such as inflammatory, epithelial, or neoplastic—is essential for assessing tumor microenvironments. Traditional Convolutional Neural Networks (CNNs) focus on local pixel patterns, often neglecting the broader macrostructure of cell distribution. GNNs were introduced to model these spatial relationships, yet they typically restrict information flow to immediate neighbors along fixed edges.

Transformers provide a more flexible "all-to-all" communication mechanism, but applying them to cell graphs is challenging. Without high-quality initial features, the self-attention mechanism produces noisy scores across thousands of potential connections, leading to poor convergence. The CGT framework overcomes these hurdles through novel tokenization and a robust pre-training strategy.

Methodology

1. Cell Graph Transformer (CGT) Architecture

The CGT framework converts histopathology images into graphs where nuclei serve as nodes. A key innovation is CGTokenization, which treats both nodes and edges as input tokens. This allows the model to learn the importance of specific connections dynamically rather than relying solely on a static adjacency matrix.

To preserve spatial context, the model employs structural encoding:

  • Link Markers: Derived from Laplacian eigenvectors to represent graph topology.
  • Token Markers: Used to distinguish between node and edge types within the transformer sequence.
Overview of the CGT framework, detailing graph construction, tokenization of nodes and edges, and the transformer encoder architecture.

2. Topology-aware Pre-training (TAP)

To stabilize training, the authors introduce the TAP strategy. Because GCNs are constrained by local edges, they are more robust to noisy initial features than unconstrained transformers. By first training the feature extractor within a GCN-based architecture, the model learns "topology-aware" representations. These weights are then transferred to initialize the CGT, providing a stable foundation for global attention learning.

The TAP strategy: A GCN is used to "warm up" the feature extractor before transferring weights to the Transformer-based CGT.

Experiments and Results

The model was evaluated on four diverse datasets: PanNuke, Lizard, NuCLS, and BRCA-M2C.

Performance and Efficiency

  • State-of-the-Art Accuracy: On the PanNuke and Lizard datasets, the CGT framework (integrated with Hover-net) outperformed previous benchmarks by 1.9% and 3.2% in average F-score, respectively.
  • Impact of TAP: Ablation studies revealed that the TAP initialization strategy improved final performance by 7.4% to 21% compared to standard initialization methods, confirming that local structural learning is a vital precursor to global attention.
  • Inference Speed: Despite its complexity, the model demonstrated significant efficiency gains during whole-slide image (WSI) processing, reducing inference time from approximately 1800s to 450s.

Conclusion

The Cell Graph Transformer represents a significant step forward in computational pathology by successfully adapting transformer architectures to graph-structured biological data. By treating edges as tokens and employing a topology-aware pre-training phase, the framework captures both local structural nuances and long-range spatial context. Future work may involve refining structural encodings and integrating the model more deeply with automated segmentation tools.

Summary updated

BibTeX
@inproceedings{lou2024cell,
  author = {Wei Lou and Guanbin Li and Xiang Wan and Haofeng Li},
  title = {{Cell Graph Transformer for Nuclei Classification}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i4.28179},
}
Figure