arXiv:2610.28776cs.CVOct 2026

Manuscript Offprint

arXiv:2610.28776

Complexity-Aware Surgical Video Reasoning Segmentation with Digital Twin and Context Memory

Yiqing Shen, Mathias Unberath

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Conventional surgical segmentation relies on closed-set categories or explicit text queries, which cannot resolve implicit queries that require reasoning about workflows, instrument functions, and temporal relationships. To address these limitations, we propose SurgReasonSeg, a complexity-aware method that brings reasoning segmentation over digital twin (DT) representations to surgical video. Specifically, SurgReasonSeg constructs DT representations from surgical foundation models and trains two low-rank adapters (LoRA) of one large language model with reinforcement learning (RL), each specialized for a different query complexity. A lightweight router, also trained with RL, selects between the two adapters to balance latency against accuracy. SurgReasonSeg also sets the temporal context with an adaptive sliding window conditioned on query complexity and workflow phase, and retrieves relevant historical cases from a surgical context memory by workflow similarity and procedural relevance. We further introduce EndoVis-ReasonSeg, a surgical reasoning segmentation benchmark with 1,460 training and 961 test samples across semantic, spatial, and temporal categories. On EndoVis-ReasonSeg, SurgReasonSeg improves J&F over the strongest baseline, ReSurgSAM2, by 0.178, 0.237, and 0.297 on semantic, spatial, and temporal queries, and it also achieves the best results on the Ref-EndoVis17 and Ref-EndoVis18 referring segmentation benchmarks. A backbone-matched attribution protocol separates the contribution of the upstream segmenter from that of the reasoning modules. Our method runs at 18.8 FPS averaged over the query distribution, enabling real-time reasoning segmentation in surgical videos.

1. Introduction

Surgical autonomy requires precise segmentation of anatomical structures and instruments in endoscopic videos [1], yet surgeons often express their intent through functional and contextual descriptions tied to the ongoing procedure rather than through explicit anatomical labels [23]. Conventional segmentation methods rely on pre-defined closed-set categories [12], restricting them to a fixed vocabulary that cannot accommodate such intent-driven communication. Referring segmentation [10] partially mitigates this by identifying objects through explicit text queries [15, 27, 35], yet still requires the surgeon to name the target. In practice, many surgical tasks require interpreting implicit queries that involve reasoning about workflows, instrument functions, and temporal procedural relationships [17]. For instance, rather than “the grasper”, a surgeon may ask for “the instrument retracting tissue for dissection”, expecting the target to be inferred from workflow context and instrument roles, a task that reasoning segmentation addresses through multi-step inference [31].

Existing reasoning segmentation methods such as LISA [11] and VISA [31] pair multimodal large language models (LLMs) with segmentation decoders, yet are trained on general-domain data and lack surgical knowledge [23]. While fine-tuning on surgical reasoning segmentation data could offer a partial solution, it requires costly annotations and yields a model whose knowledge is fixed at training time. Existing methods also cannot retrieve relevant historical context from long procedures, either processing all information uniformly or discarding past observations [3, 8]. Finally, surgical queries vary in reasoning complexity, from identifying an object to understanding the workflow [30], yet existing methods allocate the same computation to every query and spend unnecessary latency on simple ones.

To address these limitations, we propose SurgReasonSeg, an online video reasoning segmentation method built on digital twin (DT) representations [20–22, 24], which serve as intermediate abstractions between raw video and reasoning. SurgReasonSeg constructs the DT with surgical foundation models such as SurgSAM2 [14] and RASO [12], incorporating surgical domain knowledge directly into the representation. The DT-as-JSON encoding and the reduction of segmentation to index retrieval are inherited from prior DT reasoning segmentation methods [20, 21, 23, 24], not proposed here. Tab. 1 lists what is inherited and what is new, and Tab. 5 quantifies the contribution of each part. To handle varying query complexity, we train two low-rank adapters (LoRA) [6] on the same base LLM with reinforcement learning (RL) [19], one producing extended reasoning chains and the other concise ones. A lightweight router, also trained with RL, selects between the two adapters to balance latency against accuracy. We also propose an adaptive sliding window that adjusts the length of the temporal context to the query complexity and the workflow phase, so that the LLM receives only as much context as the query requires. To reuse experience accumulated across cases, we introduce a surgical context memory that stores past DT representations together with their queries and outcomes. At inference, the memory retrieves past cases by workflow similarity and procedural relevance and supplies them to the LLM as in-context examples.

The major contributions are threefold, summarized as follows. First, we propose SurgReasonSeg, an online video reasoning segmentation method that adapts DT-based reasoning segmentation to surgical video by constructing the DT from surgical foundation models. Specifically, two RL-trained LoRA adapters handle queries of different complexity, and a router selects between them at inference. Second, we introduce an adaptive sliding window that sets the temporal context from the query complexity and the surgical workflow phase, and a surgical context memory that retrieves past cases by workflow similarity and procedural relevance. Finally, we contribute EndoVis-ReasonSeg, a surgical reasoning segmentation benchmark for training and evaluation. We also report a backbone-matched attribution study that separates the contribution of the upstream segmenter from that of the reasoning modules, together with a template-disjoint evaluation that tests for template-level leakage.

References (27)