DS-TransUNet: Dual Swin Transformer U-Net for Medical Image Segmentation

Ailiang Lin, Bingzhi Chen, Jiayu Xu, Zheng Zhang, Guangming Lu, David Zhang

TL;DR

This paper introduces DS-TransUNet, a novel U-Net architecture for medical image segmentation that leverages the power of Swin Transformers in both its encoder and decoder. By incorporating dual-scale encoding and a Transformer Interactive Fusion module, DS-TransUNet effectively captures both local details and global context, leading to state-of-the-art performance across various medical imaging tasks.

What Problem Does This Paper Address?

Automatic medical image segmentation is crucial for clinical diagnosis and research, but existing methods, primarily based on Convolutional Neural Networks (CNNs), struggle to capture long-range dependencies and global context due to the limited receptive fields of convolutional kernels. While Transformers have shown promise in modeling long-range interactions, their application in medical image segmentation, particularly within the decoder part of U-Net-like architectures, remains underexplored. Furthermore, standard vision transformers often overlook intrinsic pixel-level features within image patches, potentially losing valuable information. This paper aims to bridge this gap by proposing a unified Transformer-based U-Net that effectively integrates hierarchical Swin Transformers into both the encoder and decoder, while also addressing the multi-scale feature representation challenge.

Methods

The core of DS-TransUNet is its innovative architecture built upon the U-Net framework, enhanced with Swin Transformers.

  • Hierarchical Swin Transformer: The paper utilizes Swin Transformers, known for their efficiency and ability to model hierarchical features through window-based self-attention (W-MSA) and shifted window-based self-attention (SW-MSA). This is applied to both the encoder and decoder.
  • Dual-Scale Encoder: To capture both coarse and fine-grained features, the encoder employs two parallel branches. Each branch processes the input image, but at different patch scales (e.g., s=4 and s=8). This allows for the extraction of multi-scale feature representations.
  • Transformer Interactive Fusion (TIF) Module: A novel TIF module is introduced to effectively fuse the multi-scale features from the dual-scale encoder branches. It uses a standard Transformer block to enable self-attention between tokens from different scale branches, allowing for global context interaction and ensuring semantic consistency between coarse and fine features.
  • Swin Transformer in Decoder: Unlike many previous Transformer-based U-Nets that only use Transformers in the encoder, DS-TransUNet integrates Swin Transformer blocks into the decoder. This allows for the modeling of long-range dependencies and global context during the up-sampling process, which is crucial for accurate segmentation.

Datasets

The proposed DS-TransUNet was evaluated on four common medical image segmentation tasks using the following datasets:

  • Polyp Segmentation: Kvasir, CVC-ColonDB (ColonDB), EndoScene, ETIS, and CVC-ClinicDB.
  • ISIC 2018 Dataset: For skin lesion analysis.
  • GLAS Dataset: For gland segmentation in histology images.
  • 2018 Data Science Bowl: For nuclei segmentation in medical images.

The paper notes that the split and training settings for these datasets vary, and they followed established practices from prior works for consistency.

Key Insights and Ideas

  • Transformer in Decoder is Key: Integrating Swin Transformers into the decoder significantly improves segmentation performance by enabling long-range dependency modeling during up-sampling, a capability often overlooked in previous Transformer-based U-Nets.
  • Dual-Scale Encoding Captures Richer Features: Using two parallel encoder branches with different patch sizes effectively extracts complementary coarse and fine-grained features, leading to a more comprehensive representation.
  • TIF Module for Effective Multi-Scale Fusion: The Transformer Interactive Fusion module is crucial for intelligently merging multi-scale features. It goes beyond simple concatenation by using self-attention to establish relationships between features of different scales, leading to better overall performance.
  • Swin Transformer's Versatility: The hierarchical nature of Swin Transformers makes them suitable for both the feature extraction in the encoder and the context-aware up-sampling in the decoder, demonstrating their flexibility in segmentation tasks.

Key Results

DS-TransUNet consistently achieved state-of-the-art (SOTA) performance across all four tested medical image segmentation tasks.

  • Polyp Segmentation: DS-TransUNet-L achieved an average mDice of 0.868 and mIoU of 0.806 across five polyp datasets, outperforming previous SOTA methods like TransFuse. It showed particular strength in segmenting fuzzy polyps at image edges.
  • ISIC 2018 Dataset: DS-TransUNet-L achieved an F1 score of 0.9132, mIoU of 0.8523, and recall of 0.9217, showing significant improvements over SOTA methods like DoubleU-Net and FANet.
  • GLAS Dataset: DS-TransUNet-L achieved an mDice of 78.45% and mIoU of 78.45%, outperforming KiU-Net by a substantial margin, even on a small dataset.
  • 2018 Data Science Bowl: DS-TransUNet-L achieved an F1 of 0.9219 and mIoU of 0.8612, surpassing FANet and demonstrating a better balance across multiple metrics.

Qualitative results showed DS-TransUNet's ability to accurately capture boundaries, distinguish subtle features, and generalize well to unseen data.

Limitations and Future Work

  • Computational Cost: While Swin Transformers are more efficient than standard Transformers, the dual-branch encoder and Transformer blocks still contribute to computational complexity.
  • Future Directions: The authors suggest focusing on designing more lightweight Transformer-based models and further improving the learning of pixel-level intrinsic structural features, which can be lost during patch division. They also hint at exploring more advanced multi-scale fusion techniques.

Summary updated

BibTeX
@article{lin2022ds,
  author = {Ailiang Lin and Bingzhi Chen and Jiayu Xu and Zheng Zhang and Guangming Lu and David Zhang},
  title = {{DS-TransUNet: Dual Swin Transformer U-Net for Medical Image Segmentation}},
  journal = {IEEE Trans. Instrumentation \& Measurement},
  year = {2022},
  doi = {10.1109/tim.2022.3178991},
}
Figure