README.md
September 26, 2025 ยท View on GitHub
โ SPA: Efficient User-Preference Alignment against Uncertainty in Medical Image Segmentation
SPA, is an advanced segmentation framework that efficiently adapts to diverse test-time preferences with minimal human interaction. By presenting users a select few, distinct segmentation candidates that best capture uncertainties, it reduces clinician workload in reaching the preferred segmentation. This method is elaborated on the paper:
SPA: Efficient User-Preference Alignment against Uncertainty in Medical Image Segmentation (ICCV 2025)
and SPA webpage.
๐ฅ A Quick Overview

๐ง Requirement
Install the environment:
conda env create -f environment.yml
conda activate SPA
Further Note: We tested on the following system environment and you may have to handle some issue due to system difference.
Operating System: Ubuntu 22.04
Conda Version: 23.7.4
Python Version: 3.12.4
๐ฏ Example Cases
Step1: Download MedSAM or SAM pretrained weight and put in the ./checkpoint/sam/ folder, create the folder if it does not exist โ๏ธ
MedSAM checkpoint
Step2: Download REFUGE2 (update later) or your own multi-rater dataset and put in the data folder, create the folder if it does not exist โ๏ธ
Step3: Run the training by:
python train.py -net sam -mod sam -exp_name 'REFUGE_SPA' -sam_ckpt ./checkpoint/sam/medsam_vit_b.pth -image_size 512 -out_size 256 -b 4 -val_freq 1 -dataset REFUGE -data_path './data/REFUGE'
Step4: Run the validation by:
python val.py -net sam -mod sam -exp_name 'val' -vis 1 -sam_ckpt CHECKPOINT_PATH -weights CHECKPOINT_PATH -image_size 512 -out_size 256 -b 1 -val_freq 1 -dataset REFUGE -data_path './data/REFUGE'
๐จ News
- 25-06-26. SPA is accepted by ICCV ๐ฅณ
- 25-01-06. Code Uploaded ๐ฉโ๐ป
- 24-12-02. SPA's website is released ๐คฉ
๐ Cite
@misc{zhu_spa_2024,
title={SPA: Efficient User-Preference Alignment against Uncertainty in Medical Image Segmentation},
author={Zhu, Jiayuan and Wu, Junde and Ouyang, Cheng and Kamnitsas, Konstantinos and Noble, Alison},
url = {http://arxiv.org/abs/2411.15513},
doi = {10.48550/arXiv.2411.15513},
year = {2024},
}