Cross-Shaped Windows Transformer with Self-supervised Pretraining for Clinically Significant Prostate Cancer Detection in Bi-parametric MRI

Yuheng Li, Jacob F. Wynne, Jing Wang, Richard L. J. Qiu, Justin Roper, Shaoyan Pan, Ashesh B. Jani, Tian Liu, Pretesh R. Patel, Hui Mao, Xiaofeng YangarXiv 2023 · DOI

Abstract

Detecting clinically significant prostate cancer (csPCa) in bi-parametric MRI (bpMRI) requires capturing both local textures and global spatial dependencies. While Vision Transformers (ViTs) excel at global context, their high data requirements often limit their utility in medical imaging. We propose CSwin UNet, a 3D transformer architecture that utilizes a novel cross-shaped window attention mechanism to achieve a large receptive field with high computational efficiency. To mitigate the challenges of limited labeled data, we integrate a multi-task self-supervised learning (SSL) pretraining strategy. Our results on the PI-CAI and Prostate158 datasets demonstrate that CSwin UNet achieves state-of-the-art performance (AUC 0.888) and exhibits superior data efficiency, particularly in low-labeled-data scenarios.

Introduction

The detection of clinically significant prostate cancer (csPCa) is a high-stakes task in clinical radiology. Deep learning, particularly Convolutional Neural Networks (CNNs), has become a standard tool for medical image segmentation. However, CNNs are inherently limited by their local receptive fields, often failing to capture long-range dependencies crucial for identifying subtle cancerous lesions. Vision Transformers (ViTs) offer a solution through global self-attention but typically require massive datasets for effective training—a significant hurdle in medical domains where expert-labeled data is scarce and expensive.

Furthermore, existing window-based transformers, such as Swin Transformer, expand their receptive fields slowly through window shifting, which may be suboptimal for dense 3D medical segmentation. This study addresses these challenges by introducing a cross-shaped window attention mechanism and a robust self-supervised pretraining framework.

Methods

CSwin UNet Architecture

The core innovation of our model is the Cross-Shaped Window (CSwin) Attention. Unlike standard square or cubic windows, CSwin attention partitions the 3D volume into horizontal, vertical, and longitudinal stripes. Self-attention is performed independently within these stripes across three parallel branches.

Illustration of the Cross-Shaped Window (CSwin) Attention mechanism across three dimensions.

This approach allows the model to achieve a "global-like" view of the 3D volume much faster and with lower computational overhead than full global attention. Additionally, we employ Scaled Cosine Attention to compute similarity, which provides more stable training compared to standard dot-product attention by preventing a few high-intensity pixel pairs from dominating the attention weights.

Self-Supervised Pretraining

To overcome data scarcity, we implement a multi-task self-supervised learning (SSL) strategy. Before fine-tuning on labeled csPCa data, the encoder is pretrained on unlabeled bpMRI scans using three pretext tasks: contrastive learning, context restoration, and rotation prediction.

Overview of the self-supervised pretraining and downstream finetuning pipeline.

To balance these tasks effectively, we utilize an Automatic Weighted Loss based on uncertainty estimation, eliminating the need for manual hyperparameter tuning during the pretraining phase.

Results and Discussion

We evaluated CSwin UNet using the PI-CAI dataset (1,500 scans) for internal validation and the Prostate158 dataset (158 scans) for external validation.

Performance and Generalization

On the PI-CAI dataset, the SSL-pretrained CSwin UNet achieved an AUC of 0.888 and an Average Precision (AP) of 0.545, outperforming established models like Swin UNETR and standard UNet. The model also demonstrated strong generalization on the external Prostate158 dataset with an AUC of 0.79, confirming its robustness across different clinical protocols and scanner types.

Data Efficiency

A key finding of this study is the impact of SSL on data efficiency. When trained on only 25% of the labeled PI-CAI data, the SSL-pretrained model showed a nearly 5% improvement in AUC compared to training from scratch. This suggests that self-supervised pretraining is essential for deploying advanced transformer architectures in data-constrained medical environments.

Limitations

While highly effective, the performance gains from SSL diminish as the volume of labeled data increases toward 100%. Additionally, a performance gap remains between internal and external datasets, likely due to variations in labeling standards between radiologists and pathologists.

Conclusion

CSwin UNet represents a significant advancement in 3D medical image segmentation. By combining an efficient cross-shaped attention mechanism with a multi-task self-supervised pretraining strategy, we provide a powerful and data-efficient solution for detecting clinically significant prostate cancer. Future work will focus on scaling pretraining to larger, more diverse multi-institutional datasets to further bridge the gap in cross-domain generalization.

Summary updated

BibTeX
@misc{li2023cross,
  author = {Yuheng Li and Jacob F. Wynne and Jing Wang and Richard L. J. Qiu and Justin Roper and Shaoyan Pan and Ashesh B. Jani and Tian Liu and Pretesh R. Patel and Hui Mao and Xiaofeng Yang},
  title = {{Cross-Shaped Windows Transformer with Self-supervised Pretraining for Clinically Significant Prostate Cancer Detection in Bi-parametric MRI}},
  year = {2023},
  eprint = {2305.00385},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.00385},
}
Figure