SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.08746 · 2023

SurgicalSAM: Efficient Class Promptable Surgical Instrument Segmentation

arXiv · PDF · Open in the Atlas

Code that ran

11 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 11 failures of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2308.08746.json · badge: /api/ran/2308.08746.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
wenxi-yue/surgicalsam canonical (classifier label)
classifier basis: census
11 ran · 3 no recorded run
FunctionStatusWhere it lives
create_binary_masks Ran
ran; our contract draft was wrong, not the code
wenxi-yue/surgicalsam/surgicalSAM/utils.py
code served (permissive licence) · get_code("c415b7a608d4e28f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import os.path as osp

torch.manual_seed(0)

# The function expects:
# - binary_masks: dict (mutable, gets modified)
# - preds: tensor with shape (batch, ...) that supports .cpu() and > comparison
# - preds_quality: tensor with shape (batch,) that supports .cpu() and .item()
# - mask_names: list of strings with format "seq_name/frame_prefix_..."
# - thr: threshold value (float)

ARGS = {
    'binary_masks': {},
    'preds': torch.randn(2, 4),  # batch_size=2, some feature dim=4
    'preds_quality': torch.randn(2),  # batch_size=2
    'mask_names': [
        'sequence_01/frame_001_class_a.png',
        'sequence_02/frame_042_class_b.png',
    ],
    'thr': 0.5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_endovis_masks Ran
ran; our contract draft was wrong, not the code
wenxi-yue/surgicalsam/surgicalSAM/utils.py
code served (permissive licence) · get_code("cc557c224482ee77")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch

# Create test data structure matching the function's expected input format
# binary_masks is a nested dict: {seq -> {frame -> [binary_mask_dicts]}}

H = 128
W = 256

# Create a small binary mask tensor
mask_tensor = torch.zeros((H, W), dtype=torch.float32)
mask_tensor[10:20, 10:20] = 1  # Create a small region of 1s

# Create binary mask dictionaries for a single sequence and frame
binary_mask_dict_1 = {
    'mask_name': 'class1_mask',
    'mask': mask_tensor,
    'mask_quality': 0.8
}

binary_mask_dict_2 = {
    'mask_name': 'class2_mask',
    'mask': mask_tensor,
    'mask_quality': 0.9
}

# Build the nested dictionary structure
binary_masks = {
    'seq_001': {
        'frame_001': [binary_mask_dict_1, binary_mask_dict_2]
    },
    'seq_002': {
        'frame_001': [binary_mask_dict_1],
        'frame_002': [binary_mask_dict_2]
    }
}

ARGS = {
    'binary_masks': binary_masks,
    'H': H,
    'W': W
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
dice_loss Ran
ran; our contract draft was wrong, not the code
wenxi-yue/surgicalsam/surgicalSAM/loss.py
code served (permissive licence) · get_code("27cddc06d6605b4e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small test tensors
batch_size = 2
feature_dim = 4

# pred: predictions, shape (n, *)
pred = torch.randn(batch_size, feature_dim)

# target: learning labels, same shape as pred
target = torch.randint(0, 2, (batch_size, feature_dim)).float()

# weight: optional weights for each prediction, shape (n,)
weight = torch.rand(batch_size)

# eps: small value to avoid division by zero
eps = 0.001

# reduction: how to reduce loss ("none", "mean", "sum")
reduction = 'mean'

# naive_dice: whether to use naive dice loss
naive_dice = False

# avg_factor: optional average factor for computing mean
avg_factor = None

ARGS = {
    'pred': pred,
    'target': target,
    'weight': weight,
    'eps': eps,
    'reduction': reduction,
    'naive_dice': naive_dice,
    'avg_factor': avg_factor,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
eval_endovis Ran
ran; our contract draft was wrong, not the code
wenxi-yue/surgicalsam/surgicalSAM/utils.py
code served (permissive licence) · get_code("fd120c1f88221c37")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create small sample masks for 2 frames
# Masks should be 2D arrays with class labels (0-7)
frame_height, frame_width = 4, 3

# Create predicted masks dictionary
endovis_masks = {}
# Frame 1: predicted mask with some class labels
frame1_pred = np.random.randint(0, 8, size=(frame_height, frame_width)).astype(np.float64)
frame1_pred[0:2, 0:2] = 1  # Ensure some valid class labels
endovis_masks['frame_001'] = frame1_pred

# Frame 2: predicted mask
frame2_pred = np.random.randint(0, 8, size=(frame_height, frame_width)).astype(np.float64)
frame2_pred[1:3, 1:3] = 2  # Ensure some valid class labels
endovis_masks['frame_002'] = frame2_pred

# Create groundtruth masks dictionary (as torch tensors)
gt_endovis_masks = {}
# Frame 1: gt mask
frame1_gt = torch.randint(0, 8, size=(frame_height, frame_width))
frame1_gt[0:2, 0:2] = 1  # Ensure some valid class labels
gt_endovis_masks['frame_001'] = frame1_gt

# Frame 2: gt mask
frame2_gt = torch.randint(0, 8, size=(frame_height, frame_width))
frame2_gt[1:3, 1:3] = 2  # Ensure some valid class labels
gt_endovis_masks['frame_002'] = frame2_gt

ARGS = {
    'endovis_masks': endovis_masks,
    'gt_endovis_masks': gt_endovis_masks,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_rel_pos Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wenxi-yue/surgicalsam/segment_anything/modeling/image_encoder.py
code served (permissive licence) · get_code("733d7f0bedcb74c2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 3, dtype family float, shape (3, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small relative position embedding tensor
# Shape: (L, C) where L is the sequence length and C is the channel dimension
# Using a small size that will be resized by the function
rel_pos = torch.randn(5, 4)  # 5 positions, 4 channels

# Define query and key sizes
q_size = 3
k_size = 4

ARGS = {
    "q_size": q_size,
    "k_size": k_size,
    "rel_pos": rel_pos,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (3, 4, 4) — shape (3, 4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
model_forward_function Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wenxi-yue/surgicalsam/surgicalSAM/model_forward.py
code served (permissive licence) · get_code("45e6963aa726c950")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.nn import functional as F

torch.manual_seed(0)

# Mock classes for the models
class PrototypePromptEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(256, 256)
    
    def forward(self, sam_feats, prototypes, cls_ids):
        # sam_feats: (b, h*w, c) -> (2, 4096, 256)
        # prototypes: (num_classes, c) -> (3, 256)
        # cls_ids: (b,) -> (2,)
        batch_size = sam_feats.shape[0]
        num_classes = prototypes.shape[0]
        
        # Return dense and sparse embeddings
        dense_embeddings = torch.randn(batch_size, 256, 64, 64)
        sparse_embeddings = torch.randn(batch_size, 2, 256)
        return dense_embeddings, sparse_embeddings

class SamPromptEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(256, 256)
    
    def get_dense_pe(self):
        # Return positional encoding for 64x64
        return torch.randn(1, 256, 64, 64)

class SamDecoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(256, 256)
    
    def forward(self, image_embeddings, image_pe, sparse_prompt_embeddings, dense_prompt_embeddings, multimask_output=False):
        # image_embeddings: (1, c, 64, 64)
        # sparse_prompt_embeddings: (1, 2, 256)
        # dense_prompt_embeddings: (1, 256, 64, 64)
        
        # Return low_res_masks and mask_quality
        low_res_masks = torch.randn(1, 1, 256, 256)
        mask_quality = torch.randn(1, 1)
        return low_res_masks, mask_quality

# Create instances
prototype_prompt_encoder = PrototypePromptEncoder()
sam_prompt_encoder = SamPromptEncoder()
sam_decoder = SamDecoder()

# Create input tensors
batch_size = 2
sam_feats = torch.randn(batch_size, 64, 64, 256)  # b, h, w, c
prototypes = torch.randn(3, 256)  # num_classes, c
cls_ids = torch.tensor([0, 1])  # batch_size

ARGS = {
    "prototype_prompt_encoder": prototype_prompt_encoder,
    "sam_prompt_encoder": sam_prompt_encoder,
    "sam_decoder": sam_decoder,
    "sam_feats": sam_feats,
    "prototypes": prototypes,
    "cls_ids": cls_ids,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
postprocess_masks Ran
ran; our contract draft was wrong, not the code
wenxi-yue/surgicalsam/surgicalSAM/model_forward.py
code served (permissive licence) · get_code("c3b872692385a7a1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 768, 640) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small batched mask tensor in BxCxHxW format
# B=2 (batch size), C=3 (channels), H=512, W=512 (intermediate size)
masks = torch.randn(2, 3, 512, 512)

# input_size: the size the image was resized to before model input (H, W)
input_size = (1024, 1024)

# original_size: the original image size before any resizing (H, W)
original_size = (768, 640)

ARGS = {
    "masks": masks,
    "input_size": input_size,
    "original_size": original_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 3, 768, 640) — shape (2, 3, 768, 640) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reduce_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wenxi-yue/surgicalsam/surgicalSAM/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from OpenFirework/pytorch_solov2, is pointer only (licence: NONE) · get_code("b2b9a1966482ef96")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from OpenFirework/pytorch_solov2, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

weight_reduce_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wenxi-yue/surgicalsam/surgicalSAM/loss.py
code served (permissive licence) · get_code("bd54cbe9d9fb8b02")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small loss tensor (batch_size=2, feature_dim=4)
loss = torch.randn(2, 4)

# Create a weight tensor with same shape as loss
weight = torch.randn(2, 4)

# reduction can be 'none', 'mean', or 'sum'
reduction = 'mean'

# avg_factor is optional float for computing mean of losses
avg_factor = None

ARGS = {
    'loss': loss,
    'weight': weight,
    'reduction': reduction,
    'avg_factor': avg_factor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
window_partition Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wenxi-yue/surgicalsam/segment_anything/modeling/image_encoder.py
pointer only (licence: MIT); the stored copy get_code serves, from LeapLabTHU/EchoWorld, is pointer only (licence: NONE) · get_code("105fa08885dc36cc")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from LeapLabTHU/EchoWorld, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

window_unpartition Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wenxi-yue/surgicalsam/segment_anything/modeling/image_encoder.py
pointer only (licence: MIT); the stored copy get_code serves, from yatengLG/ISAT_with_segment_anything, is pointer only (licence: NOASSERTION) · get_code("27be441cc8213e52")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yatengLG/ISAT_with_segment_anything, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

build_sam_vit_b Not yet run
unverified (harvested, no recorded run)
wenxi-yue/surgicalsam/segment_anything/build_sam.py
pointer only (licence: MIT); the stored copy get_code serves, from yatengLG/ISAT_with_segment_anything, is pointer only (licence: NOASSERTION) · get_code("f9bc5f31ce61cee8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yatengLG/ISAT_with_segment_anything, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

build_sam_vit_h Not yet run
unverified (harvested, no recorded run)
wenxi-yue/surgicalsam/segment_anything/build_sam.py
pointer only (licence: MIT); the stored copy get_code serves, from yatengLG/ISAT_with_segment_anything, is pointer only (licence: NOASSERTION) · get_code("6b77c1f11fff3ed6")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yatengLG/ISAT_with_segment_anything, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

build_sam_vit_l Not yet run
unverified (harvested, no recorded run)
wenxi-yue/surgicalsam/segment_anything/build_sam.py
pointer only (licence: MIT); the stored copy get_code serves, from yatengLG/ISAT_with_segment_anything, is pointer only (licence: NOASSERTION) · get_code("3f8890e695469246")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yatengLG/ISAT_with_segment_anything, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 14 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 6 the same month, 14 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_rel_pos 47 other papers
12 dated earlier, 1 the same month, 34 later · 5 only as an assembly brick
2304.02643 (2023-04)
Segment Anything
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
and 44 more not named here
window_partition 47 other papers
12 dated earlier, 1 the same month, 34 later · 1 only as an assembly brick
2304.02643 (2023-04)
Segment Anything
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
and 44 more not named here
window_unpartition 46 other papers
12 dated earlier, 1 the same month, 33 later · 1 only as an assembly brick
2304.02643 (2023-04)
Segment Anything
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
and 43 more not named here
build_sam_vit_h 37 other papers
9 dated earlier, 1 the same month, 27 later · 2 only as an assembly brick
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
2305.01586 (2023-05)
An Alternative to WSSS? An Empirical Study of the Segment Anything Model (SAM) on Weakly-Supervised Semantic Segmentation Problems
and 34 more not named here
build_sam_vit_b 34 other papers
9 dated earlier, 1 the same month, 24 later
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
2305.01586 (2023-05)
An Alternative to WSSS? An Empirical Study of the Segment Anything Model (SAM) on Weakly-Supervised Semantic Segmentation Problems
and 31 more not named here
build_sam_vit_l 34 other papers
9 dated earlier, 1 the same month, 24 later
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
2305.01586 (2023-05)
An Alternative to WSSS? An Empirical Study of the Segment Anything Model (SAM) on Weakly-Supervised Semantic Segmentation Problems
and 31 more not named here
reduce_loss 18 other papers
6 dated earlier, 10 later, 2 same year, order not determinable
2003.10152 (2020-03)
SOLOv2: Dynamic and Fast Instance Segmentation
2003.10778 (2020-03)
PanNuke Dataset Extension, Insights and Baselines
2107.08430 (2021-07)
YOLOX: Exceeding YOLO Series in 2021
and 15 more not named here
create_binary_masks 1 other paper
1 later
aaai_28514 (2024 (year only))
SurgicalSAM: Efficient Class Promptable Surgical Instrument Segmentation
create_endovis_masks 1 other paper
1 later
aaai_28514 (2024 (year only))
SurgicalSAM: Efficient Class Promptable Surgical Instrument Segmentation
dice_loss 1 other paper
1 later
aaai_28514 (2024 (year only))
SurgicalSAM: Efficient Class Promptable Surgical Instrument Segmentation
eval_endovis 1 other paper
1 later
aaai_28514 (2024 (year only))
SurgicalSAM: Efficient Class Promptable Surgical Instrument Segmentation
model_forward_function 1 other paper
1 later
aaai_28514 (2024 (year only))
SurgicalSAM: Efficient Class Promptable Surgical Instrument Segmentation
postprocess_masks 1 other paper
1 later
aaai_28514 (2024 (year only))
SurgicalSAM: Efficient Class Promptable Surgical Instrument Segmentation
weight_reduce_loss 1 other paper
1 later
aaai_28514 (2024 (year only))
SurgicalSAM: Efficient Class Promptable Surgical Instrument Segmentation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2308.08746")
get_code_for_paper("2308.08746")
have("2308.08746")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2308.08746.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2308.08746.svg)](https://syntology.ai/paper/2308.08746)

Connect an agent — have() is free.