Abstract
Accurate 3D medical image segmentation requires balancing local boundary precision with global anatomical context. While Convolutional Neural Networks (CNNs) excel at local features, they often lack a sufficient receptive field for global relationships. Conversely, standard Transformers offer global context but suffer from high computational costs in 3D. This paper introduces DwinFormer, a hierarchical architecture utilizing a Directional Window (Dwin) attention mechanism. By processing spatial dimensions independently and incorporating local inductive biases, DwinFormer achieves state-of-the-art results on the Synapse multi-organ and Cell HMS datasets, notably improving boundary accuracy and structural coherence.
Introduction
In the field of clinical diagnostics, segmenting complex organs or small pathological structures from 3D medical scans (like CT or MRI) is a critical task. This process faces a persistent challenge: the "local vs. global" trade-off. Fine-grained details are necessary to define precise boundaries, while global context is required to understand the spatial relationships between different organs.
Traditional CNNs are effective at capturing local textures but have limited receptive fields, making them "short-sighted" regarding large-scale anatomical structures. Vision Transformers (ViTs) address this with global self-attention but are computationally prohibitive for high-resolution 3D volumes. Recent window-based approaches like Swin Transformers reduce complexity but can lead to "window blindness," where the model fails to capture dependencies across window boundaries. DwinFormer is proposed to bridge this gap, providing a large receptive field with manageable computational overhead.
Methods
DwinFormer follows a hierarchical encoder-decoder (U-Net style) framework. The primary building block is the Dwin Block, which integrates two novel attention layers designed to capture multi-scale directional information:
- Nested Dwin Attention (NDA): Instead of computing attention over the entire 3D volume, NDA decomposes the task into three sequential steps: horizontal, vertical, and depthwise attention. This directional decomposition allows the model to progressively expand its receptive field across the volume, achieving a "pseudo-global" understanding without the quadratic complexity of standard 3D self-attention.
- Convolutional Dwin Attention (CDA): To maintain sensitivity to local textures and boundaries, the CDA layer incorporates a 5x5 depthwise convolution directly into the attention mechanism. This "inductive bias" ensures that local spatial context is preserved, which is vital for medical tasks where pixel-level accuracy is paramount.
The architecture is hybrid: Dwin blocks are utilized in the high-resolution stages to capture fine details and directional context, while Global Self-Attention (GSA) is employed at lower resolutions where the reduced data size allows for full global processing.
Results
The model was rigorously evaluated on two benchmarks: the 3D Synapse Multi-organ Dataset (abdominal CT scans) and the Cell HMS Dataset (high-resolution zebrafish cell microscopy).
On the Synapse dataset, DwinFormer established a new state-of-the-art (SOTA) performance. It achieved a Dice Similarity Coefficient (DSC) of 87.38%, surpassing the previous leading model, nnFormer (86.57%). More significantly, DwinFormer demonstrated superior boundary precision, reducing the Hausdorff Distance (HD95) to 8.68, a substantial improvement over nnFormer's 10.63.
Qualitative analysis further supports these findings. Visual results indicate that DwinFormer produces more coherent segmentations, effectively maintaining the "connectedness" of organs and avoiding the fragmented predictions often seen in other transformer-based models.
Discussion and Conclusion
The success of DwinFormer highlights several key insights. First, directional decomposition is an efficient strategy for 3D data, allowing models to learn structural extensions along primary axes before integrating them into a holistic 3D representation. Second, the order of these directional operations matters; ablation studies confirmed that specific sequences (e.g., Depthwise $\rightarrow$ Horizontal $\rightarrow$ Vertical) yield optimal performance. Finally, the inclusion of convolutional biases remains essential in the transformer era for tasks requiring high spatial precision.
While DwinFormer is more efficient than standard ViTs, it remains a complex model requiring significant computational resources for training. Future work will focus on optimizing window sizes and exploring the application of Dwin blocks to other 3D domains, such as video analysis and autonomous driving.
Summary updated