Papers › SurgicalSAM: Efficient Class Promptable Surgical Instrument Segmentation

SurgicalSAM: Efficient Class Promptable Surgical Instrument Segmentation

17 Aug 2023arXiv:2308.08746archive 2025-07-28

Wenxi Yue, Jing Zhang, Kun Hu, Yong Xia, Jiebo Luo, Zhiyong Wang

The Segment Anything Model (SAM) is a powerful foundation model that has revolutionised image segmentation. To apply SAM to surgical instrument segmentation, a common approach is to locate precise points or boxes of instruments and then use them as prompts for SAM in a zero-shot manner. However, we observe two problems with this naive pipeline: (1) the domain gap between natural objects and surgical instruments leads to inferior generalisation of SAM; and (2) SAM relies on precise point or box locations for accurate segmentation, requiring either extensive manual guidance or a well-performing specialist detector for prompt preparation, which leads to a complex multi-stage pipeline. To address these problems, we introduce SurgicalSAM, a novel end-to-end efficient-tuning approach for SAM to effectively integrate surgical-specific information with SAM's pre-trained knowledge for improved generalisation. Specifically, we propose a lightweight prototype-based class prompt encoder for tuning, which directly generates prompt embeddings from class prototypes and eliminates the use of explicit prompts for improved robustness and a simpler pipeline. In addition, to address the low inter-class variance among surgical instrument categories, we propose contrastive prototype learning, further enhancing the discrimination of the class prototypes for more accurate class prompting. The results of extensive experiments on both EndoVis2018 and EndoVis2017 datasets demonstrate that SurgicalSAM achieves state-of-the-art performance while only requiring a small number of tunable parameters. The source code is available at https://github.com/wenxi-yue/SurgicalSAM.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2308.08746")

Code

Syntology Ran 10 of 14 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 3 ran · fixture could not drive it; 7 ran with no contract checked.

By repository: official repository: 14 samples from 1 repository, 10 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

wenxi-yue/surgicalsam officialmentioned in papermentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

14 samples harvested; 10 ran; 0 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · fixture could not drive it
7ran
4unverified

Licence: 0 of the 14 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from wenxi-yue/surgicalsam. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

create_binary_masks wenxi-yue/surgicalsam/surgicalSAM/utils.py official repository ran MIT (permissive) · c415b7a608d4e28f · report
create_endovis_masks wenxi-yue/surgicalsam/surgicalSAM/utils.py official repository ran MIT (permissive) · cc557c224482ee77 · report
dice_loss wenxi-yue/surgicalsam/surgicalSAM/loss.py official repository ran MIT (permissive) · 27cddc06d6605b4e · report
eval_endovis wenxi-yue/surgicalsam/surgicalSAM/utils.py official repository ran MIT (permissive) · fd120c1f88221c37 · report
get_rel_pos wenxi-yue/surgicalsam/segment_anything/modeling/image_encoder.py official repository ran · fixture could not drive it MIT (permissive) · 733d7f0bedcb74c2 · report
model_forward_function wenxi-yue/surgicalsam/surgicalSAM/model_forward.py official repository ran MIT (permissive) · 45e6963aa726c950 · report
postprocess_masks wenxi-yue/surgicalsam/surgicalSAM/model_forward.py official repository ran MIT (permissive) · c3b872692385a7a1 · report
reduce_loss wenxi-yue/surgicalsam/surgicalSAM/loss.py official repository ran · fixture could not drive it MIT (permissive) · b2b9a1966482ef96 · report
weight_reduce_loss wenxi-yue/surgicalsam/surgicalSAM/loss.py official repository ran MIT (permissive) · bd54cbe9d9fb8b02 · report
window_partition wenxi-yue/surgicalsam/segment_anything/modeling/image_encoder.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 105fa08885dc36cc · report
build_sam_vit_b wenxi-yue/surgicalsam/segment_anything/build_sam.py official repository unverified MIT (permissive) · f9bc5f31ce61cee8 · report
build_sam_vit_h wenxi-yue/surgicalsam/segment_anything/build_sam.py official repository unverified MIT (permissive) · 6b77c1f11fff3ed6 · report
build_sam_vit_l wenxi-yue/surgicalsam/segment_anything/build_sam.py official repository unverified MIT (permissive) · 3f8890e695469246 · report
window_unpartition wenxi-yue/surgicalsam/segment_anything/modeling/image_encoder.py official repository unverified MIT (permissive) · 27be441cc8213e52 · report

Tasks

Image SegmentationSegmentationSemantic Segmentation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SAM

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections