Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Personalize Segment Anything Model with One Shot

About

Driven by large-data pre-training, Segment Anything Model (SAM) has been demonstrated as a powerful and promptable framework, revolutionizing the segmentation models. Despite the generality, customizing SAM for specific visual concepts without man-powered prompting is under explored, e.g., automatically segmenting your pet dog in different images. In this paper, we propose a training-free Personalization approach for SAM, termed as PerSAM. Given only a single image with a reference mask, PerSAM first localizes the target concept by a location prior, and segments it within other images or videos via three techniques: target-guided attention, target-semantic prompting, and cascaded post-refinement. In this way, we effectively adapt SAM for private use without any training. To further alleviate the mask ambiguity, we present an efficient one-shot fine-tuning variant, PerSAM-F. Freezing the entire SAM, we introduce two learnable weights for multi-scale masks, only training 2 parameters within 10 seconds for improved performance. To demonstrate our efficacy, we construct a new segmentation dataset, PerSeg, for personalized evaluation, and test our methods on video object segmentation with competitive performance. Besides, our approach can also enhance DreamBooth to personalize Stable Diffusion for text-to-image generation, which discards the background disturbance for better target appearance learning. Code is released at https://github.com/ZrrSkywalker/Personalize-SAM

Renrui Zhang, Zhengkai Jiang, Ziyu Guo, Shilin Yan, Junting Pan, Xianzheng Ma, Hao Dong, Peng Gao, Hongsheng Li• 2023

Related benchmarks

TaskDatasetResultRank
Video Object SegmentationDAVIS 2017 (val)
J mean69
1251
Salient Object DetectionDUTS (test)
M (MAE)0.257
368
Polyp SegmentationCVC-ClinicDB (test)
DSC87.88
211
Semantic segmentationCOCO-20i
mIoU (Mean)23.5
187
Few-shot Semantic SegmentationCOCO-20i
mIoU23.5
178
Semantic segmentationPASCAL-5i
Mean mIoU48.5
149
Polyp SegmentationKvasir
Dice Score35.38
143
Polyp SegmentationCVC-ClinicDB
Dice Coefficient20.1
101
Polyp SegmentationCVC-ColonDB
mIoU10.31
100
Few-shot Semantic SegmentationPASCAL-5i
mIoU48.5
96
Showing 10 of 99 rows
...

Other info

Follow for update