Taming Mambas for Voxel Level 3D Medical Image Segmentation

Luca Lumetti, Vittorio Pipoli, Kevin Marchesini, Elisa Ficarra, Costantino Grana, Federico BolelliarXiv 2024

Abstract

Recently, the field of 3D medical segmentation has been dominated by deep learning models employing Convolutional Neural Networks (CNNs) and Transformer-based architectures, each with their distinctive strengths and limitations. CNNs are constrained by a local receptive field, whereas transformers are hindered by their substantial memory requirements as well as they data hungriness, making them not ideal for processing 3D medical volumes at a fine-grained level. For these reasons, fully convolutional neural networks, as nnUNet, still dominate the scene when segmenting medical structures in 3D large medical volumes. Despite numerous advancements towards developing transformer variants with subquadratic time and memory complexity, these models still fall short in content-based reasoning. A recent breakthrough is Mamba, a Recurrent Neural Network (RNN) based on State Space Models (SSMs) outperforming Transformers in many long-context tasks (million-length sequences) on famous natural language processing and genomic benchmarks while keeping a linear complexity.

Introduction

3D medical image segmentation is a high-stakes task requiring the simultaneous capture of fine-grained local details and broad global context. Historically, this has been a trade-off between Convolutional Neural Networks (CNNs) and Transformers. While CNNs excel at local feature extraction, their limited receptive field prevents them from modeling long-range anatomical dependencies. Conversely, Transformers provide global reasoning through self-attention but suffer from quadratic complexity, making the processing of high-resolution 3D volumes—often containing millions of voxels—computationally prohibitive.

This work explores the application of Mamba, a State Space Model (SSM) that offers the global reasoning capabilities of Transformers with the efficiency of linear complexity. By "taming" Mamba for the spatial requirements of 3D medical data, the authors propose a new paradigm for voxel-level analysis.

Methodology: Adapting Mamba for 3D Space

Mamba is natively a 1D causal sequence model. To adapt it for 3D medical imaging, several architectural innovations were introduced to handle non-causal spatial relationships.

Architectural Innovations

  1. Mamba Layer Wrapper: A stabilized block featuring LayerNorm, an MLP head, and skip connections, inspired by Vision Transformer (ViT) designs.
  2. Bidirectional 3D Mamba: To overcome the inherent causality of 1D sequences, the model processes data in both forward and backward directions, ensuring that every voxel benefits from the full context of the volume.
  3. MultiSegMamba: This variant addresses the challenge of flattening 3D volumes into 1D sequences. By processing the data through four different spatial permutations (scanning along X, Y, and Z axes), the model ensures that spatially proximal voxels remain "sequence-close" in at least one pass.
  4. U-Net Integration: Mamba blocks are integrated into a U-Net architecture, serving as encoders (SegMamba), bottlenecks, or selective filters in skip connections (SegMambaSkip).
Overview of the SegMamba architecture, integrating Mamba layers into a U-Net framework for 3D segmentation.

Experimental Results

The proposed models were evaluated on three major benchmarks: MSD Brain Tumor, Synapse Multi-organ (CT), and ACDC (MRI).

State-of-the-Art Performance

The MultiSegMamba variant consistently outperformed established CNN and Transformer baselines. On the Synapse Multi-organ dataset, it achieved a state-of-the-art average Dice Similarity Coefficient (DSC) of 88.93%, significantly surpassing the industry-standard nnU-Net (86.21%).

Quantitative comparison of MultiSegMamba against CNN and Transformer baselines on the Synapse multi-organ dataset.

Efficiency and Specific Improvements

  • Learning Efficiency: Mamba-based models reached convergence in approximately 300 epochs, a significant reduction from the 1,000 epochs typically required by competing architectures.
  • Small Organ Segmentation: A notable success was observed in segmenting the gallbladder, a notoriously difficult target due to its high variability. MultiSegMamba achieved a DSC of ~71.8, a substantial improvement over previous methods.
  • Model Scaling: With approximately 68M parameters, MultiSegMamba offers a balanced profile—larger than basic CNNs (~30M) but much more efficient than heavy Transformers like nnFormer (~150M).

Discussion and Conclusion

The results demonstrate that directionality is a crucial factor when applying SSMs to 3D data. By "unfolding" the volume from multiple perspectives, MultiSegMamba captures spatial relationships that single-pass models miss.

However, challenges remain. The multi-directional approach introduces computational redundancy and increases the risk of overfitting. Future research will focus on optimizing scanning paths to maintain 3D context while reducing the number of redundant passes, further refining the efficiency of Mamba for high-resolution medical imaging.

Summary updated

BibTeX
@misc{lumetti2024taming,
  author = {Luca Lumetti and Vittorio Pipoli and Kevin Marchesini and Elisa Ficarra and Costantino Grana and Federico Bolelli},
  title = {{Taming Mambas for Voxel Level 3D Medical Image Segmentation}},
  year = {2024},
  eprint = {2410.15496},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.15496},
}
Figure