Surgical SAM 3.1 V2
Surgical SAM 3.1 V2 is an open vocabulary detector and instance segmenter for surgical scenes. A text prompt specifies an instrument, instrument part, organ, or tissue category. The dataset schema defines 33 prompt categories, of which 29 have positive training annotations.
V2 is trained from Base SAM 3.1 on 34,316 training images. The expanded data add (i) liver and gallbladder masks from CRCD and (ii) instrument body, wrist, and gripper masks from uTenn. Each image records its annotation scope, so training and evaluation issue negative labels only for categories that were annotated in that image.
The default checkpoint combines the fine tuned image detector with the native SAM 3.1 multiplex tracker. The detector initializes text prompted objects, and the tracker propagates their identities through video.
Results
We selected the checkpoint using mask AP on the 4,248 image validation split. We then evaluated it once on the expanded test split, which contains 4,320 images and 28 categories with positive instances.
| Evaluation | Images | Categories | Box AP | Mask AP | Box AP50 | Mask AP50 | Mask AP75 |
|---|---|---|---|---|---|---|---|
| Expanded test split | 4,320 | 28 | 0.4874 | 0.3890 | 0.6395 | 0.5000 | 0.4197 |
Comparison with Surgical SAM 3.1
The matched comparison uses the original grouped test split, which contains 4,134 images and 24 categories with positive instances. Surgical SAM 3.1 V2 and the previous Surgical SAM 3.1 model use identical images, prompts, annotation scopes, postprocessing, and COCO evaluation settings.
| Model | Box AP | Mask AP | Box AP50 | Mask AP50 | Mask AP75 |
|---|---|---|---|---|---|
| Surgical SAM 3.1 V2 | 0.4700 | 0.3557 | 0.6208 | 0.4688 | 0.3898 |
| Surgical SAM 3.1 | 0.4654 | 0.3503 | 0.6258 | 0.4620 | 0.3730 |
| Change from Surgical SAM 3.1 | +0.0045 | +0.0054 | −0.0050 | +0.0069 | +0.0167 |
COCO AP averages precision across ten intersection over union thresholds from 0.50 through 0.95. The expanded result and the matched comparison use different test populations, so they are reported separately.
Category groups
| Category group | Concepts with test instances | Box macro AP | Mask macro AP |
|---|---|---|---|
| Instruments | 8 | 0.8300 | 0.7473 |
| Anatomy and tissue | 16 | 0.2960 | 0.1679 |
| Instrument parts | 4 | 0.5681 | 0.5571 |
| Concept | Test images | Test instances | Box AP | Mask AP |
|---|---|---|---|---|
| grasper | 2,859 | 3,754 | 0.789 | 0.564 |
| hook | 2,295 | 2,295 | 0.903 | 0.873 |
| irrigator | 241 | 241 | 0.935 | 0.895 |
| clipper | 175 | 175 | 0.877 | 0.826 |
| bipolar | 215 | 215 | 0.884 | 0.765 |
| scissors | 92 | 92 | 0.825 | 0.815 |
| snare | 2 | 2 | 0.586 | 0.544 |
| surgical instrument | 4,131 | 6,907 | 0.841 | 0.697 |
| abdominal wall | 769 | 769 | 0.500 | 0.059 |
| liver | 1,017 | 1,017 | 0.346 | 0.068 |
| gastrointestinal tract | 380 | 380 | 0.114 | 0.003 |
| fat | 1,280 | 1,280 | 0.702 | 0.000 |
| connective tissue | 960 | 960 | 0.053 | 0.000 |
| cystic duct | 264 | 264 | 0.054 | 0.020 |
| gallbladder | 889 | 889 | 0.283 | 0.100 |
| liver ligament | 1,099 | 1,099 | 0.426 | 0.000 |
| cystic plate | 19 | 19 | 0.182 | 0.144 |
| calot triangle | 14 | 14 | 0.362 | 0.357 |
| cystic artery | 28 | 28 | 0.045 | 0.037 |
| colon | 58 | 58 | 0.192 | 0.163 |
| pancreas | 17 | 17 | 0.246 | 0.254 |
| small intestine | 4 | 4 | 0.000 | 0.232 |
| spleen | 2 | 2 | 0.452 | 0.503 |
| stomach | 141 | 141 | 0.778 | 0.746 |
| instrument body | 97 | 103 | 0.847 | 0.893 |
| instrument wrist | 103 | 109 | 0.676 | 0.700 |
| left instrument gripper | 139 | 186 | 0.329 | 0.169 |
| right instrument gripper | 123 | 141 | 0.421 | 0.467 |
Model selection
The full model was trained for eight epochs from Base SAM 3.1. Epoch 7 had the highest validation mask AP among the full model checkpoints. We used that checkpoint to train the segmentation head for one epoch with the Dice loss configuration. A final epoch, which used a lower learning rate, produced a similar result. We selected the Dice refinement because it had the highest validation mask AP.
| Validation candidate | Box AP | Mask AP | Mask AP50 | Mask AP75 |
|---|---|---|---|---|
| Full model, epoch 7 | 0.5254 | 0.3725 | 0.4739 | 0.4035 |
| Dice refinement, selected | 0.5255 | 0.3749 | 0.4766 | 0.4044 |
| Lower learning rate refinement | 0.5256 | 0.3749 | 0.4764 | 0.4045 |
Evaluation protocol
Each image contains exhaustive_category_ids, which lists the categories that
are annotated in that image. For each image, the evaluation script runs
inference with the categories in exhaustive_category_ids and scores the
resulting predictions with the COCO evaluator. Categories outside that list do
not contribute positive or negative examples for the image.
The merged split assigns each procedure, video, or patient group to one split. The original grouped test subset is preserved inside the expanded test split, which permits the matched comparison above.
Quick start
Download the image model builder patch:
hf download mehmetkeremturkcan/Surgical-SAM-3.1-V2 \
patches/sam31_image_training.patch \
--revision main \
--local-dir surgical_sam31_v2
Install the SAM 3 source used for this run:
git clone https://github.com/facebookresearch/sam3.git
cd sam3
git checkout 46957e47805eaa273f4aa7bbbd25a88bca9108ce
git apply ../surgical_sam31_v2/patches/sam31_image_training.patch
pip install -e .
Download the checkpoint and configuration:
hf download mehmetkeremturkcan/Surgical-SAM-3.1-V2 \
config.json \
joint_grouped_sam31_v2_best_multiplex.pt \
--revision main \
--local-dir checkpoints
Run image detection and segmentation:
import torch
from PIL import Image
from sam3.model.sam3_image_processor import Sam3Processor
from sam3.model_builder import build_sam31_image_model
model = build_sam31_image_model(
checkpoint_path="checkpoints/joint_grouped_sam31_v2_best_multiplex.pt",
load_from_HF=False,
device="cuda",
eval_mode=True,
enable_segmentation=True,
)
processor = Sam3Processor(model, device="cuda", confidence_threshold=0.5)
image = Image.open("frame.png").convert("RGB")
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
state = processor.set_image(image)
output = processor.set_text_prompt(
state=state,
prompt="surgical instrument",
)
boxes = output["boxes"]
masks = output["masks"]
scores = output["scores"]
The complete example is available in
scripts/inference_sam31.py.
Checkpoints
| File | Contents | Size | SHA 256 |
|---|---|---|---|
joint_grouped_sam31_v2_best_multiplex.pt | Fine tuned detector and native SAM 3.1 tracker | 3,502,752,459 bytes | c64368d4ebf26f3ec12c01757f3eeaf2eb6169ac6b9977a365bb9bde68476672 |
joint_grouped_sam31_v2_best_builder.pt | Fine tuned image detector | 3,424,072,489 bytes | 3e541c9ccad450ae8192fd97962e689682913dc3ced041d27b86f6f759819896 |
Both checkpoints load with weights_only=True and contain zero unsafe
serialization globals. The multiplex checkpoint contains 1,166 detector tensors
and 457 tracker tensors. Its tracker tensors retain the values from
facebook/sam3.1.
Training
| Setting | Value |
|---|---|
| Base checkpoint | facebook/sam3.1, sam3.1_multiplex.pt |
| Dataset | SAM3 Joint Surgical Dataset, grouped V2 split |
| Unique training images | 34,316 |
| Effective training records per epoch | 58,936 |
| Input resolution | 1008 by 1008 |
| Full model training | 8 epochs |
| Segmentation refinement | 1 Dice refinement epoch and 1 lower learning rate epoch |
| Hardware | 8 NVIDIA A100 80 GB GPUs |
| Precision | BF16 automatic mixed precision |
| Optimizer | AdamW |
| Initial transformer learning rate | 8 × 10−5 |
| Initial vision backbone learning rate | 2.5 × 10−5 |
| Initial language backbone learning rate | 5 × 10−6 |
| Seed | 123 |
Dataset
The V2 dataset contains 42,884 unique images and 188,229 annotations. Its schema defines 33 prompt categories, of which 29 have positive training annotations. Train, validation, and test contain 34,316, 4,248, and 4,320 images. The V2 package will be released separately in the associated dataset repository.
Release video
The video uses synthetic benchtop footage and mask only predictions for anatomy and instrument parts.
Intended use
This repository supports research in surgical computer vision and robotics. The model has not been validated for clinical decision making or patient care.
Authors
Mehmet Kerem Turkcan, Soham Samal, and Zoran Kostic. This project was developed by the AIDL Lab at Columbia University and IPAL Lab.
Citation
@misc{turkcan2026surgicalsam31v2,
title = {Surgical SAM 3.1 V2},
author = {Turkcan, Mehmet Kerem and Samal, Soham and Kostic, Zoran},
year = {2026},
url = {https://huggingface.co/mehmetkeremturkcan/Surgical-SAM-3.1-V2}
}
Licenses
The checkpoints follow the SAM License in LICENSE. Dataset records
retain their source licenses. The dataset repository lists each source license
and attribution.