NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Multi-dimension Transformer with Attention-based Filtering for Medical Image Segmentation

Wentao Wang, Xi Xiao, Mingjie Liu, Qing Tian, Xuanyao Huang, Qizhen Lan, Swalpa Kumar Roy, Tianyang Wang

Abstract

The accurate segmentation of medical images is crucial for diagnosing and treating diseases. Recent studies demonstrate that vision transformer-based methods have significantly improved performance in medical image segmentation, primarily due to their superior ability to establish global relationships among features and adaptability to various inputs. However, these methods struggle with the low signal-to-noise ratio inherent to medical images. Additionally, the effective utilization of channel and spatial information, which are essential for medical image segmentation, is limited by the representation capacity of self-attention. To address these challenges, we propose a multi-dimension transformer with attention-based filtering (MDT-AF), which redesigns the patch embedding and self-attention mechanism for medical image segmentation. MDT-AF incorporates an attention-based feature filtering mechanism into the patch embedding blocks and employs a coarse-to-fine process to mitigate the impact of low signal-to-noise ratio. To better capture complex structures in medical images, MDT-AF extends the self-attention mechanism to incorporate spatial and channel dimensions, enriching feature representation. Moreover, we introduce an interaction mechanism to improve the feature aggregation between spatial and channel dimensions. Experimental results on three public medical image segmentation benchmarks show that MDT-AF achieves state-of-the-art (SOTA) performance.

Introduction

Medical image segmentation is a cornerstone of automated diagnosis, yet it faces two major hurdles that limit the efficacy of standard deep learning models. First, medical images—such as X-rays, dermoscopy, or endoscopic frames—often suffer from a low signal-to-noise ratio (SNR). Noise and background artifacts can obscure critical anatomical boundaries, leading to misclassification. Second, while Vision Transformers (ViTs) excel at modeling global relationships, they often lack the capacity to simultaneously optimize spatial details and channel-wise feature representations.

Existing solutions like UNet capture local details effectively but struggle with global context when the size and shape of the region of interest (ROI) vary significantly. Conversely, standard ViTs may overlook subtle local structures. To bridge these gaps, we introduce the Multi-dimension Transformer with Attention-based Filtering (MDT-AF), a framework designed to refine feature extraction and enhance multi-dimensional attention.

Methodology

The MDT-AF framework introduces two primary innovations to the standard Transformer architecture: Attention-based Patch Embedding and the Multi-dimension Transformer Block.

1. Attention-based Patch Embedding (APE)

Standard Transformers typically utilize a simple linear projection to generate image patches. However, in noisy medical environments, this can propagate artifacts into the deeper layers of the network. MDT-AF replaces this with a coarse-to-fine filtering process using two parallel branches:

  • Overlap Patch Embedding: This branch extracts initial coarse features while preserving local continuity between patches.
  • Attention-based Filtering (AF): This mechanism generates attention weights to filter the coarse features. By suppressing noise and focusing on relevant signals at the embedding stage, the model ensures higher-quality feature input for the subsequent Transformer blocks.

2. Multi-dimension Transformer Block

To capture the complex structural variations inherent in medical data, the self-attention mechanism is expanded across multiple dimensions:

  • Spatial Self-attention (SSA): This module captures contextual information across different image positions, which is vital for defining precise boundaries and shapes.
  • Channel Self-attention (CSA): This analyzes relationships between feature channels to highlight significant global features and semantic categories.
  • Interaction Mechanism: An adaptive module that re-weights and fuses features from both the spatial and channel dimensions, ensuring the model understands both "where" a lesion is and "what" its characteristics are.
  • Locality Integration: A convolutional branch runs in parallel with the self-attention modules to inject inductive bias, helping the model maintain a sense of local pixel relationships that pure Transformers might otherwise miss.

To maintain computational efficiency, the model utilizes Efficient Self-attention (ESA), which reduces the quadratic complexity typically associated with standard self-attention mechanisms.

Experimental Evaluation

The MDT-AF model was evaluated on three diverse public benchmarks to test its robustness across different medical imaging modalities:

  1. Lung X-ray Dataset: 704 chest X-ray images for lung field segmentation.
  2. Skin Lesion Dataset: A fusion of ISIC 2017, ISIC 2018, and PH2 datasets (approximately 3,400 samples) for dermoscopic analysis.
  3. Kvasir-SEG Dataset: 1,000 polyp images and masks for endoscopic segmentation.

Performance Results

MDT-AF achieved state-of-the-art (SOTA) results across all tested datasets, outperforming established models like TransUNet and SwinUNet:

  • Lung X-ray: Achieved a 97.17% Dice Score (DSC), outperforming TransUNet by 1.92%.
  • Skin Lesion: Achieved a 94.25% DSC, a significant improvement over Hiformer (88.59%).
  • Kvasir-SEG: Achieved a 93.38% DSC, notably higher than SwinUNet (70.71%) and TransUNet (89.21%).

Ablation studies confirmed that both the Attention-based Filtering (AF) and the Multi-dimension Self-attention (MSA) were essential; removing either component led to a measurable drop in performance across all benchmarks.

Discussion and Conclusion

The success of MDT-AF highlights the importance of "filtering at the source." By treating patch embedding as a denoising step, the model avoids the propagation of errors through deeper layers. Furthermore, the explicit interaction between spatial and channel dimensions allows the model to handle complicated backgrounds where baseline models often produce blurred boundaries or misclassified pixels.

While MDT-AF demonstrates superior performance, future work will focus on reducing the computational overhead associated with its multi-branch architecture and extending the framework to 3D volume segmentation. MDT-AF represents a significant step forward in creating robust, high-precision tools for automated medical image analysis.

Summary updated

BibTeX
@inproceedings{wang2024multi,
  author = {Wentao Wang and Xi Xiao and Mingjie Liu and Qing Tian and Xuanyao Huang and Qizhen Lan and Swalpa Kumar Roy and Tianyang Wang},
  title = {{Multi-dimension Transformer with Attention-based Filtering for Medical Image Segmentation}},
  booktitle = {ICTAI},
  year = {2024},
  url = {https://openreview.net/forum?id=EiB6l8G7hS},
}
Figure