Medical Adapter Zoo
Welcome to Medical Adapters Zoo (Med-Adpt Zoo)!
Fuente del modelo
- Tipo
- Other
- Tamaño del archivo
- 40,7 MB
- Versión
- vRevision dd7cda6
- Actualizado
- 10 oct 2026
- Descargas
- 0
- Fuente
- Hugging Face
Descripción de la fuente
Welcome to Medical Adapters Zoo (Med-Adpt Zoo)!
Med-Adpt Zoo Map 🐘🐊🦍🦒🦨🦜🦥
Lung Nodule (CT)
Melanoma (Skin Photo)
OpticCup (Fundus Image)
OpticDisc (Fundus Image)
Thyroid Nodule (UltraSound)
Aorta (Abdominal Image)
Esophagus (Abdominal Image)
Gallbladder (Abdominal Image)
Inferior Vena Cava (Abdominal Image)
Left Adrenal Gland (Abdominal Image)
Right Adrenal Gland (Abdominal Image)
Left Kidney (Abdominal Image)
Right kidney (Abdominal Image)
Liver (Abdominal Image)
Pancreas (Abdominal Image)
Spleen (Abdominal Image)
Stomach (Abdominal Image)
Portal Vein and Splenic Vein (Abdominal Image)
Edematous Tissue (Brain Tumor mpMRI)
Enhancing Tumor (Brain Tumor mpMRI)
Necrotic (Brain Tumor mpMRI)
Inferior Alveolar Nerve (CBCT)
Surgical Instrument (Surgical Video)
Kidney Tumor (MRI)
Liver (Liver Tumor CE-MRI)
Tumor (Liver Tumor CE-MRI)
Mandible (XRay)
Retina Vessel (Fundus Image)
White Blood Cell (MicroScope)
Download the Adapters you need here
What
Here are the pre-trained Adapters to transfer SAM (Segment Anything Model) for segmenting various organs/lesions from the medical images. Check our paper: Medical SAM Adapter for the details.
Why
SAM (Segment Anything Model) is one of the most popular open models for image segmentation. Unfortunately, it does not perform well on the medical images. An efficient way to solve it is using Adapters, i.e., some layers with a few parameters to be added to the pre-trained SAM model to fine-tune it to the target down-stream tasks. Medical image segmentation includes many different organs, lesions, and abnormalities as the targets. So we are training different adapters for each of the targets, and sharing them here for the easy usage in the community.
Download an adapter for your target disease—trained on organs, lesions, and abnormalities—and effortlessly enhance SAM.
One adapter transfers your SAM to a medical domain expert. Give it a try!
How to Use
- Download the code of our MedSAM-Adapter here.
- Download the weights of the original SAM model.
- Load the original model and our adapter for downstream tasks.
import torch
import torchvision.transforms as transforms
import cfg
from utils import *
# set your own configs
args = cfg.parse_args()
GPUdevice = torch.device('cuda', args.gpu_device)
# load the original SAM model
net = get_network(args, args.net, use_gpu=args.gpu, gpu_device=GPUdevice, distribution = args.distributed)
net.eval()
sam_weights = 'checkpoint/sam/sam_vit_b_01ec64.pth' # load the original SAM weight
with open(sam_weights, "rb") as f:
state_dict = torch.load(f)
new_state_dict = {k: v for k, v in state_dict.items() if k in net.state_dict() and net.state_dict()[k].shape == v.shape}
net.load_state_dict(new_state_dict, strict = False)
# load task-specific adapter
adapter_path = 'OpticCup_Fundus_SAM_1024.pth'
checkpoint_file = os.path.join(adapter_path)
assert os.path.exists(checkpoint_file)
loc = 'cuda:{}'.format(args.gpu_device)
checkpoint = torch.load(checkpoint_file, map_location=loc)
state_dict = checkpoint['state_dict']
if args.distributed != 'none':
from collections import OrderedDict
new_state_dict = OrderedDict()
for k, v in state_dict.items():
# name = k[7:] # remove `module.`
name = 'module.' + k
new_state_dict[name] = v
# load params
else:
new_state_dict = state_dict
net.load_state_dict(new_state_dict,strict = False)
Authorship
Ziyue Wang (NUS): Adapters Training
Junde Wu (Oxford): Lead the project
Yueming Jin (NUS): Supervisor
Fuentes
1 fuente
Fuentes
1 fuenteVerificado 25 ago
Artefactos del modelo
29 artefactos
Artefactos del modelo
29 artefactosAbdominal_Inferior Vena Cava_sam_128.pth
pth · 40,7 MB · SHA-256 0ad5951ca34e…e38c · Hugging Face
DescargarAbdominal_Left Adrenal Gland_sam_128.pth
pth · 40,7 MB · SHA-256 87a705acff2d…b25f · Hugging Face
DescargarAbdominal_Right Adrenal Gland_sam_128.pth
pth · 40,7 MB · SHA-256 222054efc135…4614 · Hugging Face
DescargarBrain Tumor_Edematous Tissue_mpMRI_sam_128.pth
pth · 40,7 MB · SHA-256 5414ee71fbf2…bb18 · Hugging Face
DescargarBrain Tumor_Enhancing Tumor_mpMRI_sam_128.pth
pth · 40,7 MB · SHA-256 8fba558148fd…f8d2 · Hugging Face
DescargarBrain Tumor_Necrotic_mpMRI_sam_128.pth
pth · 40,7 MB · SHA-256 fabc15eac677…22f9 · Hugging Face
DescargarInferior Alveolar Nerve_CBCT_sam_256.pth
pth · 40,7 MB · SHA-256 2d5aaca49d95…eb1f · Hugging Face
DescargarLiver Tumor_Liver_CE-MRI_sam_128.pth
pth · 40,7 MB · SHA-256 5123b1b0ad0a…6628 · Hugging Face
DescargarLiver Tumor_Tumor_CE-MRI_sam_128.pth
pth · 40,7 MB · SHA-256 df03cd494da1…af1a · Hugging Face
DescargarSurgical_Instrument_Video_SAM_1024.pth
pth · 40,7 MB · SHA-256 8bf6c64158f3…e237 · Hugging Face
DescargarThyroidNodule_UltraSound_SAM_1024.pth
pth · 40,7 MB · SHA-256 4321927a2451…1c54 · Hugging Face
DescargarWhite Blood Cell_MicroScope_sam_1024.pth
pth · 40,7 MB · SHA-256 58aba2e779e8…32f4 · Hugging Face
DescargarExtractos de fuentes
2 extractos
Extractos de fuentes
2 extractos--- license: apache-2.0 pipeline_tag: image-segmentation tags: - medical - segmentation - ct - mri - image - sam language: - en library_name: adapter-transformers --- Welcome to Medical Adapters Zoo (Med-Adpt Zoo)! ## Med-Adpt Zoo Map 🐘🐊🦍🦒🦨🦜🦥 Lung Nodule (CT) Melanoma (Skin Photo) OpticCup (Fundus Image) OpticDisc (Fundus Image) Thyroid Nodule (UltraSound) Aorta (Abdominal Image) Esophagus (Abdominal Image) Gallbladder (Abdominal Image) Inferior Vena Cava (Abdominal Image) Left Adrenal Gland (Abdominal Image) Right Adrenal Gland (Abdominal Image) Left Kidney (Abdominal Image) Right kidney (Abdominal Image) Liver (Abdominal Image) Pancreas (Abdominal Image) Spleen (Abdominal Image) Stomach (Abdominal Image) Portal Vein and Splenic Vein (Abdominal Image) Edematous Tissue (Brain Tumor mpMRI) Enhancing Tumor (Brain Tumor mpMRI) Necrotic (Brain Tumor mpMRI) Inferior Alveolar Nerve (CBCT) Surgical Instrument (Surgical Video) Kidney Tumor (MRI) Liver (Liver Tumor CE-MRI) Tumor (Liver Tumor CE-MRI) Mandible (XRay) Retina Vessel (Fundus Image) White Blood Cell (MicroScope) Download the Adapters you need [here](https://huggingface.co/KidsWithTokens/Medical-Adapter-Zoo/tree/main) ## What Here are the pre-trained Adapters to transfer [SAM](https://segment-anything.com) (Segment Anything Model) for segmenting various organs/lesions from the medical images. Check our paper: [Medical SAM Adapter](https://arxiv.org/abs/2304.12620) for the details. ## Why SAM (Segment Anything Model) is one of the most popular open models for image segmentation. Unfortunately, it does not perform well on the medical images. An efficient way to solve it is using Adapters, i.e., some layers with a few parameters to be added to the pre-trained SAM model to fine-tune it to the target down-stream tasks. Medical image segmentation includes many different organs, lesions, and abnormalities as the targets. So we are training different adapters for each of the targets, and sharing them here for the easy usage in the community. Download an adapter for your target disease—trained on organs, lesions, and abnormalities—and effortlessly enhance SAM. One adapter transfers your SAM to a medical domain expert. Give it a try! ## How to Use 1. Download the code of our MedSAM-Adapter [here](https://github.com/KidsWithTokens/Medical-SAM-Adapter). 2. Download the w...
Source context: 0 downloads · 0 likes · Pipeline image-segmentation · Library adapter-transformers · Repo mmrech/Medical-Adapter-Zoo
