Source-linked AI summary

Hierarchical Prototype-Memory Adaptation of SAM for Surgical Instrument Segmentation

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

arXiv:2608.24541v1cs.CV

TL;DR

Surgical instrument segmentation is difficult because domain-specific variation and single-pathway prompt adaptation can undermine stable category memory and multi-scale use. HPMA preserves annotated surgical evidence in a frozen multi-scale prototype bank, couples scales to SAM3 modules through lightweight adapters, and reports state-of-the-art results on EndoVis2017 and EndoVis2018.

  • Problem

    Existing adaptation methods can make prompts or prototypes task-specific and route multi-scale visual cues through a bottleneck, limiting robustness under complex surgical conditions.

  • Method

    HPMA constructs a frozen multi-scale prototype memory and uses scale-matched lightweight adapters to calibrate prompts, refine decoder queries, and align high-resolution features.

  • Results

    HPMA substantially outperforms existing state-of-the-art methods on EndoVis2017 and EndoVis2018, establishing new Challenge IoU and mean class IoU benchmark performance with minimal inference overhead.

  • Takeaways & Limitations

    Frozen prototype memory and hierarchical coupling provide HPMA with reported accuracy and robustness against complex intraoperative variations.

Abstract

from arXiv · show

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

Surgical instrument segmentation requires robust adaptation to domain-specific, variable surgical scenes. HPMA addresses prompt degeneration and single-pathway scale bottlenecks with frozen prototype memory, hierarchical coupling, and lightweight adapters.

  • Surgical scenes contain delicate instruments, specular reflections, occlusions, and ambiguous visual evidence that hinder direct foundation-model transfer.
  • Existing prompt or prototype optimization can turn persistent category memory into task-specific parameters, while single-pathway prompting congests multi-scale cues.
  • HPMA constructs a frozen multi-scale prototype memory from annotated surgical scenes and uses lightweight adapters to inject stable visual evidence into SAM features.
  • Hierarchical coupling sends global prototypes to class-level text prompts, structural prototypes to decoder queries, and local prototypes to high-resolution feature alignment.
  • HPMA models surgical visual evidence as prototype memory and adapts each scale to an appropriate model stage to improve robustness and representation.
  • Extensive EndoVis2017 and EndoVis2018 experiments establish new Challenge IoU and mean class IoU benchmark performance with minimal inference overhead.

RELATED WORK

Prior SIS methods address surgical complexity through specialized architectures and SAM adaptation, but their knowledge storage and prompting mechanisms remain constrained.

  • SIS is challenged by specular reflections, occlusions, ambiguous boundaries, and high intra-class variation.
  • Specialist methods use mask attention, temporal modeling, vision-language representation, and instance-level representation learning, yet encode surgical knowledge implicitly in task-specific parameters.
  • SAM adaptation methods include full fine-tuning, LoRA, lightweight adapters, text guidance, hierarchical decoding, and decoder prompts, but optimized parameters can degenerate foundation priors.
  • Prompt-learning methods automate or specialize prompts, whereas existing approaches route multi-scale visual cues through one congested pathway; HPMA preserves them in frozen prototype memory.

METHODOLOGY

HPMA formulates SIS as class-prompted binary mask prediction over SAM3 and couples frozen prototypes to text features, decoder queries, and high-resolution features at matched representation levels.

  • The network predicts a binary mask for each instrument category from a surgical image and text prompt, separating frozen foundation parameters from trainable adapters.
  • SAM3 provides image and text encoders, a fusion encoder, transformer decoder, segmentation head, multi-scale visual features, and decoder object queries.
  • HPMA uses global prototypes to calibrate text features before fusion, structural prototypes to modify decoder queries, and local prototypes to align high-resolution features during training.
  • The framework overview organizes prototype construction, hierarchical representation-to-module coupling, and level-specific adaptation details into three stages.

Construction and Adaption of Multi-scale Prototype-Memory

HPMA builds stable multi-scale category evidence offline and uses lightweight residual adapters to integrate that frozen memory into SAM3 representations.

  • The framework centers on a frozen visual prototype memory bank and lightweight adapters that inject its evidence into the model backbone.
  • Masked average pooling extracts category-specific FPN representations at global, structural, and local scales from the frozen SAM3 encoder.
  • K-Means partitions pooled representations into K prototype vectors offline, preserving diverse intra-class surgical appearance evidence before training.
  • The prototype bank remains frozen during downstream optimization, preventing prototype degeneration and avoiding catastrophic forgetting of SAM3 priors.
  • At each scale, an adapter computes a residual update with a lightweight mapping function and a learnable scalar initialized to a small value.
  • The design separates evidence storage from feature adaptation: memory represents instrument appearance across conditions, while adapters learn its integration into the backbone.

Hierarchical Representation Level-to-Module Coupling

HPMA routes three levels of surgical visual evidence to matched SAM3 modules: global prototypes calibrate prompts, structural prototypes guide decoder queries, and local prototypes refine high-resolution features. This coupling avoids a single-pathway bottleneck and connects semantic, structural, and local information.

  • Hierarchical coupling: Scale-matched adapters route global, structural, and local cues to the SAM3 modules best suited to exploit them.The design targets category appearance, object-query formation, and high-resolution feature refinement respectively.
  • Global semantic level: Global prototypes calibrate class-level text prompts before image-text fusion, anchoring abstract embeddings to the surgical visual domain.The global adapter uses cross-attention with text tokens as queries and a projected global prototype as visual evidence.
  • Intermediate structural level: Structural prototypes modify decoder object queries, biasing spatial anchors toward instrument geometry such as shafts, jaws, and tips.The structural representation is injected into the SAM3 transformer decoder through a projected query residual.
  • Local level: Local features encode boundaries and textures, and a training-time alignment objective uses pooled high-resolution features without adding inference latency.The pooled feature is aligned toward the corresponding local prototype.
  • Hierarchical coupling: HPMA circumvents the single-pathway prompting bottleneck by bridging semantic calibration, structural awareness, and local detail refinement.The hierarchical coupling is presented as improving multi-class segmentation capabilities.

Training Objective

HPMA trains with the standard SAM3 objective augmented by a local prototype alignment term. The alignment uses cosine distance to orient high-resolution features toward local prototypes and improve robustness to scaling and illumination variation.

  • Overall objective: The overall objective combines the standard SAM3 loss with a weighted local prototype alignment loss.The SAM3 loss includes focal, dice, bounding box, generalized IoU, category classification, and presence supervision losses.
  • Local alignment: Cosine-based local alignment optimizes feature direction rather than L2 magnitude, making high-resolution representations invariant to absolute feature scaling.The design is intended to support fine-grained edge delineation under strong surgical specular reflections.
  • Local alignment: For each target object region, the alignment compares a spatially pooled high-resolution feature with its most semantically relevant projected local prototype.The loss is defined over N target object regions and category-specific prototype sets.

Datasets and Evaluation Metrics

HPMA is evaluated on the public EndoVis2017 and EndoVis2018 surgical instrument segmentation benchmarks. The evaluation uses four standard metrics, including visibility-aware Challenge IoU and class-averaged measures.

  • Benchmarks: HPMA is evaluated on two widely adopted public benchmarks: EndoVis2017 and EndoVis2018.Both datasets are used for surgical instrument segmentation evaluation.
  • EndoVis2017: EndoVis2017 contains eight videos and seven instrument categories, evaluated using the provided four-fold cross-validation protocol.Its categories include Bipolar Forceps, Prograsp Forceps, Large Needle Driver, Vessel Sealer, Grasping Retractor, Monopolar Curved Scissors, and Ultrasound Probe.
  • EndoVis2018: EndoVis2018 comprises eleven training videos and four validation videos across seven categories, with Suction Instrument and Clip Applier replacing two EndoVis2017 categories.The evaluation uses instrument-type segmentation annotations.
  • Metrics: The evaluation reports Challenge IoU, IoU, mean class IoU, and mean Dice.Challenge IoU measures intersection over union only for instrument categories actively visible in each frame.

Implementation Details

HPMA is evaluated against specialized surgical segmentation and SAM-based methods on EndoVis2017 and EndoVis2018, with implementation choices designed to retain selected pretrained components and assess efficiency and visual behavior.

  • Training configuration: The framework freezes SAM3's primary image, language, geometry, and fusion encoders while selectively unfreezing later blocks and layers during adaptation.The final four vision trunk blocks, final two language encoder blocks, and final two fusion encoder layers are selectively unfrozen.
  • Qualitative evaluation: Visual comparisons examine boundary delineation, category confusion, and attention localization under complex surgical variations.Fig. 3 presents visual comparative results, while Fig. 4 visualizes attention maps for SAM3 and HPMA; the reported analysis discusses overlapping tissues, occlusions, and instrument components.
  • Compared methods: HPMA is compared with specialized surgical segmentation models, SAM-based adaptation methods, and a GT Centroid + SAM3 baseline.The comparison includes ISINet, MATIS Frame, S3Net, SCI-Net, TrackAnything, PerSAM, SurgicalSAM, MA-SAM2, and Distillation-SAM.
  • Benchmark evaluation: The comparative evaluation reports results on EndoVis2017 and EndoVis2018, where HPMA achieves the best overall performance on both benchmarks.The tables identify the best results in bold, and the accompanying results text states that HPMA achieves the best overall performance on both datasets.
  • Efficiency evaluation: With the SAM ViT-H backbone, HPMA uses 4917.91 GFLOPs and runs at 2.69 FPS, compared with 5989.78 GFLOPs and 1.98 FPS for SurgicalSAM.The efficiency comparison reports both lower computational cost and faster inference for HPMA.

Ablation Study

Ablations on EndoVis2018 show that progressively adding global, structural, and local evidence improves segmentation, while scale-matched injection outperforms naive or inverted routing. Performance peaks with four prototypes per category.

  • Hierarchical evidence integration: Sequentially integrating hierarchical evidence steadily improves performance over a partially finetuned baseline without prototype injection.Global prototypes initially bridge the semantic domain gap.
  • Hierarchical evidence integration: 83.44% Challenge IoU follows the addition of structural-level adapters, up from 81.90%.The adapters provide geometric priors for articulated surgical instruments.
  • Hierarchical evidence integration: 84.12% Challenge IoU and 77.20% mc IoU are achieved after adding the local alignment objective.The objective refines high-resolution boundary details.
  • Injection strategies: Routing Global prototypes to Text features and Structural prototypes to the Decoder outperforms inverted mappings.Directly fusing Local prototypes into the segmentation head degrades performance, whereas the local auxiliary objective yields the highest Challenge IoU.
  • Prototype count: K=4 is the optimal prototype count, while K=1 fails to capture severe intra-class visual variations.Performance peaks at four prototypes per category.

CONCLUSION

HPMA adapts SAM3 to surgical instrument segmentation through frozen multi-scale prototype memory and scale-matched adapters. Experiments on EndoVis2017 and EndoVis2018 report state-of-the-art accuracy and robustness against complex intraoperative variations.

  • HPMA robustly adapts SAM3 for surgical instrument segmentation using a frozen multi-scale prototype memory bank and scale-matched adapters.The framework integrates semantic calibration, structural awareness, and local detail refinement into respective SAM3 modules.
  • Experiments on EndoVis2017 and EndoVis2018 demonstrate state-of-the-art accuracy and robustness against complex intraoperative variations.The conclusion also reports computational efficiency over existing baselines.
  • Future work will explore model compression and knowledge distillation to transfer learned capabilities into lightweight backbones for intraoperative platforms.The stated goal is support for real-time surgical navigation and robotic assistance.
Loading 2608.24541v1…