TEAMS: Text-prompted spatiotEmporal dual-heAd Mamba Snake
Organizations: School of intelligent systems engineering, Sun Yat-sen University, Guangzhou 510006, China · Affiliated Hangzhou First People’s Hospital, Zhejiang University School of Medicine, Zhejiang, China · School of Engineering, Case Western Reserve University, Cleveland, USA
Abstract
Deep snake is a promising family of instance segmentation methods that accurately predicts object-level contours, thereby overcoming common pixel-level misclassification issues such as mask cavities and jagged edges in semantic segmentation approaches. However, existing deep snake methods face challenges in handling complex morphological variations, accurately capturing fine-grained organ details, and correcting base detection errors. To mitigate these limitations, we propose a cohesive Text-prompted spatiotEmporal dual-heAd Mamba Snake (TEAMS), a novel vision-language Mamba snake framework with three key innovations: (1) A Spatiotemporal Snake Evolution Strategy (SSES) is introduced to tackle complex morphological variations by capturing bidirectional spatial dependencies along the snake contour and temporal dynamics across evolution steps in a state space model. (2) A Contour Morphology-Aware Mamba (CMAM) is proposed to quantify local contour morphologies to modulate the structured attention mask in the Mamba2 SSD dual form, which extends Mamba's capability to perceive the relative importance of its input sequence elements for better delineation of fine-grained organ details. (3) A Text-prompted Collaborative Dual-Head Snake (TCDHS) is designed to incorporate cues from textual prompts and transfer the evolved contour information to the base detection head, which enhances the deep snake workflow and mitigates wrong detections. Comprehensive evaluations on five datasets covering different organs and imaging modalities demonstrate that TEAMS outperforms existing semantic and deep snake segmentation methods (e.g., relative mDice/mBF improvements of 6.9%/9.1% in a spinal dataset), underscoring its potential as a reliable tool across diverse medical image segmentation scenarios.
Figures & tables
| Dataset ID/ Name | Modality / Target organs | Dataset size | Target class numbers |
| 1. MR_AVBCE- Extended | MRI / Spine | 480 scans, 1233 slices | 50 |
| 2. VerSe | CT / Spine | 374 scans, 8000 slices | 26 |
| 3. BTCV | CT / Abdomen | 30 scans, 900 slices | 8 |
| 4. RAOS | CT / Abdomen | 317 scans, 7500 slices | 19 |
| 5. PanNuke | Microscopy / Nuclei | 7900 image patches | 5 |
| Method | MR_AVBCE- Extended | VerSe19(Pu) | VerSe19(Pr) | VerSe20(Pu) | VerSe20(Pr) | BTCV | RAOS | PanNuke | ||||||||||||||
| mIoU | mDice | mBF | mIoU | mDice | mBF | mIoU | mDice | mBF | mIoU | mDice | mBF | mIoU | mDice | mBF | mIoU | mDice | mBF | mIoU | mDice | mBF | mPQ | |
| TEAMS | 69.2 ∗ 0.5 | 77.4 ∗ 0.4 | 69.6 ∗ 0.6 | 86.5 ∗ 0.4 | 92.5 ∗ 0.2 | 82.2 ∗ 0.4 | 85.9 ∗ 0.2 | 91.6 0.4 | 81.5 ∗ 0.4 | 87.0 ∗ 0.6 | 92.9 ∗ 0.3 | 80.7 ∗ 0.5 | 85.8 ∗ 0.4 | 91.8 ∗ 0.2 | 80.9 ∗ 0.3 | 85.3 0.2 | 91.7 ∗ 0.1 | 79.8 ∗ 0.4 | 79.8 ∗ 0.3 | 87.9 ∗ 0.4 | 75.9 ∗ 0.7 | 41.1 0.8 |
| nnU-Net v2 ( Isensee et al. (2021) ) | 62.7 1.1 | 70.1 1.0 | 61.8 1.3 | 82.2 0.5 | 89.7 0.3 | 76.8 0.6 | 81.0 0.3 | 88.8 0.4 | 75.6 0.8 | 80.2 0.4 | 88.1 0.3 | 73.9 0.8 | 81.4 0.4 | 89.5 0.3 | 75.4 0.8 | 81.9 0.6 | 86.0 0.9 | 71.4 0.7 | 73.8 0.2 | 85.7 0.3 | 68.6 0.8 | 34.5 1.1 |
| UNETR ( Hatamizadeh et al. (2022) ) | 56.1 1.1 | 67.3 1.1 | 57.7 1.2 | 78.6 0.5 | 85.3 0.6 | 71.6 0.9 | 79.7 0.7 | 85.5 0.6 | 71.3 0.5 | 78.0 0.6 | 85.3 0.5 | 71.8 0.7 | 79.2 0.5 | 86.4 0.4 | 72.5 0.9 | 81.0 0.6 | 84.1 0.7 | 69.6 1.1 | 74.1 0.7 | 85.9 0.8 | 68.1 1.0 | 31.4 1.3 |
| TransUNet ( Chen et al. (2021) ) | 55.8 1.0 | 66.7 1.0 | 56.4 1.3 | 78.5 0.7 | 84.5 0.7 | 70.1 0.9 | 77.8 0.6 | 84.2 0.6 | 69.5 0.7 | 78.4 0.6 | 85.0 0.7 | 71.2 0.7 | 76.8 0.6 | 83.9 0.6 | 69.1 0.9 | 79.0 0.9 | 85.3 0.9 | 70.2 1.0 | 72.3 0.6 | 84.1 0.6 | 67.2 1.1 | 35.8 1.2 |
| Swin-Unet ( Cao et al. (2023a) ) | 56.4 1.0 | 67.0 0.9 | 57.3 1.4 | 80.8 0.6 | 87.3 0.3 | 73.4 1.1 | 80.4 0.6 | 85.7 0.5 | 72.6 0.7 | 79.5 0.7 | 86.6 0.6 | 72.9 0.5 | 79.8 0.6 | 85.1 0.5 | 71.7 0.8 | 80.8 0.6 | 83.9 0.7 | 67.8 0.9 | 73.0 0.8 | 83.6 0.8 | 66.7 0.9 | 31.3 1.2 |
| Model Configuration | mIoU | mDice | mBF |
| Baseline | 58.2 | 67.5 | 58.8 |
| + SSES | 62.2( 6.9%) | 72.9( 8.0%) | 62.8( 6.8%) |
| + CMAM | 59.1( 1.5%) | 71.3( 5.6%) | 60.3( 2.6%) |
| + Text prompts in TCDHS | 60.7( 4.3%) | 71.3( 5.6%) | 61.4( 4.4%) |
| + Consistency feedback in TCDHS | 61.3( 5.3%) | 71.6( 6.1%) | 60.8( 3.4%) |
| + TCDHS | 61.9( 6.3%) | 72.4( 7.3%) | 62.5( 6.3%) |
| Temporal modeling strategy | mIoU | mDice | mBF |
| Standard temporal feature aggregation | 66.6 | 73.6 | 66.5 |
| GRU-based recurrent modeling | 66.1 | 72.9 | 62.9 |
| SSES | 69.2 | 77.4 | 69.6 |
| Temporal modeling method | mIoU | mDice | mBF | Trainable params (M) | Inference time (s) | GPU mem- ory (MB) |
| Attention-based temporal fusion | 63.0 | 73.9 | 63.1 | 17.67 | 1.25 | 3066 |
| Exponential decay aggregation (ours) | 69.2 | 77.4 | 69.6 | 15.74 | 1.17 | 2852 |
| Dataset | Method | mIoU | mDice | mBF | mPQ |
| MR_AVBCE- Extended | Learned alternative | 61.9 | 69.9 | 60.4 | – |
| Our CMAM | 69.2 | 77.4 | 69.6 | – | |
| VerSe | Learned alternative | 80.4 | 83.1 | 71.0 | – |
| Our CMAM | 87.0 | 92.9 | 80.7 | – | |
| BTCV | Learned alternative | 79.7 | 82.4 | 70.6 | – |
| Our CMAM | 85.3 | 91.7 | 79.8 | – |
| Variant | mIoU | mDice | mBF |
| Convolution-based snake evolution | 58.9 | 66.0 | 60.9 |
| Transformer-based snake evolution | 63.5 | 72.8 | 64.9 |
| Mamba-based snake evolution (ours) | 69.2 | 77.4 | 69.6 |
| Setting | mIoU | mDice | mBF |
| No prompt | 65.8 | 73.6 | 64.3 |
| Random prompt | 63.3 | 71.9 | 62.8 |
| Incorrect prompt | 63.0 | 71.3 | 62.1 |
| Different correct template 1 | 68.9 | 77.4 | 68.8 |
| Different correct template 2 | 68.5 | 76.7 | 68.5 |
| Correct prompt / TEAMS | 69.2 | 77.4 | 69.6 |
| Method | Params (M) | Inference time (s) | Peak GPU memory (MB) | mDice/ mBF |
| Conference version | 12.48 | 0.83 | 1856 | 71.3/63.6 |
| Journal version (TEAMS) | 15.74 (trainable) + 137.43 (frozen) | 1.17 | 2852 | 77.4/69.6 |
Medical Image Segmentation
Medical image segmentation delineates organs, lesions, and other structures in scans to support measurement, diagnosis, treatment planning, and research.
See all 786 papers