Skip to main content
QUICK REVIEW

[Paper Review] Attack-SAM: Towards Attacking Segment Anything Model With Adversarial Examples

Chenshuang Zhang, Chaoning Zhang|arXiv (Cornell University)|May 1, 2023
Adversarial Robustness in Machine LearningComputer Science3 citations
TL;DR

This paper presents Attack-SAM, the first comprehensive study on adversarial attacks against the Segment Anything Model (SAM). It introduces a white-box attack framework using a novel ClipMSE loss to remove predicted masks and demonstrates that SAM is vulnerable to both targeted and transfer-based attacks, including generating arbitrary desired masks across prompts and images.

ABSTRACT

Segment Anything Model (SAM) has attracted significant attention recently, due to its impressive performance on various downstream tasks in a zero-short manner. Computer vision (CV) area might follow the natural language processing (NLP) area to embark on a path from task-specific vision models toward foundation models. However, deep vision models are widely recognized as vulnerable to adversarial examples, which fool the model to make wrong predictions with imperceptible perturbation. Such vulnerability to adversarial attacks causes serious concerns when applying deep models to security-sensitive applications. Therefore, it is critical to know whether the vision foundation model SAM can also be fooled by adversarial attacks. To the best of our knowledge, our work is the first of its kind to conduct a comprehensive investigation on how to attack SAM with adversarial examples. With the basic attack goal set to mask removal, we investigate the adversarial robustness of SAM in the full white-box setting and transfer-based black-box settings. Beyond the basic goal of mask removal, we further investigate and find that it is possible to generate any desired mask by the adversarial attack.

Motivation & Objective

  • To investigate the adversarial robustness of Segment Anything Model (SAM), a vision foundation model, in the context of prompt-based mask prediction.
  • To determine whether SAM can be fooled by adversarial examples, given its growing use in zero-shot, prompt-based segmentation tasks.
  • To explore transfer-based attack settings where attackers do not have access to the prompt or model weights.
  • To examine whether adversarial examples can be used to generate any desired mask, not just remove existing ones.
  • To assess the feasibility and success of adapting standard adversarial attack methods (e.g., FGSM, PGD) to mask prediction tasks instead of label prediction.

Proposed method

  • Proposes a white-box attack framework where the goal is mask removal, formulated as an optimization problem with a novel ClipMSE loss function.
  • Uses the ClipMSE loss to minimize the L2 distance between the adversarial mask and a target mask (e.g., empty mask for removal) while preserving image semantics.
  • Employs standard adversarial attack algorithms like FGSM and PGD to generate perturbations on input images to fool SAM’s mask prediction.
  • Conducts cross-prompt transfer attacks by generating adversarial examples without knowledge of the input point prompt, using multiple prompts during attack generation.
  • Performs cross-task transfer attacks by leveraging adversarial examples trained on semantic segmentation models to attack SAM’s prompt-based mask prediction.
  • Designs three settings to generate desired masks: (1) manually designed mask at random location, (2) mask from same image with different prompt, (3) mask from a different image with random prompt.

Experimental results

Research questions

  • RQ1Can adversarial examples successfully remove the predicted mask in SAM under a full white-box setting?
  • RQ2Is it possible to launch effective adversarial attacks on SAM without knowing the input prompt (i.e., cross-prompt transfer)?
  • RQ3Can adversarial examples trained on semantic segmentation models transfer to attack SAM’s prompt-based mask prediction (cross-task transfer) ?
  • RQ4Can adversarial attacks be used to generate any arbitrary desired mask in SAM, rather than just removing the original mask?
  • RQ5How does the performance of adversarial attacks on mask prediction compare to traditional attacks on label prediction in terms of success rate and visual fidelity?

Key findings

  • SAM is vulnerable to adversarial attacks in the full white-box setting, with successful mask removal achieved using the proposed ClipMSE loss and standard PGD/FGSM methods.
  • Cross-prompt transfer attacks succeed even without knowledge of the input point prompt, indicating high transferability of adversarial examples across different prompts.
  • Cross-task transfer attacks show partial success, demonstrating that adversarial examples from semantic segmentation models can influence SAM’s mask prediction to some extent.
  • Adversarial attacks can generate any desired mask in three settings: (1) manually designed masks, (2) masks from the same image with different prompts, and (3) masks from different images with random prompts.
  • In some cases, the generated masks contain small noise or artifacts in unintended regions, indicating room for improvement in attack precision.
  • The study reveals that SAM’s mask prediction is susceptible to targeted attacks, highlighting a critical security vulnerability in foundation models for vision.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.