Backdoor Attacks on Prompt-Driven Video Segmentation Foundation Models

Zongmin Zhang, Zhen Sun, Yifan Liao, Wenhan Dong, Xinlei He, Xingshuo Han, Shengmin Xu, Xinyi HuangarXiv 2025 · DOI

Abstract

Foundation models for video segmentation (VSFMs) like SAM2 are increasingly used in safety-critical applications. This paper identifies a significant security vulnerability: while traditional backdoor attacks fail against these prompt-driven models, a specialized two-stage attack called BadVSFM can achieve over 90% success rates. By decoupling the training of the image encoder and mask decoder, BadVSFM successfully injects malicious triggers that cause target objects to "disappear" without affecting performance on clean data.

Introduction: The Vulnerability of Video Foundation Models

Video Segmentation Foundation Models (VSFMs), such as SAM2, have become essential tools in computer vision, enabling precise object tracking and segmentation across video frames based on user-provided prompts (points, boxes, or masks). However, their robustness against adversarial threats has been largely unexplored.

Researchers discovered that classic backdoor attacks like BadNet, which are highly effective against image classifiers, fail against VSFMs, often yielding success rates below 5%. This failure occurs because the strong segmentation objective and the steering effect of user prompts typically override the influence of small, malicious triggers.

Methodology: The BadVSFM Framework

To overcome the inherent robustness of VSFMs, the authors developed BadVSFM, a novel framework utilizing a two-stage training strategy. This approach intentionally creates a representation gap between clean and poisoned data, preventing the "gradient conflict" that typically causes traditional attacks to fail.

Two-Stage Training Strategy

The core of BadVSFM lies in separating the learning of the trigger from the complex segmentation task:

  1. Stage 1: Encoder Steering: The image encoder is fine-tuned to map any frame containing a trigger to a specific "target embedding" in the feature space. An alignment loss is employed to ensure that embeddings for clean frames remain consistent with the original, un-poisoned model.
  2. Stage 2: Decoder Mapping: The mask decoder is then trained to recognize this specific target embedding. When encountered, the decoder is forced to output a malicious target mask (e.g., an empty mask), regardless of the user's prompt. For clean embeddings, the decoder maintains its standard high-performance segmentation behavior.

Experimental Evaluation

The attack was evaluated on five VSFM architectures—SAM2, MedSAM2, SAM2-Long, BioSAM2, and EdgeTAM—using the DAVIS-2017 and LVOS benchmarks.

Key Results

  • High Success Rates: BadVSFM achieved an Attack Success Rate (ASR) exceeding 90% for point and box prompts, a massive improvement over traditional methods.
  • Utility Preservation: The attack is highly stealthy; the mean Intersection over Union (mIoU) on clean videos remained within 0.025 of the original model's performance.
  • Defense Resistance: Standard backdoor defenses, including fine-tuning, pruning, and spectral signatures, failed to mitigate the BadVSFM backdoor.

Discussion and Insights

The success of BadVSFM stems from its ability to make the attack prompt-agnostic. By mapping all triggered frames to a single target embedding, the decoder learns to ignore the spatial information provided by the user's prompt when the trigger is present.

The primary threat demonstrated is the "Mask Disappearance" attack, where a specific trigger makes an object invisible to the system. This poses a severe risk for autonomous systems, such as self-driving cars, where a pedestrian could be made to "vanish" from the vehicle's perception.

Limitations

The attack's effectiveness decreases when users provide a full mask as a prompt (ASR drops to 40-60%), as the dense spatial information in a mask prompt is harder for the decoder to ignore than a simple point or box.

Conclusion

BadVSFM exposes a critical security gap in state-of-the-art video foundation models. As these models are integrated into more autonomous and safety-critical systems, there is an urgent need for the development of new, spatiotemporal-aware defense mechanisms to protect against such sophisticated backdoor threats.

Summary updated

BibTeX
@misc{zhang2025backdoor,
  author = {Zongmin Zhang and Zhen Sun and Yifan Liao and Wenhan Dong and Xinlei He and Xingshuo Han and Shengmin Xu and Xinyi Huang},
  title = {{Backdoor Attacks on Prompt-Driven Video Segmentation Foundation Models}},
  year = {2025},
  eprint = {2512.22046},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.22046},
}
Figure