SAM2S: Segment Anything in Surgical Videos via Semantic Long-term Tracking

Haofeng Liu, Ziyue Wang, Sudhanshu Mishra, Mingqi Gao, Guanyi Qin, Chang Han Low, Alex Y. W. Kong, Yueming JinarXiv 2025 · DOI

Abstract

The release of Meta’s Segment Anything Model 2 (SAM2) marked a significant milestone in video object segmentation. However, the high-stakes, visually chaotic environment of a surgical theater presents unique challenges—such as long-term tracking requirements and semantic ambiguity—that vanilla foundation models struggle to address. This paper introduces SAM2S, a foundation model specifically adapted for surgical video. By leveraging a novel diverse memory mechanism (DiveMem), temporal semantic learning (TSL), and ambiguity-resilient learning (ARL), SAM2S sets a new state-of-the-art for interactive surgical video segmentation. Operating at 68 FPS, SAM2S outperforms vanilla SAM2 by over 17 points in tracking accuracy on the newly introduced SA-SV benchmark.

Introduction

Surgical video segmentation—the precise tracking of instruments and anatomy in real-time—is a cornerstone of modern computer-assisted surgery. It facilitates intraoperative guidance, safety monitoring, and post-operative skill assessment. While SAM2 offers a powerful starting point for general video tracking, it faces three major hurdles in the operating room (OR):

  1. The Domain Gap: Surgical scenes are characterized by specular reflections, blood, smoke, and unique tissue textures that differ significantly from the "natural" videos used to train general-purpose models.
  2. The Duration Gap: Standard video benchmarks typically last only seconds, whereas surgical procedures can span hours. SAM2’s standard memory mechanism prioritizes recent frames, often losing track of objects that disappear and reappear over long intervals.
  3. The Ambiguity Gap: Unlike discrete objects like cars or animals, the boundaries between different human tissues are often visually ambiguous. Furthermore, inconsistent labeling across medical datasets can confuse standard models.
Figure 1: (a-b) Overview of the SA-SV benchmark scale and categories. (c-d) Comparison of tracking challenges between natural and surgical videos.

The SA-SV Benchmark

A primary contribution of this work is the SA-SV (Segment Anything in Surgical Video) benchmark, the largest and most diverse of its kind. It aggregates 17 open-source datasets covering 8 different procedure types, including Cholecystectomy, Hysterectomy, and Nephrectomy. The benchmark features 61k frames and 1.6k masklets (spatio-temporal tracks). To ensure a high-quality training signal, the researchers manually corrected over 20,000 erroneous masks and standardized instrument labels across all source datasets.

SAM2S Methodology

SAM2S retains the core architecture of SAM2 but integrates three surgical-specific innovations designed to bridge the identified gaps:

  • DiveMem (Diverse Memory): To address the duration gap, DiveMem replaces simple recency-based memory with a hybrid sampling strategy. During inference, it uses a diversity-based filter (calculating cosine similarity) to select the most "distinct" historical frames for the memory bank. This prevents the model from overfitting to a single camera angle and improves long-term stability.
  • TSL (Temporal Semantic Learning): While SAM2 is class-agnostic, SAM2S leverages the fact that surgical instruments fall into well-defined categories. It utilizes a CLIP-based text encoder to inject semantic knowledge into the tracking process, helping the model re-identify specific tools even after prolonged occlusions.
  • ARL (Ambiguity-Resilient Learning): To manage the "messy" nature of surgical labels, ARL employs label softening. Instead of enforcing hard boundaries for visually ambiguous tissue, it uses a Gaussian kernel to create a soft probability distribution, making the model more robust to noisy or subjective annotations.
Figure 4: The SAM2S architecture, highlighting the integration of DiveMem, TSL, and ARL modules for enhanced surgical tracking.

Experimental Results

SAM2S demonstrates substantial performance gains across multiple metrics:

  • Accuracy: The model achieved an average 80.42 $\mathcal{J}\&\mathcal{F}$ score, representing a 17.10-point improvement over vanilla SAM2 and a 4.11-point lead over a version of SAM2 fine-tuned specifically on surgical data.
  • Real-time Performance: Despite the additional modules, SAM2S maintains a throughput of 68 FPS on a single NVIDIA A6000 GPU, meeting the requirements for live intraoperative use.
  • Zero-Shot Generalization: When tested on unseen procedures (e.g., nephrectomy), the model maintained superior performance, indicating it has learned generalizable "surgical logic" rather than merely memorizing specific training sequences.

Conclusion

SAM2S represents a significant step toward robust, real-time foundation models for the operating room. By prioritizing memory diversity and semantic anchors, it overcomes the limitations of general-purpose tracking models in medical environments. Future work will focus on expanding the model's semantic understanding of varied tissue types and exploring integration with robotic control loops for autonomous surgical assistance.

Summary updated

BibTeX
@misc{liu2025sam,
  author = {Haofeng Liu and Ziyue Wang and Sudhanshu Mishra and Mingqi Gao and Guanyi Qin and Chang Han Low and Alex Y. W. Kong and Yueming Jin},
  title = {{SAM2S: Segment Anything in Surgical Videos via Semantic Long-term Tracking}},
  year = {2025},
  eprint = {2511.16618},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.16618},
}
Figure