arXiv:2608.24541cs.CVAug 2026

Manuscript Offprint

arXiv:2608.24541

Hierarchical Prototype-Memory Adaptation of SAM for Surgical Instrument Segmentation

Xinning Yao, Jingjing Wang, Jinghua Yue, Xiaoyan Luo, Fugen Zhou, Bo Liu

Xinning Yao 1^{1}, Jingjing Wang 1^{1}, Jinghua Yue 1^{1}, Xiaoyan Luo 1^{1}, Fugen Zhou 1^{1}, Bo Liu 1^{1}

Abstract—Surgical instrument segmentation (SIS) is fundamental for computer-assisted surgery, where reliable instrument masks enable precise scene understanding and clinical assistance. Recently, adapting foundation models like the Segment Anything Model (SAM) to the surgical domain via prompt-learning has shown encouraging results. However, the performance of these adapted models under challenging surgical conditions is constrained by suboptimal adaptation mechanisms. Specifically, optimizing prompts or prototypes purely via downstream segmentation loss tends to cause them to degenerate into task-specific parameters rather than serving as persistent, stable category memory, thereby degrading their robustness against complex intraoperative variations. Moreover, routing multi-scale visual cues through a single prompt pathway creates a bottleneck that hinders effective scale-matched coupling. To address these limitations, we propose HPMA, a Hierarchical Prototype-Memory Adaptation framework for SAM. Specifically, HPMA constructs a frozen, multi-scale visual prototype memory bank from annotated surgical scenes and integrates it into SAM's feature space using lightweight adapters to preserve stable category evidence. To maximize the utility of multi-scale cues, we introduce a scale-matched coupling mechanism where global prototypes calibrate class-level prompt features, structural prototypes guide decoder object queries, and local prototypes align high-resolution feature maps through a local alignment objective. Extensive experiments on the public EndoVis2017 and EndoVis2018 datasets demonstrate that our approach achieves state-of-the-art performance, outperforming existing foundation model adaptation methods.

INTRODUCTION

Accurate surgical instrument segmentation (SIS) plays a fundamental role in computer-assisted surgery, where reliable instrument masks are essential for precise scene understanding and clinical assistance. In recent years, vision foundation models, represented by the Segment Anything Model (SAM) and its multimodal evolution SAM3 [1], [2], [3], have demonstrated promising potential in general-purpose segmentation tasks. However, directly applying these models to the surgical domain is hindered by a substantial domain gap. Unlike objects in natural images, surgical instrument categories must be recognized from highly domain-specific visual evidence. Instruments often exhibit delicate structures, while surgical scenes commonly involve strong specular reflections, mutual occlusions, and ambiguous boundaries [4], [5]. Consequently, conventional parameter fine-tuning methods are often insufficient to bridge this gap effectively.

To address this challenge, existing prompt-learning methods [6], [7], such as SurgicalSAM [8], have attempted to

Figure

Fig. 1: The conceptual comparison of (a) previous prompt-learning method and our (b) hierarchical prototype-memory adaptation method.

incorporate domain-specific knowledge into foundation models, demonstrating their value in mitigating the discrepancy between generic representations and surgical semantics. Nevertheless, their performance under complex and highly variable surgical conditions remains constrained by suboptimal adaptation mechanisms. Specifically, existing methods suffer from two major limitations, as shown in Fig. 1(a). First, optimizing prompts or prototypes exclusively via downstream segmentation objectives frequently causes them to overfit as task-specific parameters, eroding their capacity to act as persistent, stable category memories and diminishing model robustness against intraoperative variations [7], [9]. Second, existing approaches typically route multi-scale visual cues through a single prompting pathway. This design creates a representational bottleneck that prevents effective scale-matched coupling between visual features and the corresponding model components [10], [11].

To overcome these limitations, we propose Hierarchical Prototype-Memory Adaptation (HPMA), a novel adaptation framework for SAM. To address the first limitation of prompt degeneration, HPMA explicitly decouples domain knowledge storage from downstream feature adaptation. As shown in Fig. 1, instead of optimizing prompts blindly, HPMA extracts

1^{1}Image Processing Center, Beihang University, Beijing, 100191, China. Corresponding Author: bo.liu@buaa.edu.cn visual evidence from annotated surgical scenes to construct a frozen multi-scale prototype memory bank. By clustering and preserving diverse visual evidence of surgical instruments, the memory bank serves as a persistent statistical memory insulated from downstream optimization objectives. We then introduce lightweight adapters that learn to transform this stable, class-specific visual evidence into effective feature enhancement, seamlessly injecting them into the feature space of SAM.

Furthermore, we argue that surgical instrument segmentation is not merely a single-scale adaptation problem. A model should capture not only the overall appearance of an instrument but also its complex internal structures and fine-grained details. Accordingly, visual evidence at different scales should be delivered to the model components best suited to exploit it. To this end, we design a hierarchical representation level-to-module coupling mechanism. At the global semantic level, global prototypes calibrate class-level text-prompt features before feature fusion. At the structural component level, structural prototypes are injected into the Transformer decoder to guide and refine object queries, enabling the model to better capture complex instrument structures. At the local detail level, local prototypes serve as local alignment targets for high-resolution feature maps during training, effectively sharpening fine-grained instrument details without introducing additional computational overhead at inference time.

In summary, our main contributions are as follows:

  • We propose HPMA, a framework that explicitly models visual evidence from the surgical domain as a prototype memory. Through lightweight adapters, HPMA transforms this frozen visual memory into model-specific feature enhancement, improving segmentation robustness in complex surgical scenes.

• We develop a hierarchical representation level-to-module coupling mechanism that reduces the representational bottleneck imposed by a single adaptation pathway. By adapting prototype memory at different scales to the appropriate stages of the model, the proposed mechanism more effectively alleviates class-level semantic mismatch, insufficient structural perception, and fine-grained detail deficiencies in surgical instrument segmentation.

  • We conduct extensive experiments on two public benchmarks, EndoVis2017 and EndoVis2018. The results demonstrate that HPMA substantially outperforms existing state-of-the-art methods and establishes new benchmark performance in terms of Challenge IoU and mean class IoU, with minimal inference overhead compared to existing adaptation methods.

References (31)