Personnaliser le modèle Segment Anything en un seul essai
Personalize Segment Anything Model with One Shot
May 4, 2023
Auteurs: Renrui Zhang, Zhengkai Jiang, Ziyu Guo, Shilin Yan, Junting Pan, Hao Dong, Peng Gao, Hongsheng Li
cs.AI
Résumé
Motivé par un pré-entraînement sur de grandes quantités de données, le modèle Segment Anything Model (SAM) s'est imposé comme un cadre puissant et adaptable, révolutionnant les modèles de segmentation. Malgré sa généralité, la personnalisation de SAM pour des concepts visuels spécifiques sans intervention humaine reste peu explorée, par exemple, segmenter automatiquement votre chien dans différentes images. Dans cet article, nous proposons une approche de personnalisation sans entraînement pour SAM, appelée PerSAM. Avec seulement une image et un masque de référence, PerSAM localise d'abord le concept cible grâce à une priorité de localisation, puis le segmente dans d'autres images ou vidéos via trois techniques : attention guidée par la cible, incitation sémantique ciblée et post-affinement en cascade. Ainsi, nous adaptons efficacement SAM à un usage privé sans aucun entraînement. Pour atténuer davantage l'ambiguïté des masques, nous présentons une variante efficace de réglage fin en une seule étape, PerSAM-F. En gelant l'intégralité de SAM, nous introduisons deux poids ajustables pour les masques multi-échelles, n'entraînant que 2 paramètres en 10 secondes pour une performance améliorée. Pour démontrer notre efficacité, nous construisons un nouveau jeu de données de segmentation, PerSeg, pour l'évaluation personnalisée, et testons nos méthodes sur la segmentation d'objets vidéo avec des performances compétitives. Par ailleurs, notre approche peut également améliorer DreamBooth pour personnaliser Stable Diffusion dans la génération d'images à partir de texte, éliminant les perturbations de fond pour un meilleur apprentissage de l'apparence cible. Le code est disponible à l'adresse https://github.com/ZrrSkywalker/Personalize-SAM.
English
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