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

Medal S: Spatio-Textual Prompt Model for Medical Segmentation

Pengcheng Shi, Jiawei Chen, Jiaqi Liu, Xinglin Zhang, Tao Chen, Lei Li · Submission to CVPR 2025 Workshop MedSegFM

TL;DR

Medal S is an end-to-end 3D medical segmentation foundation model that natively processes both spatial prompts (masks) and textual descriptions at full volumetric resolution. By performing channel-wise alignment between text embeddings and spatial masks in parallel, it handles up to 243 classes across five imaging modalities while speeding up 24-class inference by over 10× compared to sequential prompting.

What Problem Does This Paper Address?

Adapting vision foundation models like SAM to 3D clinical imaging faces three critical roadblocks:

  1. Resolution mismatch and detail loss: Prior 3D models (such as SegVol or VISTA3D) downsample dense spatial prompts into compressed low-dimensional tokens, destroying delicate voxel-level anatomical boundaries. Conversely, text-only models (like SAT) lack spatial prompts entirely, making interactive clinician refinement impossible.
  2. Inference bottlenecks in multi-class tasks: When segmenting multiple organs or lesions, existing spatial prompt architectures query targets sequentially, causing inference latency to explode linearly with the number of classes.
  3. Severe scale imbalance: Biological targets range from tiny synaptic clefts to entire organs. Fitting varied anatomy into fixed 3D training patches frequently triggers false positives (when large targets lack global context) or false negatives (when small targets are drowned out).

Methods

Medal S unifies native-resolution spatial cues and semantic text prompts into a cohesive, end-to-end framework:

  • Channel-Wise Spatio-Textual Alignment: Rather than tokenizing masks, the model maintains a multi-channel spatial prompt tensor $S_p \in \mathbb{R}^{N \times H \times W \times D}$ matching the $N$ queried anatomical classes. It projects these masks using transposed text query embeddings $T^\top \in \mathbb{R}^{C \times N}$ via $F_a = T^\top S_p$. The resulting feature map $F_a$ is concatenated with native visual features $F$ and refined through a lightweight 3D convolution block.
  • Dual Foreground Conditioning: A binary foreground prompt $S_f$ (the aggregated union of all active classes) is concatenated directly to the input image channels of the U-Net backbone.
  • Iterative Refinement and Prompt Generation: During training, a prompt generator simulates real-world user noise by probabilistically dropping and adding 3D blocks to ground-truth masks. At inference, the model operates in either a text-only self-refinement mode (initializing with zeros and iteratively refining predictions via masked autoencoder-style block masking) or a hybrid mode accepting manual user edits.
  • Two-Stage Coarse-to-Fine Pipeline: A low-resolution model (voxel spacing $1.5 \times 1.5 \times 3.0\text{ mm}$) first localizes regions of interest (ROIs). A high-resolution model ($1.0 \times 1.0 \times 1.0\text{ mm}$) then processes the cropped ROI, directly consuming the coarse prediction as its spatial prompt.
  • Dynamic Resampling & Post-Processing: Voxel spacing is dynamically scaled according to the smallest target component in a case to prevent patch clipping or drowning. Post-processing cleans predictions per class based on connected-component volume and predicted probabilities.
Input Volume + Foreground Prompt (Sf)
         │
         ▼
    3D U-Net Encoder  ───► Feature Maps (F) ──┐
                                              ├──► Concat ──► 3D Conv ──► Class Masks (P)
Text Prompts ──► Text Enc ──► Queries (T) ────┤
                                   │          │
Spatial Prompts (Sp) ──────────────┴──────────┘
           (Channel-wise Fa = Tᵀ · Sp)

Datasets

  • BiomedSegFM Challenge Dataset: Benchmarking multi-modal universal segmentation across 243 classes covering CT, MRI, PET, ultrasound, and electron microscopy.
  • MedSAM on Laptop (CVPR 2024) & Public 3D Repositories: Provided the pre-training and development base.
  • Evaluated on official validation and hidden community test benchmarks across semantic (DSC, NSD) and instance (F1, DSC TP) metrics.

Key Insights and Ideas

  • Parallelizing multi-class spatial prompting: Maintaining an explicit $N$-channel mask tensor alongside $N$ text queries enables simultaneous multi-organ segmentation. This removes the need to re-run the 3D backbone for each separate anatomical structure.
  • Coarse predictions double as natural spatial prompts: Instead of designing specialized prompting heuristics, the Stage-1 coarse output directly acts as the native-resolution spatial prompt for Stage-2 refinement.
  • Simulating imperfect prompts is essential: Training with synthetic block-level false positives and false negatives teaches the query decoder to fix mistakes and fill missing regions rather than naively copying the prompt.

Key Results

  • Accuracy: On the validation set across five modalities, Medal S achieved 75.44% DSC, 77.34% NSD, 38.24% F1, and 65.46% DSC TP, outperforming the baseline SAT model (69.83% DSC, 24.88% F1) and CAT (70.73% DSC).
  • Speedup: For a 24-class task, parallel spatial prompting completed inference in 40.63s versus 435.1s for sequential prompting—a >90% runtime reduction (>10× speedup)—while consuming 12.5 GB of GPU memory compared to the 9.49 GB unprompted baseline.
  • Test Set Performance: Achieved 58.06% DSC and 59.11% NSD, improving upon SAT (54.13% DSC), though trailing the concurrent 2D-based BiomedParse-V (74.97% DSC).

Limitations and Future Work

  • Ultrasound Performance Lag: Medal S fell behind SAT in ultrasound (82.45 vs. 85.58 DSC), as large target-to-patch ratios were not handled well by the fixed dynamic resampling formula.
  • Post-processing Sensitivity: Rule-based connected component post-processing provided negligible overall gains (+0.04 DSC) and slightly hurt F1 score (-0.18), indicating it occasionally removed genuine small instances.
  • Interactive Prompts: While full masks are supported natively, flexible interactive primitives (such as 2D scribble, click, or lasso prompts) are not yet integrated into the framework.

Summary updated

BibTeX
@misc{shi2025medal,
  author = {Pengcheng Shi and Jiawei Chen and Jiaqi Liu and Xinglin Zhang and Tao Chen and Lei Li},
  title = {{Medal S: Spatio-Textual Prompt Model for Medical Segmentation}},
  year = {2025},
  eprint = {2511.13001},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.13001},
}
Figure