Abstract
The Segment Anything Model (SAM) has revolutionized image segmentation, yet it exhibits significant fragility when subjected to adversarial noise. This paper identifies a critical "cross-prompt" vulnerability where adversarial attacks designed for one prompt type (e.g., points) often fail to transfer to others (e.g., boxes). We introduce a novel Cross-Prompt Attack (CPA) that targets shared feature channels to achieve high transferability. To defend against such attacks, we propose Robust SAM, which utilizes Singular Value Decomposition (SVD) to adapt a mere 512 parameters. This method restores adversarial robustness without the "catastrophic forgetting" typically associated with full-model retraining, maintaining high performance on clean data while significantly improving mIoU under attack.
Introduction
Vision foundation models like SAM are trained on vast datasets to perform zero-shot segmentation. However, their reliance on specific internal feature distributions makes them susceptible to invisible adversarial perturbations. A primary challenge is the "robustness-accuracy trade-off": standard defenses often degrade performance on clean images or are computationally prohibitive for models with millions of parameters. Furthermore, existing attacks are often "brittle," failing when the user changes the prompt type.
Methodology
Cross-Prompt Adversarial Attack (CPA)
The authors developed a Key Feature Selection algorithm to identify internal encoder channels critical to both point and box prompts. By targeting the intersection of these features, the CPA generates adversarial noise that disrupts the common processing pathways SAM uses, regardless of the prompt type. This results in a "universal" attack that is significantly more effective than prompt-specific alternatives.
Few-Parameter SVD Defense (Robust SAM)
Robust SAM addresses vulnerability by fine-tuning the final convolutional layers of the encoder. Using Singular Value Decomposition (SVD), the weight matrices are decomposed into $U, P, \text{ and } V^T$. By freezing the basis matrices ($U, V$) and training only the diagonal singular value matrix ($P$), the defense adapts only 512 parameters. This "re-scaling" of feature importance allows the model to ignore adversarial noise while preserving its foundational segmentation logic.
Experimental Results
The proposed methods were evaluated on benchmarks including SA1B, VOC, COCO, and DAVIS.
- Attack Effectiveness: The CPA achieved a 75.6% success rate on the SA1B dataset, demonstrating superior transferability across prompt types compared to baseline attacks.
- Defense Performance: Robust SAM improved mIoU by at least 15% under various attack scenarios. Crucially, it maintained a clean mIoU of 80.9 on VOC data, significantly outperforming other adaptation methods like SAM-LoRA (63.4 mIoU), which suffered from greater performance degradation on non-adversarial images.
- Efficiency: With only 512 trainable parameters, Robust SAM is highly efficient, operating at 11.5 FPS—faster than many existing adaptation frameworks.
Conclusion and Future Work
Robust SAM demonstrates that adversarial robustness in foundation models can be achieved through targeted, low-parameter adaptation rather than exhaustive retraining. By focusing on the singular values of key feature layers, the model effectively filters adversarial noise. Future research will explore extending this SVD-based defense to text-based prompts and other vision foundation model architectures.
Summary updated