Exploiting Fine-Tuning Structures to Improve Adversarial Transferability on Downstream SAM

Shixiong Jiang, Jialiang Fan, Mengyu Liu, Pengfei Gu, Danny Chen, Fanxin Kong · Submission to ICLR 2026 · Rejected

TL;DR

The Segment Anything Model (SAM) is frequently fine-tuned for specialized tasks, but this process creates a "mapping gap" that shields it from standard adversarial attacks. This paper introduces SETA (Structure-Exploiting Transferable Attack), a method that bridges this gap by constructing "ghost" versions of SAM that mimic the fine-tuning architecture (like LoRA), allowing attackers to generate adversarial examples that transfer highly effectively to unknown, fine-tuned downstream models.

What Problem Does This Paper Address?

Foundation models like SAM are rarely used "out of the box" for specialized domains like medical imaging or camouflaged object detection. Instead, researchers use Parameter-Efficient Fine-Tuning (PEFT)—techniques like LoRA or Adapters—to tweak the model for specific datasets.

While this makes SAM versatile, it creates a security headache. An adversarial attack designed to fool the original, open-source SAM often fails to fool a fine-tuned version because the internal "mapping" of features has changed. This is the transferability problem. In a realistic "black-box" scenario, an attacker doesn't have access to the victim's specific fine-tuned weights or their private training data. The authors ask: How can we exploit the known structure of fine-tuning to create attacks that reliably transfer to these hidden downstream models?

Methods

The authors propose the SETA framework, which operates in two main stages:

  1. Constructing Ghost SAMs: Since PEFT methods (like LoRA) are often standardized, an attacker can guess the structure of the fine-tuning even if they don't know the weights. SETA creates an ensemble of "ghost" models by adding LoRA or Adapter layers to the base SAM. Because the actual weights are unknown, SETA samples them from a Gaussian distribution (typically with a mean of 0 and a small standard deviation).
  2. Longitudinal Ensemble Attack: Instead of attacking a single surrogate model, SETA uses a "longitudinal ensemble." In each iteration of the gradient-based attack (e.g., MI-FGSM), it randomly selects a few ghost models from the ensemble to calculate the gradient. This diversification prevents the attack from over-fitting to one specific set of weights and helps find adversarial perturbations that are effective across the entire distribution of potential fine-tuned models.

Datasets

The researchers evaluated SETA across four distinct downstream tasks and datasets to prove its versatility:

  • Synapse: Multi-organ segmentation (using the SAMed variant).
  • CVC-ClinicDB: Polyp detection in colonoscopy images (using Med-SAM).
  • Blood Cell Dataset: Segmentation of blood cells (using BC-SAM).
  • COD10K: Camouflaged object detection (using TS-SAM).
  • AdapterShadow: A shadow detection benchmark used for additional validation.

Key Insights and Ideas

  • The "Mapping Gap" is the Culprit: The primary reason attacks don't transfer is the discrepancy between the base model's feature embeddings and the fine-tuned model's embeddings.
  • Structure > Data: Surprisingly, you don't need the victim's training data to break their model. Knowing the architecture of the fine-tuning (e.g., "they used LoRA with rank 4") and approximating the weight distribution is enough to generate a potent attack.
  • Gaussian Approximation Works: The authors found that even a "coarse approximation" of the parameter range in the ghost models is sufficient to achieve competitive transferability. You don't need to be precise; you just need to be in the right neighborhood.
  • Flattening the Loss Surface: By using an ensemble of ghost models, SETA effectively finds "flatter" local maxima in the loss landscape. These flat regions are more likely to remain maxima even when the model weights shift slightly, which is why the attacks transfer so well.

Key Results

SETA consistently outperformed state-of-the-art (SOTA) transferability attacks like PGN and MUI-GRAT across all tested models:

  • Massive Performance Drops: On the Synapse dataset (SAMed), the "No Attack" mean Dice Similarity Score (mDSC) was 79.8. Standard attacks (MI-FGSM) dropped it to ~61. SETA crushed it down to 2.7 (at $\epsilon=20$).
  • Superior to "Ghost Net": SETA outperformed the traditional "Ghost Net" method (which uses dropout/skip-connection perturbations), proving that exploiting the specific fine-tuning structure is much more effective than generic architectural perturbations.
  • Robustness to Partial Knowledge: In ablation studies, the authors showed that even if the attacker only correctly identifies some of the fine-tuning blocks (e.g., 4 out of 10), SETA still provides a significant boost in transferability over baseline methods.

Limitations and Future Work

  • Structural Assumptions: SETA assumes the attacker knows the type of PEFT used (e.g., LoRA vs. Adapters) and where those layers were inserted. If a model is fine-tuned using a completely novel or proprietary method, SETA's effectiveness might decrease.
  • Defense Gap: The paper focuses on the attack side. While it suggests that adversarial training or input transformations (like JPEG compression) might defend against SETA, it does not rigorously test these defenses.
  • Computational Cost: Because SETA involves multiple ghost models, it is computationally heavier than single-model attacks. The "longitudinal ensemble" helps, but it still requires more GPU time than simpler methods.

The authors suggest that future work should explore more complex fine-tuning scenarios and develop robust defense mechanisms specifically tailored to protect fine-tuned foundation models.

Summary updated

Abstract

Combining the Segment Anything Model (SAM) with fine-tuning techniques allows SAM to be effectively adapted to various downstream image segmentation tasks. However, this adaptability introduces new security vulnerabilities related to adversarial attacks. In this paper, we investigate the adversarial transferability between the original SAM and its fine-tuned downstream models. Under limited knowledge conditions of the downstream models, we propose a novel structure-exploiting transferable attack (SETA) method. Our framework mimics the fine-tuning architecture and estimates the parameter distributions of the downstream models to improve the transferability of the generated adversarial samples. Experimental results demonstrate the efficacy of our proposed method in creating adversarial examples against various downstream fine-tuned SAM models.
BibTeX
@inproceedings{jiang2026exploiting,
  author = {Shixiong Jiang and Jialiang Fan and Mengyu Liu and Pengfei Gu and Danny Chen and Fanxin Kong},
  title = {{Exploiting Fine-Tuning Structures to Improve Adversarial Transferability on Downstream SAM}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=82YaF5fhKq},
}
Figure