Home

Awesome

SimSAM: Zero-shot Medical Image Segmentation via Simulated Interaction

arXiv IEEE Paper License: MIT

simsam

Official code for the ISBI 2024 paper: SimSAM: Zero-shot Medical Image Segmentation via Simulated Interaction, which was awarded as a top 12 oral paper.

Requirements

The relevant packages can be installed with:

pip install -r requirements.txt

This repo also uses surface-distance, which should be downloaded and included in the root folder.

Downloading the datasets

This paper makes use of three datasets, which need to be separately downloaded.

Evaluation

You can evaluate either the baseline or the simsam model with the eval.py script, by selecting from one of the following datasets: ["busi", "cvc", "isic"]. For example:

python scripts/eval.py --model_load_path facebook/sam-vit-base \
    --dataset cvc \
    --model_type simsam \

Training

You can also fine-tune the SAM model on any of the datasets with:

python scripts/train.py --model_load_path facebook/sam-vit-base \
    --model_save_path path/to/save/model \
    --dataset cvc \
    --learning_rate 1e-5 \
    --num_train_epochs 10 \