Transferable Adversarial Attacks on SAM and Its Downstream Models
Song Xia, Wenhan Yang, Yi Yu, Xun Lin, Henghui Ding, Ling-Yu Duan, Xudong Jiang
TL;DR
This work tackles the practical risk of adversarially attacking SAM-based downstream models without access to downstream data by introducing UMI-GRAT, which combines offline universal meta-initialization of perturbations with gradient-robust updates. The authors formalize the gradient-update deviation between the open-source SAM surrogate and fine-tuned downstream models and propose a gradient robust loss to mitigate it, enabling stronger transferability across unknown tasks. The two-stage approach—offline UMI learning and online GRAT adaptation—achieves state-of-the-art transfer performance on medical, shadow, and camouflage segmentation tasks and demonstrates plug-and-play compatibility with existing attacks. The results underscore significant security concerns for fine-tuned foundation-model deployments and motivate future defenses against such transferable adversarial threats.
Abstract
The utilization of large foundational models has a dilemma: while fine-tuning downstream tasks from them holds promise for making use of the well-generalized knowledge in practical applications, their open accessibility also poses threats of adverse usage. This paper, for the first time, explores the feasibility of adversarial attacking various downstream models fine-tuned from the segment anything model (SAM), by solely utilizing the information from the open-sourced SAM. In contrast to prevailing transfer-based adversarial attacks, we demonstrate the existence of adversarial dangers even without accessing the downstream task and dataset to train a similar surrogate model. To enhance the effectiveness of the adversarial attack towards models fine-tuned on unknown datasets, we propose a universal meta-initialization (UMI) algorithm to extract the intrinsic vulnerability inherent in the foundation model, which is then utilized as the prior knowledge to guide the generation of adversarial perturbations. Moreover, by formulating the gradient difference in the attacking process between the open-sourced SAM and its fine-tuned downstream models, we theoretically demonstrate that a deviation occurs in the adversarial update direction by directly maximizing the distance of encoded feature embeddings in the open-sourced SAM. Consequently, we propose a gradient robust loss that simulates the associated uncertainty with gradient-based noise augmentation to enhance the robustness of generated adversarial examples (AEs) towards this deviation, thus improving the transferability. Extensive experiments demonstrate the effectiveness of the proposed universal meta-initialized and gradient robust adversarial attack (UMI-GRAT) toward SAMs and their downstream models. Code is available at https://github.com/xiasong0501/GRAT.
