Attack for Defense: Adversarial Agents for Point Prompt Optimization Empowering Segment Anything Model

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Liu, Xueyu, Zhang, Xiaoyi, Shi, Guangze, Liu, Meilin, Lai, Yexin, Wu, Yongfei, Wei, Mingqiang
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916964401676288
author Liu, Xueyu
Zhang, Xiaoyi
Shi, Guangze
Liu, Meilin
Lai, Yexin
Wu, Yongfei
Wei, Mingqiang
author_facet Liu, Xueyu
Zhang, Xiaoyi
Shi, Guangze
Liu, Meilin
Lai, Yexin
Wu, Yongfei
Wei, Mingqiang
contents Prompt quality plays a critical role in the performance of the Segment Anything Model (SAM), yet existing approaches often rely on heuristic or manually crafted prompts, limiting scalability and generalization. In this paper, we propose Point Prompt Defender, an adversarial reinforcement learning framework that adopts an attack-for-defense paradigm to automatically optimize point prompts. We construct a task-agnostic point prompt environment by representing image patches as nodes in a dual-space graph, where edges encode both physical and semantic distances. Within this environment, an attacker agent learns to activate a subset of prompts that maximally degrade SAM's segmentation performance, while a defender agent learns to suppress these disruptive prompts and restore accuracy. Both agents are trained using Deep Q-Networks with a reward signal based on segmentation quality variation. During inference, only the defender is deployed to refine arbitrary coarse prompt sets, enabling enhanced SAM segmentation performance across diverse tasks without retraining. Extensive experiments show that Point Prompt Defender effectively improves SAM's robustness and generalization, establishing a flexible, interpretable, and plug-and-play framework for prompt-based segmentation.
format Preprint
id arxiv_https___arxiv_org_abs_2509_18891
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Attack for Defense: Adversarial Agents for Point Prompt Optimization Empowering Segment Anything Model
Liu, Xueyu
Zhang, Xiaoyi
Shi, Guangze
Liu, Meilin
Lai, Yexin
Wu, Yongfei
Wei, Mingqiang
Computer Vision and Pattern Recognition
Prompt quality plays a critical role in the performance of the Segment Anything Model (SAM), yet existing approaches often rely on heuristic or manually crafted prompts, limiting scalability and generalization. In this paper, we propose Point Prompt Defender, an adversarial reinforcement learning framework that adopts an attack-for-defense paradigm to automatically optimize point prompts. We construct a task-agnostic point prompt environment by representing image patches as nodes in a dual-space graph, where edges encode both physical and semantic distances. Within this environment, an attacker agent learns to activate a subset of prompts that maximally degrade SAM's segmentation performance, while a defender agent learns to suppress these disruptive prompts and restore accuracy. Both agents are trained using Deep Q-Networks with a reward signal based on segmentation quality variation. During inference, only the defender is deployed to refine arbitrary coarse prompt sets, enabling enhanced SAM segmentation performance across diverse tasks without retraining. Extensive experiments show that Point Prompt Defender effectively improves SAM's robustness and generalization, establishing a flexible, interpretable, and plug-and-play framework for prompt-based segmentation.
title Attack for Defense: Adversarial Agents for Point Prompt Optimization Empowering Segment Anything Model
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2509.18891