Vivim: A Video Vision Mamba for Ultrasound Video Segmentation

Yijun Yang, Zhaohu Xing, Lequan Yu, Huazhu Fu, Chunwang Huang, Lei ZhuIEEE TCSVT 2025 · DOI

TL;DR

This paper introduces Vivim, a novel framework for medical video segmentation that leverages the efficiency of State Space Models (SSMs), specifically Mamba, to overcome the computational limitations of traditional Transformers in processing long video sequences. Vivim effectively captures both spatial and temporal information, leading to improved segmentation accuracy and efficiency in medical imaging tasks.

What Problem Does This Paper Address?

Medical video segmentation is crucial for computer-aided diagnosis and treatment, but it faces significant challenges. Traditional Convolutional Neural Networks (CNNs) have limited receptive fields, while Transformer-based networks, despite their success in capturing global context, suffer from quadratic computational complexity when dealing with long video sequences. This makes them computationally expensive and memory-intensive, especially in resource-constrained clinical settings. Furthermore, existing methods often struggle to simultaneously capture the causal temporal dynamics and preserve the non-causal spatial information inherent in medical videos, leading to ambiguous boundary predictions and inconsistencies.

Methods

Vivim builds upon the strengths of Mamba, a recent SSM architecture known for its linear complexity in modeling long sequences. The core innovation is the Temporal Mamba Block, which integrates Mamba's capabilities into a hierarchical encoder. This block is designed to efficiently extract spatiotemporal features.

Key methodological contributions include:

  • Hierarchical Encoder with Temporal Mamba Blocks: Vivim employs a multi-level encoder where each level utilizes Temporal Mamba Blocks. This allows for the extraction of features at varying scales, capturing both coarse and fine-grained information.
  • Spatiotemporal Selective Scan (ST-Mamba): To address the challenge of adapting SSMs to non-causal 2D medical image data, the authors introduce ST-Mamba. This module incorporates a tri-directional selective scan mechanism that simultaneously processes temporal forward, temporal backward, and spatial forward directions. This allows for efficient modeling of both single-frame spatial coherence and cross-frame temporal dependencies.
  • CNN-based Decoder: A lightweight CNN-based decoder is used to fuse the multi-level features extracted by the encoder and refine local details for precise segmentation.
  • Boundary-aware Affine Constraint: To mitigate ambiguous boundary predictions, an improved boundary-aware affine constraint is introduced during training. This constraint encourages the predicted boundaries to align with ground truth boundaries, enhancing discriminative ability on ambiguous lesions.

Datasets

The paper introduces a new dataset and utilizes existing ones for evaluation:

  • VTUS Dataset: A novel dataset for video thyroid ultrasound segmentation, comprising 100 video sequences (9342 frames) with pixel-level annotations. This dataset addresses the lack of publicly available, pixel-level annotated ultrasound videos for thyroid segmentation.
  • BUV2022 Dataset: Used for breast lesion ultrasound segmentation, containing 63 video sequences.
  • Polyp Datasets: Four widely used datasets (Kvasir, CVC-300, CVC-612, ASU-Mayo) are used for polyp segmentation.

Key Insights and Ideas

  • Mamba's Efficiency for Medical Video: The paper demonstrates that Mamba-based architectures can effectively handle the long temporal dependencies in medical videos with significantly lower computational complexity compared to Transformers. This opens doors for more efficient and accessible medical video analysis tools.
  • Bridging Causal and Non-Causal Information: The ST-Mamba module is a crucial innovation, enabling SSMs to effectively process non-causal spatial information in images while still leveraging their strength in temporal modeling. This is vital for medical imaging where spatial context is as important as temporal evolution.
  • Boundary Refinement is Key: The inclusion of a boundary-aware affine constraint highlights the importance of explicitly addressing boundary ambiguity in medical segmentation, a common challenge that can be overlooked by purely data-driven approaches.
  • Hierarchical Feature Extraction: The use of a hierarchical encoder with multi-level Temporal Mamba Blocks effectively captures features at different scales, which is beneficial for segmenting structures of varying sizes and complexities.

Key Results

Vivim demonstrates superior performance across multiple medical video segmentation tasks:

  • Thyroid Segmentation (VTUS): Achieved state-of-the-art results, outperforming existing methods by a significant margin (e.g., 2.61% and 2.74% in Dice and Jaccard, respectively, compared to the second-best method).
  • Breast Lesion Segmentation (BUV2022): Also showed top performance, with improvements over existing methods (e.g., 1.01% and 0.86% in Dice and Jaccard compared to the second-best method).
  • Polyp Segmentation: Consistently outperformed other methods on various polyp datasets, achieving high scores in metrics like maxDice and maxIoU.
  • Efficiency: Vivim exhibits significantly better efficiency, with a faster inference speed (higher FPS) and lower memory consumption compared to Transformer-based methods, especially when processing longer video sequences. For instance, it can infer video clips of over 150 frames using a single RTX4090.

Limitations and Future Work

  • Limitations:
    • The paper acknowledges that while ST-Mamba is efficient, it still relies on a CNN-based decoder for fine-grained detail preservation. A fully SSM-based solution for segmentation could be explored.
  • The boundary-aware affine constraint is applied during training; its real-time application might require further optimization.
  • Future Work:
    • The authors aim to develop a fully SSM-based solution for efficient medical video segmentation.
  • Further research into more innovative selective scan mechanisms tailored for medical video segmentation is planned.
  • The focus will be on better preserving spatial correlation between neighboring patches during 1D sequence interaction.

Summary updated

BibTeX
@article{yang2025vivim,
  author = {Yijun Yang and Zhaohu Xing and Lequan Yu and Huazhu Fu and Chunwang Huang and Lei Zhu},
  title = {{Vivim: A Video Vision Mamba for Ultrasound Video Segmentation}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2025},
  doi = {10.1109/tcsvt.2025.3563411},
}
Figure