ScaleFormer: Revisiting the Transformer-based Backbones from a Scale-wise Perspective for Medical Image Segmentation

Huimin Huang, Shiao Xie, Lanfen Lin, Yutaro Iwamoto, Xian-Hua Han, Yen-Wei Chen, Ruofeng Tong

TL;DR

This paper introduces ScaleFormer, a novel backbone for medical image segmentation that addresses limitations in existing transformer-based approaches. By introducing scale-wise intra-scale transformers to fuse local CNN features with global transformer cues within each scale, and a spatial-aware inter-scale transformer to capture cross-scale dependencies, ScaleFormer achieves state-of-the-art performance, particularly for segmenting small objects and handling scale variations.

What Problem Does This Paper Address?

Medical image segmentation, especially for tasks like identifying organs in CT or MRI scans, is crucial for diagnosis and treatment planning. While Convolutional Neural Networks (CNNs) excel at capturing local details, they struggle with long-range dependencies. Vision Transformers (ViTs) have shown promise in modeling these long-range relationships but often lack the inductive bias of CNNs for local feature extraction, leading to issues like over-segmenting background or failing to precisely localize small objects. Existing hybrid approaches either replace CNNs entirely with transformers or only add transformers to the deepest layers, failing to adequately address two key challenges:

  1. Intra-scale problem: The inability to effectively combine local contextual details with global positional cues within each feature scale. This is particularly problematic for small objects whose fine signals can be lost during downsampling.
  2. Inter-scale problem: The failure to leverage distinctive information across multiple scales generated by a hierarchical encoder. Medical images often contain objects of vastly different sizes, and existing methods don't adequately capture these cross-scale variations.

Methods

ScaleFormer proposes a novel backbone that tackles these challenges through two main innovations:

  • Scale-wise Intra-Scale Transformer: This component is designed to fuse CNN-extracted local features with transformer-based global cues at each scale. To efficiently capture global dependencies within a scale, especially in high-resolution shallow layers where standard transformers are computationally expensive, they introduce a lightweight Dual-Axis MSA (Multi-Head Self-Attention). This MSA mechanism replaces the computationally intensive full-image attention with separate row-wise and column-wise attention mechanisms, significantly reducing complexity while still capturing global context.
  • Spatial-Aware Inter-Scale Transformer: This module focuses on capturing dependencies across different scales. Instead of treating features from different scales as independent sequences, it leverages the spatial correspondence between patches in down-sampled feature maps. This "patch matching" approach allows the transformer to focus on relevant cross-scale similarities, effectively capturing scale differences and variations in object shape and size.

The overall architecture starts with a CNN backbone (ResUNet) to extract hierarchical local features. These features are then fed into the intra-scale transformers at each stage. The outputs from these intra-scale transformers are then processed by the spatial-aware inter-scale transformer to capture cross-scale relationships. Finally, the enhanced features are fused with the original CNN features at the same scale before being passed to the decoder for prediction.

Datasets

The paper evaluates ScaleFormer on three public medical image segmentation datasets:

  • Synapse: A multi-organ segmentation challenge dataset consisting of 30 abdominal CT scans.
  • MoNuSeg: The Multi-Organ Nucleus Segmentation Challenge dataset.
  • ACDC: The automated cardiac diagnosis challenge dataset, containing MRI scans of the heart.

Key Insights and Ideas

  • Scale-wise processing is crucial: The paper convincingly argues that addressing segmentation challenges requires considering both local-global interactions within a scale and interactions across scales.
  • Lightweight attention for efficiency: The Dual-Axis MSA is a clever solution to make transformer-based global context modeling computationally feasible for high-resolution feature maps, a common issue in medical imaging.
  • Spatial correspondence across scales: The spatial-aware inter-scale transformer's approach of matching patches based on their spatial relationships in down-sampled feature maps is a novel way to exploit multi-scale information without simply concatenating flattened features.
  • Transformers enhance CNNs, not just replace them: ScaleFormer demonstrates that integrating transformers thoughtfully into a CNN backbone can leverage the strengths of both architectures, leading to superior performance.

Key Results

ScaleFormer achieves state-of-the-art results on the tested benchmarks:

  • On the Synapse dataset, ScaleFormer achieved the highest Dice Coefficient (DSC) of 82.86% and the lowest Hausdorff Distance (HD) of 16.81mm, outperforming 11 other state-of-the-art methods. Even ScaleFormer without the inter-scale transformer component (w/o inter) surpassed many existing transformer-based methods.
  • The paper also reports strong performance on the MoNuSeg and ACDC datasets, demonstrating the generalizability of the proposed approach.
  • Qualitative results show ScaleFormer's ability to accurately localize organs and produce coherent boundaries, even for small objects, outperforming methods like UNet, TransUNet, and SwinUNet.

Limitations and Future Work

  • Computational Cost: While the Dual-Axis MSA significantly reduces complexity, the paper notes that applying intra-scale transformers to the shallowest layers (Stage 2) can increase computational cost and may affect genuine characteristics, suggesting a trade-off between performance and efficiency. The authors chose to apply intra-scale transformers from Stage 3 to Stage 6 for a balance.
  • Pre-training: The authors mention that ScaleFormer does not require pre-training on large datasets, which is an advantage. However, some compared methods (TransUNet, SwinUNet) were pre-trained on ImageNet, which could be a factor in their performance.
  • Future Work: The paper's success suggests that further exploration of scale-wise transformer architectures and more efficient attention mechanisms for medical image analysis would be fruitful. Investigating the application of ScaleFormer to other medical imaging modalities or tasks beyond segmentation could also be valuable.

Summary updated

BibTeX
@inproceedings{huang2022scaleformer,
  author = {Huimin Huang and Shiao Xie and Lanfen Lin and Yutaro Iwamoto and Xian-Hua Han and Yen-Wei Chen and Ruofeng Tong},
  title = {{ScaleFormer: Revisiting the Transformer-based Backbones from a Scale-wise Perspective for Medical Image Segmentation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  url = {https://openreview.net/forum?id=FbbFoMlLxw},
}
Figure