Unsegment Anything by Simulating Deformation

Jiahao Lu, Xingyi Yang, Xinchao Wang

Abstract: Foundation segmentation models, while powerful, enable effortless object extraction that can lead to copyright infringement or malicious misuse. To mitigate this, we introduce the "Anything Unsegmentable" task, aiming for highly transferable adversarial attacks against all prompt-based models. We propose Unsegment Anything by Simulating Deformation (UAD), which optimizes a differentiable deformation function to create a target deformed image. This approach alters structural information while maintaining feature distance within reachable bounds. Our experiments demonstrate that UAD effectively compromises various promptable segmentation architectures, regardless of prompt type.

Introduction

Foundation models like Meta’s Segment Anything Model (SAM) have revolutionized computer vision by allowing users to segment any object with a simple point, box, or text prompt. However, this ease of use facilitates unauthorized asset extraction and malicious image editing. Existing adversarial attacks often suffer from prompt overfitting—failing when a user switches from a point to a box prompt—and poor transferability across different model architectures.

To address these challenges, we propose the task of "Anything Unsegmentable," granting digital content the "right to be unsegmented." Our solution, UAD, focuses on disrupting image encoder features to achieve prompt-agnostic protection that transfers across diverse models.

The UAD Framework

The core innovation of UAD is a two-stage process that moves beyond simple noise addition to structural simulation. Instead of pushing image features into arbitrary regions of the feature space, UAD pulls them toward a specific "deformed" version of the original image.

The UAD framework overview, illustrating the two-stage process of optimizing a differentiable deformation and simulating it in feature space.

Stage One: Optimal Target Deformation

We optimize a flow field to create a target image $\hat{I}$ that is structurally distorted yet remains on the "image manifold." This optimization is guided by three primary losses:

  • Deformation Loss ($L_D$): Ensures the target is structurally distinct from the original.
  • Control Loss ($L_C$): Maintains local smoothness in the deformation to avoid chaotic pixel artifacts.
  • Fidelity Loss ($L_F$): Ensures the deformed target is "reachable" by a small, imperceptible adversarial perturbation.

Stage Two: Feature Simulation

Once the ideal deformed target is established, we apply a standard adversarial update to the original image. This forces the model’s image encoder to perceive the features of the distorted version, effectively "tricking" the model into seeing a broken structure.

Key Insights: The Power of Targeted Deformation

A critical finding in our research is that targeted feature attacks—those moving toward a natural-looking deformed image—transfer significantly better than untargeted attacks that simply maximize feature distance. Untargeted noise often falls into "meaningless" regions of high-dimensional space that robust models can ignore. By aligning the attack direction with the image manifold through deformation, we achieve much higher success rates against black-box models.

Comparison of untargeted (TAP) vs targeted (AA) feature disruption, showing that targeted attacks maintain higher disruption levels across different models.

Furthermore, by targeting the image encoder rather than the prompt encoder or mask decoder, the attack remains effective regardless of whether the user provides a point, a box, or a text description. This prompt-agnosticism is vital for a robust defense.

Experimental Results

We evaluated UAD against state-of-the-art baselines like Attack-SAM and PATA across multiple datasets, including SAM-1B and the Kaggle Artist Dataset.

  • Mask Destruction: On the white-box SAM-B model, UAD reduced the mean Intersection over Union (mIoU) to 51.53%, significantly lower than competing methods.
  • Transferability: When attacking the massive SAM-H model (black-box), UAD achieved an Attack Success Rate (ASR@50) of 23.42%, nearly doubling the effectiveness of several baselines.
  • Qualitative Impact: Visual results confirm that protected images yield empty masks, random background noise, or disjointed shapes, rendering the segmentation output useless for further editing or extraction.

Conclusion

UAD represents a significant step toward proactive digital rights management in the era of foundation models. By simulating structural deformation, we create perturbations that are both prompt-agnostic and highly transferable. While challenges remain in transferring to architectures with fundamentally different training objectives (like SEEM), our approach provides a robust framework for granting images the right to remain unsegmented.

Summary updated

BibTeX
@inproceedings{lu2024unsegment,
  author = {Jiahao Lu and Xingyi Yang and Xinchao Wang},
  title = {{Unsegment Anything by Simulating Deformation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  url = {https://openreview.net/forum?id=YIl3eg0zjW},
}
Figure