Complexity-Aware Surgical Video Reasoning Segmentation with Digital Twin and Context Memory
Organizations: Department of Computer Science, Johns Hopkins University
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.
Figures & tables
| Component | Origin | Status |
| DT-as-JSON and index retrieval | [ 22 , 23 , 24 ] | Inherited |
| Reasoning segmentation on surgical DTs | [ 21 ] | Inherited |
| Surgical DT from foundation models | [ 4 , 5 ] | Adapted |
| Two LoRA adapters with an RL router | This paper | New |
| Adaptive sliding window | This paper | New |
| Surgical context memory | This paper | New |
| Semantic | Spatial | Temporal | |||||||||
| Method | Type | FPS | |||||||||
| LISA [ 11 ] | Reas. | .556 .031 | .568 .024 | .562 .025 | .201 .042 | .213 .035 | .207 .036 | .238 .039 | .251 .033 | .245 .034 | 1.33 |
| VISA [ 31 ] | Reas. | .528 .023 | .547 .021 | .538 .019 | .457 .032 | .481 .028 | .469 .027 | .319 .037 | .338 .031 | .329 .032 | 1.87 |
| LLM-Seg [ 28 ] | Reas. | .387 .034 | .394 .031 | .391 .029 | .245 .043 | .258 .038 | .252 .037 | .176 .048 | .189 .041 | .183 .042 | 0.29 |
| SegZero [ 16 ] | Reas. | .509 .025 | .526 .022 | .518 .021 | .398 .033 | .421 .029 | .410 .028 | .312 .038 | .331 .032 | .322 .033 | 0.11 |
| CoReS [ 2 ] | Reas. | .560 .022 | .580 .019 | .570 .018 | .439 .028 | .463 .024 | .451 .023 | .351 .033 | .372 .029 | .362 .028 | 0.27 |
| Ref-EndoVis17 [ 14 ] (tool) | Ref-EndoVis18 [ 14 ] (tool) | Ref-EndoVis18 [ 14 ] (tissue) | |||||||
| Method | |||||||||
| LISA [ 11 ] | .388 .032 | .420 .029 | .355 .034 | .293 .041 | .284 .043 | .303 .037 | .237 .044 | .244 .042 | .229 .045 |
| VISA [ 31 ] | .507 .022 | .479 .026 | .535 .019 | .431 .028 | .398 .031 | .464 .024 | .384 .031 | .354 .033 | .414 .027 |
| LLM-Seg [ 28 ] | .307 .039 | .177 .047 | .437 .031 | .177 .048 | .105 .052 | .249 .041 | .153 .049 | .103 .053 | .203 .043 |
| SegZero [ 16 ] | .468 .027 | .388 .032 | .548 .022 | .388 .031 | .349 .034 | .427 .028 | .349 .033 | .321 .035 | .377 .030 |
| CoReS [ 2 ] | .495 .023 | .415 .028 | .575 .019 | .415 .027 | .377 .030 | .453 .024 | .377 .029 | .351 .031 | .403 .026 |
| Semantic | Spatial | Temporal | |||||||||||
| DT | Router | ASW | SCM | FPS | |||||||||
| ✗ | ✗ | ✗ | ✗ | .587 .031 | .601 .028 | .594 .027 | .445 .038 | .468 .033 | .457 .033 | .382 .041 | .405 .037 | .394 .036 | 1.5 |
| ✓ | ✗ | ✓ | ✓ | .718 .021 | .734 .018 | .726 .017 | .651 .024 | .675 .021 | .663 .020 | .578 .027 | .602 .023 | .590 .022 | 12.5 |
| ✓ | ✓ | ✗ | ✓ | .738 .018 | .754 .015 | .746 .014 | .678 .022 | .702 .019 | .690 .018 | .589 .025 | .613 .022 | .601 .021 | 17.8 |
| ✓ | ✓ | ✓ | ✗ | .745 .015 | .761 .013 | .753 .012 | .685 .020 | .710 .017 | .698 .016 | .598 .023 | .623 .020 | .611 .019 | 20.0 |
| ✓ | ✓ | ✓ | ✓ | .762 .013 | .779 .011 | .771 .010 | .704 .018 | .729 .014 | .717 .013 | .641 .021 | .667 .018 | .654 .017 | 18.8 |
| Setting | Masks | Semantic | Spatial | Temporal |
| ReSurgSAM2 [ 14 ] | own | .593 | .480 | .357 |
| ReSurgSAM2 [ 14 ] | DT | .607 | .492 | .371 |
| LISA [ 11 ] | DT | .572 | .224 | .258 |
| ReSurgSAM2, fine-tuned | own | .621 | .515 | .388 |
| Base LLM, zero-shot | DT | .618 | .442 | .379 |
| SurgReasonSeg (Ours) | DT | .771 | .717 | .654 |
| Semantic | Spatial | Temporal | Latency | |
| (ms) | ||||
| 0 | .753 .012 | .698 .015 | .611 .019 | 0.0 |
| 100 | .762 .011 | .709 .014 | .637 .018 | 0.5 |
| 250 | .768 .011 | .714 .014 | .649 .018 | 0.8 |
| 500 | .771 .010 | .717 .013 | .654 .017 | 1.2 |
| 1000 | .770 .011 | .716 .014 | .653 .017 | 2.1 |
| LLM | Semantic | Spatial | Temporal | |
| backbone | FPS | |||
| Qwen3-0.6B | .721 .016 | .668 .019 | .598 .024 | 24.7 |
| Qwen3-1.7B | .748 .013 | .695 .016 | .631 .020 | 19.5 |
| Qwen3-4B (Ours) | .771 .010 | .717 .013 | .654 .017 | 18.8 |
| Qwen3-8B | .774 .010 | .720 .013 | .659 .017 | 8.6 |
| Adapters | Router | Semantic | Spatial | Temporal | |
| SFT | RL | Judge | .742 | .688 | .615 |
| RL | Rule | Judge | .731 | .706 | .643 |
| RL | Classifier | Judge | .762 | .710 | .648 |
| RL | RL | Uniform | .758 | .702 | .640 |
| RL | RL | Judge | .771 | .717 | .654 |
| RL | RL | GT IoU | .775 | .721 | .658 |
| Sequence | Source | Semantic | Spatial | Temporal |
| seq-1 | EndoVis17 | .728 | .663 | .591 |
| seq-2 | EndoVis17 | .743 | .682 | .613 |
| seq-3 | EndoVis17 | .763 | .707 | .642 |
| seq-4 | EndoVis18 | .776 | .723 | .661 |
| seq-5 | EndoVis18 | .789 | .740 | .680 |
| seq-6 | EndoVis18 | .795 | .747 | .689 |
| Semantic | Spatial | Temporal | All | |
| Templates | 20 | 15 | 12 | 47 |
| Held-out templates | 4 | 3 | 3 | 10 |
| Test samples, held out | 85 | 68 | 52 | 205 |
| , held out | .746 | .692 | .628 | .698 |
Surgical Video Understanding
Surgical video understanding uses computer vision and multimodal AI to interpret procedures, instruments, actions, and events over time.
See all 118 papers