iSegFormer: Interactive Segmentation via Transformers with Application to 3D Knee MR Images

Qin Liu, Zhenlin Xu, Yining Jiao, Marc Niethammer

TL;DR

iSegFormer is the first Transformer-based framework designed for interactive 3D medical image segmentation. By pairing a memory-efficient Swin Transformer with a lightweight MLP decoder and a video-based mask propagation network, it achieves state-of-the-art accuracy on 3D knee MRIs with minimal user interaction and competitive computational efficiency.

What Problem Does This Paper Address?

Deep learning has revolutionized medical image segmentation, but standard fully automated models are notoriously data-hungry. Generating the necessary voxel-level annotations requires immense time, labor, and clinical expertise. Interactive segmentation—where a user guides the model using simple inputs like clicks—offers a practical alternative.

While convolutional neural networks (CNNs) dominate this space, they suffer from limited receptive fields, often failing to capture global, long-range anatomical context. Vision Transformers (ViTs) naturally solve this issue via self-attention mechanisms, but they introduce two massive hurdles for 3D medical imaging:

  1. High Memory and Computational Cost: Interactive loops require real-time feedback (milliseconds per click), which standard heavy ViTs cannot sustain.
  2. Data Scarcity: 3D medical datasets with complete annotations are rare, making it difficult to train data-hungry Transformers from scratch.

Methods

The authors introduce iSegFormer, a framework that decouples 3D interactive segmentation into two highly efficient steps: interactive 2D slice segmentation and 3D mask propagation.

Overview of the iSegFormer framework and its underlying architecture.

1. The iSegFormer Architecture (2D Interactive Loop)

Instead of using a heavy Transformer encoder-decoder, iSegFormer combines a Swin Transformer backbone (which computes hierarchical self-attention efficiently via shifted windows) with a ultra-lightweight Multilayer Perceptron (MLP) decoder.

To incorporate user interactions without breaking compatibility with large-scale weights pretrained on ImageNet, the authors avoid standard channel concatenation. Instead, they encode the user's positive/negative clicks into a 2-channel map, pass both the image and the click map through separate patch embedding layers, and merge them using element-wise addition before feeding them into the Swin backbone.

2. 3D Extension via Video Propagation

To scale from 2D slices to a full 3D volume without requiring 3D labels for training, the authors leverage an off-the-shelf Space-Time Memory Network (STCN) originally trained for video object segmentation. The 3D volume is treated as a video sequence; once a user interactively segments a few key 2D slices using iSegFormer, STCN propagates those masks across the remaining unsegmented slices.

Datasets

  • OAI-ZIB: A public dataset consisting of 507 3D knee MR images. The authors focus specifically on the challenging task of femoral and tibial cartilage segmentation.
  • Cross-Domain Evaluation Datasets: To test generalizability, models were pretrained on the massive COCO+LVIS natural image dataset and evaluated across 5 natural image benchmarks (GrabCut, Berkeley, DAVIS, PascalVOC, SBD) and 3 medical datasets (ssTEM for cellular structures, BraTS for brain tumors, and OAI-ZIB).

Key Insights and Ideas

  • Zero-Shot Video-to-Medical Transfer: Remarkably, the STCN model trained exclusively on natural videos successfully propagates masks across 3D medical slices without any fine-tuning on medical data. This highlights a powerful shortcut for 3D medical imaging tasks.
  • Architecture Matters for Interactivity: While other recent Transformer backbones like SegFormer-B5 or HRFormer-B deliver strong results in static tasks, they fail in interactive settings. As shown in the paper's benchmarks, they exceed 5GB of GPU memory and take over 200ms per click, breaking the real-time requirement. iSegFormer maintains a sub-90ms response time.
  • Preserving Pretrained Weights: The element-wise addition trick for click embeddings allows the model to fully exploit massive natural image pretraining (ImageNet-21k), which proves essential for the model's high accuracy given the limited availability of medical training slices.

Key Results

2D Interactive Performance

On the OAI-ZIB test set, iSegFormer significantly outperformed its CNN counterparts (UNet and HRNet32), achieving target Intersection over Union (IoU) thresholds with substantially fewer user clicks.

Quantitative comparison on the OAI-ZIB test set.

Efficiency Benchmarks

iSegFormer strikes an excellent balance between memory consumption and speed (Seconds Per Click, or SPC), making it highly viable for real-time deployment compared to other Transformer alternatives.

Memory and speed comparison between different segmentation backbones.

3D Volume Propagation

When propagating masks from just a few interactively segmented slices across the entire 3D volume, the framework achieved highly competitive Dice Similarity Coefficients (DSC). Providing just 5 interactively labeled slices yielded an 82.2% Dice score for the entire 3D knee cartilage volume.

Femoral cartilage segmentation performance relative to the number of slices used for propagation.

Limitations and Future Work

While iSegFormer shows excellent in-domain performance, the authors noted a performance gap during out-of-domain cross-domain evaluations (e.g., training on natural images and testing on medical images without fine-tuning). In zero-shot cross-domain scenarios, well-tuned CNNs still occasionally held an edge, which the authors attribute to CNNs having better-optimized default hyperparameters for cross-domain transfer.

Future work includes optimizing Transformer hyperparameters specifically for cross-domain medical tasks and exploring tighter, end-to-end integration between the interactive 2D loop and the 3D propagation module.

Summary updated

BibTeX
@inproceedings{liu2022isegformer,
  author = {Qin Liu and Zhenlin Xu and Yining Jiao and Marc Niethammer},
  title = {{iSegFormer: Interactive Segmentation via Transformers with Application to 3D Knee MR Images}},
  booktitle = {International Conference on Medical Image Computing and Computer-Assisted Intervention},
  year = {2022},
  doi = {10.1007/978-3-031-16443-9\_45},
}
Figure