Foundation models like Meta’s Segment Anything Model (SAM) and SEEM have revolutionized computer vision. By separating image encoding from prompt processing, these models can segment almost any object using points, boxes, or even text descriptions. However, this architectural efficiency introduces a unique vulnerability.
In their paper, "Segment (Almost) Nothing," researchers Francesco Croce and Matthias Hein demonstrate that by targeting the shared image encoder, an attacker can break these models across all tasks simultaneously with a single, imperceptible perturbation.
TL;DR
Instead of attacking specific segmentation tasks, this paper proposes prompt-agnostic adversarial attacks that distort the latent embeddings produced by a model's image encoder. These tiny, often invisible changes to an image can effectively "blind" foundation models, causing them to fail regardless of whether a user provides a point, a box, or a text prompt.
What Problem Does This Paper Address?
Traditional adversarial attacks on segmentation are "task-specific." If you want to hide a car from a model, you generate a perturbation specifically for that car and the specific prompt used to find it. However, foundation models are versatile; if one prompt fails, a user might just try another (e.g., switching from a point prompt to a bounding box).
Attacking every possible prompt combination is computationally exhausting. The authors asked: Is it possible to create a single perturbation that ruins the image representation entirely, making it useless for any downstream segmentation task?
Methods
The core innovation lies in where the attack happens. As shown in Figure 1, standard attacks look at the final output (the mask). The authors instead focus on the image encoder.
The Latent Space Attack
The authors propose maximizing the $\ell_2$-distance between the embedding of a clean image and its perturbed version. Because the image encoder doesn't "know" what the prompts will be, distorting this internal representation creates a ripple effect that degrades all subsequent mask decodings.
They utilize two main strategies:
- Image-Specific Attacks: Using Projected Gradient Descent (PGD) and its adaptive variant (APGD), they find the optimal noise for a single image to maximize embedding distortion within a small $\ell_\infty$ constraint (e.g., $\epsilon = 1/255$, which is virtually invisible to the human eye).
- Universal Adversarial Perturbations (UAP): They optimize a single noise pattern over a small set of training images. Once computed, this "master noise" can be added to any new, unseen image to degrade the model's performance instantly without further computation.
Datasets
The study evaluates these attacks using:
- SA-1B (Segment Anything 1 Billion): Used for qualitative testing and as a source for training universal perturbations.
- ADE20K: Used for quantitative evaluation of Mean Intersection over Union (mIoU) to measure how much the segmentation quality drops.
- COCO: Used specifically for evaluating SEEM’s semantic segmentation capabilities.
Key Insights and Ideas
- The Encoder Bottleneck: The very feature that makes foundation models efficient—reusing one expensive image embedding for many cheap prompt decodings—is their "Achilles' heel."
- Prompt-Agnosticism is Real: An attack optimized without any knowledge of prompts generalizes perfectly. Whether you use one point, ten points, or a bounding box, the corrupted embedding leads to mask failure.
- Universal Blindness: The fact that a single noise pattern can generalize to unseen images suggests that these encoders share common "blind spots" in their latent space.
- Privacy Potential: The authors suggest these attacks could be used defensively to prevent unauthorized automated segmentation of private images shared online.
Key Results
The results are stark. Even with a tiny perturbation budget of $\epsilon = 1/255$:
- SAM's "Segment Everything" mode (which automatically generates a grid of prompts) fails almost completely. As seen in Figure 2, the predicted masks disappear or turn into meaningless fragments.
- Quantitative Drop: On the ADE20K dataset, SAM’s mIoU dropped from 59.86% (clean) to just 16.71% with an image-specific attack at $\epsilon = 1/255$.
- Universal Effectiveness: A universal perturbation ($\epsilon = 8/255$) trained on just 100 images dropped SAM's mIoU to 11.24% on entirely new images.
The attacks also proved robust against different prompt types. In Figure 5, box prompts that normally yield perfect masks result in empty or poor-quality outputs when the image is perturbed.
Limitations and Future Work
- White-Box Requirement: The current attacks require full access to the model's weights (white-box). While the authors touched on "transfer attacks" (using SAM to attack SEEM), the success was limited, suggesting that different encoder architectures have different latent vulnerabilities.
- Limited Scope: The study focused on SAM and SEEM. Future work is needed to see if these vulnerabilities persist in other foundation models or multi-modal models (like CLIP-based segmentors).
- Defense: The paper opens a new front for researchers: how do we make foundation encoders robust to latent space distortions without sacrificing their generalization power?
By shifting the target from the "what" (the mask) to the "how" (the embedding), this research highlights a critical security gap in the next generation of computer vision systems.
Summary updated