TL;DR
Foundation segmentation models like SAM and SEEM rely on heavy visual encoders to extract image embeddings before interacting with user prompts. By simply maximizing the $\ell_2$-distance between clean and perturbed image embeddings in the latent space, this paper introduces prompt-agnostic adversarial attacks that break downstream segmentation across points, bounding boxes, text labels, and automatic mask generators—using imperceptible perturbations as small as $\epsilon = 1/255$.
What Problem Does This Paper Address?
Interactive foundation models for segmentation—such as Meta's Segment Anything Model (SAM) and Segment Everything Everywhere All at Once (SEEM)—can segment arbitrary objects using point clicks, bounding boxes, or text descriptions. Prior adversarial robustness studies treated this as an end-to-end task: they generated an adversarial perturbation customized for a specific image-prompt pair.
However, prompt-specific attacks have major flaws:
- Computational overhead: The attacker must recompute an attack for every new prompt.
- Easy mitigation: A user can circumvent the attack simply by shifting a click or providing an alternate prompt (e.g., swapping a point prompt for a bounding box).
This paper investigates whether an attacker can craft a single, prompt-agnostic perturbation that sabotages model performance across any prompt or segmentation task.
Methods
Instead of attacking the final mask output, the authors exploit the decoupled architecture of promptable segmentation models:
[Input Image x] ──> [ Vision Encoder ϕ(x) ] ──> Latent Embedding ──┐
├──> [ Mask Decoder ] ──> Mask
[ Prompt P ] ──> [ Prompt Encoder ] ──> Prompt Feature ──┘
Because the visual backbone $\phi(x)$ computes features independently of the prompt $P$, maximizing the distortion of $\phi(x)$ degrades whatever downstream decoding follows:
-
Prompt-Agnostic Objective: Maximize feature space divergence: $$\max_{\|\delta\|_p \le \epsilon} \|\phi(x + \delta) - \phi(x)\|_2^2 \quad \text{s.t.} \quad x + \delta \in [0, 1]$$ Optimized under an $\ell_\infty$ threat model using 100 steps of Auto-PGD (APGD).
-
Universal Adversarial Perturbations (UAPs): The authors optimize a single 1024×1024 perturbation vector over a training set of 100 images using mini-batch PGD. The perturbation is interpolated via nearest-neighbor to fit images of varying test resolutions.
- Multi-Crop PGD: To bypass SAM’s robust "multi-crop" mode—which segments cropped patches to recover smaller objects—the authors propose randomly cropping the image during optimization iterations ($p_{\text{crop}} = 0.8$) so the perturbation remains lethal at multiple scales.
Datasets
The evaluation relies on two standard vision benchmarks:
- SA-1B (Segment Anything 1B): 100 randomly sampled high-resolution images (evaluated across 9,320 annotated masks) used for testing automatic "Segment Everything" generation, box prompts, point prompts, and multi-crop modes.
- ADE20K: 100 validation images (589 object-prompt pairs) evaluated on single-point prompts and open-vocabulary text prompts.
- COCO Panoptic: Used implicitly via SEEM's 133 semantic segmentation classes.
No new datasets were introduced.
Key Insights and Ideas
- Decoupled backbones create a single point of failure: Precomputing prompt-free visual features is crucial for interactive UI latency, but it enables prompt-agnostic attacks. Once latent representations are sufficiently scrambled, downstream decoders fail entirely.
- More prompts do not help: Adding additional positive and negative point prompts or using tight bounding boxes fails to recover the ground-truth mask under attack.
- Defensive potential (privacy): Universal perturbations can act as an anti-scraping shield: users could apply a single, fixed, imperceptible noise pattern to images before uploading them online, preventing automated foundation models from parsing the scene.
Key Results
- Severe SAM degradation: On SA-1B across 9,320 masks:
- Clean average mIoU drops from 84.0% to 60.1% at $\epsilon = 1/255$, down to 38.2% at $\epsilon = 2/255$, and collapses to 21.3% at $\epsilon = 8/255$.
- Single point prompts are especially fragile, collapsing from 74.4% clean mIoU to 16.4% at $\epsilon = 2/255$ and 3.2% at $\epsilon = 8/255$.
- Large masks ($\ge 10,000$ pixels) suffer the sharpest drops under box prompts, falling from 95.6% to 41.9% mIoU at $\epsilon = 2/255$.
- Universal Attacks Generalize: On ADE20K single-point tasks, an image-agnostic perturbation optimized on just 100 training images degraded unseen test images from 58.98% to 11.24% mIoU at $\epsilon = 8/255$.
- Effective against SEEM: Attacks transfer directly to text-driven and semantic segmentation tasks on SEEM (Focal-T and Focal-L backbones), causing complete class misclassification and empty mask predictions at $\epsilon = 1/255$.
Limitations and Future Work
- White-box dependency: The main attack relies on having gradient access to the specific image encoder.
- Poor cross-architecture transferability: When transferring a universal perturbation crafted on SAM (ViT-H) to SEEM (Focal backbones), the attack only produced mild degradation, reflecting the architectural difference between encoders.
- Unexplored targeted attacks: The objective function strictly pushes embeddings away from their source ($\ell_2$ distance maximization) rather than steering them toward specific attacker-chosen target masks or classes.
Summary updated