Cancer3.AIAI in OncologyAI Models › MedSAM
Foundation model Open weights Research use only radiology

MedSAM

Segment Anything adapted to medical images: a promptable segmentation model fine-tuned on over 1.5 million image–mask pairs across 10 imaging modalities and more than 30 cancer types.

3 637 downloads / month ♥ 24 updated 2023-05-03

At a glance

DeveloperBo Wang Lab, University of Toronto / University Health Network
Released2024-01-22
Licenceapache-2.0
AvailabilityOpen weights
KindFoundation model
Regulatory statusResearch use only
Parameters~94M

What it does

Given a bounding box on a CT, MRI, ultrasound, endoscopy, pathology or X-ray image, returns a segmentation mask of the structure or lesion inside; useful for fast annotation and as a starting point for organ- or tumour-specific fine-tuning.

Tasks, data types and cancers

CancerPan-cancer
Input1024×1024 2D image + bounding-box prompt
Outputbinary mask

Architecture

FamilySegment Anything (SAM)
BackboneViT-B image encoder + prompt encoder + mask decoder
Parameters~94M
Pre-trainingSAM (natural images) then full fine-tuning on medical image–mask pairs

Training data

1,570,263 image–mask pairs assembled from public datasets (including many TCIA collections and challenge sets) across 10 modalities; 3D volumes were sliced to 2D.

Training set size1.57M image–mask pairs
Institutionspublic datasets (see paper supplement)

Linked datasets

Evaluation

Benchmark / datasetMetricValueExternal validationSource
86 internal validation tasks + 60 external tasks Dice consistently above SAM and specialist U-Nets on external tasks (paper) yes Source

How to run

# generic transformers loader — see the model card for the task-specific head and preprocessing
from transformers import AutoModel, AutoProcessor
model = AutoModel.from_pretrained('wanglab/medsam-vit-base')
processor = AutoProcessor.from_pretrained('wanglab/medsam-vit-base')
LibraryPyTorch (repo) / transformers
Hardwaresingle GPU; CPU feasible for single images

Box prompts only in the released model (no point prompts). Works slice by slice — 3D consistency is up to you.

Regulatory status and intended use

Regulatory statusResearch use only
Intended useResearch and annotation assistance.

Source →

Regulatory status is quoted from the source linked above and can change. Research-use-only models must not be used for clinical decisions.

Limitations and bias

  • 2D only; volumetric structures need slice-wise prompting.
  • Depends on the user's box: a loose box yields a loose mask.
  • Training data is a union of public sets — check for overlap with your test data.

Sources

  1. Ma J et al. Segment anything in medical images. Nat Commun 2024
  2. GitHub — bowang-lab/MedSAM

This page is educational — it is not medical advice and does not replace consultation with an oncologist. Diagnostic and treatment decisions are made solely by specialist physicians.