[Paper Review] Personalize Segment Anything Model with One Shot
PerSAM provides training-free one-shot personalization of SAM using a positive–negative location prior and target semantics; PerSAM-F adds a scale-aware fine-tuning with two learnable weights for improved segmentation, achieving state-of-the-art results on personalized object segmentation and aiding DreamBooth.
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
Motivation & Objective
- Motivate personalized segmentation of user-specified visual concepts without manual prompting.
- Develop training-free mechanisms to inject high-level target semantics into SAM for personalized masks.
- Introduce a lightweight scale-aware fine-tuning variant (PerSAM-F) to resolve mask-scale ambiguities.
- Create PerSeg, a dataset for evaluating personalized object segmentation.
- Demonstrate applicability to one-shot video/semantic/part segmentation and aid DreamBooth for personalized image synthesis.
Proposed method
- Compute a location confidence map for the target in a test image using features from the reference image and the test image.
- Extract a positive–negative location prior from the confidence map to prompt SAM.
- Apply Target-guided Attention to bias all cross-attention layers toward foreground regions via the location map.
- Apply Target-semantic Prompting by adding a global target embedding to all decoder input tokens.
- Perform cascaded post-refinement to iteratively improve mask quality with lightweight decoder prompts.
- For PerSAM-F, freeze SAM and learn two mask-weights to combine three-scale SAM outputs into a final scale-aware mask (two learnable parameters, 10 seconds on A100).
- Optionally use PerSAM to improve DreamBooth by masking out background regions during diffusion model fine-tuning.
Experimental results
Research questions
- RQ1Can SAM be personalized for a specific object from just one reference image and a rough mask?
- RQ2How can high-level target semantics be efficiently injected into SAM without retraining?
- RQ3Does a light, scale-aware fine-tuning strategy improve segmentation when only one-shot data is available?
- RQ4Can PerSAM facilitate better personalized text-to-image synthesis (DreamBooth) by mitigating background disturbance?
Key findings
- PerSAM significantly improves personalized object segmentation over several baselines on PerSeg, with substantial gains over training-free prompts.
- PerSAM-F achieves the best overall performance on PerSeg with mIoU of 95.3 and bIoU of 77.9, using only 2 trainable parameters.
- PerSAM outperforms training-free competitors like VP, Painter, SEEM, and SegGPT on the PerSeg benchmark.
- Two-step post-refinement and target-guided attention contribute notably to performance gains (up to +11.4% mIoU from refinement alone).
- Scale-aware fine-tuning (PerSAM-F) provides a robust improvement by learning scale weights, outperforming other parameter-efficient methods (Prompt,Tuning, Adapter, LoRA).
- PerSAM-assisted DreamBooth yields higher-quality personalized text-to-image synthesis by focusing training on foreground regions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.