SPIN: Image Immunization Against Diffusion Editing via Single-Step Projection in Stochastic Neighborhoods

Fengming Gu, Jie Zhang, Zhongqi Wang, Qiankun Li, Shiguang Shan, Xilin ChenarXiv 2026

TL;DR

SPIN (Single-step Projection in Stochastic Neighborhoods) is a new framework that "immunizes" images against unauthorized AI editing by adding imperceptible adversarial perturbations. By using a clever one-step projection to predict editing outcomes across multiple potential denoising paths, SPIN creates a defense that is both computationally efficient and robust enough to disrupt edits even when the attacker uses instructions the protector never saw.

What Problem Does This Paper Address?

Instruction-guided diffusion models (like InstructPix2Pix or Stable Diffusion 3) have made high-quality image editing accessible to everyone. While great for creativity, this also opens the door to "deepfakes" and unauthorized manipulations that can damage reputations or spread misinformation.

"Image immunization" is a proactive defense where a user adds a tiny, invisible bit of noise to their image before uploading it. This noise is designed to "break" any future diffusion-based edits. However, existing methods face a "trilemma":

  1. Computational Cost: Some methods require backpropagating through the entire denoising chain, which is incredibly slow.
  2. Fragility: Methods that use "shortcut" objectives often see their protective signals washed away by the model's own denoising process.
  3. Overfitting: Most defenses are optimized for one specific editing prompt. If an attacker uses a slightly different instruction, the protection often fails.

Methods

The authors introduce SPIN, which tackles these issues using two core innovations:

  1. Outcome-Oriented Single-Step Projection: Instead of running the full, expensive denoising process during optimization, SPIN uses the model's own internal predictions to "jump" from an early state straight to a predicted final image. This provides a high-quality signal of how the edit will fail without the cost of full unrolling.
  2. Stochastic Trajectory Neighborhoods: Diffusion is inherently random. SPIN doesn't just optimize against one path; it generates a "neighborhood" of potential future states from a shared starting point. By maximizing the average disruption across these multiple paths, the resulting perturbation becomes much more generalized and harder to bypass.
Figure 1: Overview of SPIN. From a shared native prefix, local trajectory sampling generates neigh- boring candidates and one-step projection estimates their clean endpoints. These estimates guide perturbation optimization to drive editing outputs away from the fixed clean-edit reference.

The optimization uses Projected Gradient Descent (PGD) to find a perturbation $\delta$ that maximizes the cosine distance between the predicted "clean edit" and the "immunized edit" in the latent space.

Datasets

The researchers evaluated SPIN using a benchmark constructed from Pico-Banana, a dataset covering diverse categories like landscapes, artworks, and public figures.

  • Scale: 500 source images.
  • Evaluation: Each image was tested against its original prompt plus five semantically disjoint "unseen" instructions, totaling 3,000 image-instruction pairs.
  • Models: The framework was tested on both noise-prediction models (InstructPix2Pix) and flow-matching models (Stable Diffusion 3).

Key Insights and Ideas

  • The "Look-Ahead" Advantage: One-step projection acts as a surprisingly effective surrogate for the final output. By targeting the endpoint rather than intermediate features, the perturbation is less likely to be "fixed" by the model's denoising steps.
  • Early Branching Matters: The authors found that branching the stochastic paths early in the denoising process (around the first few steps) provides the best balance of diversity and disruption. Later branching leads to more accurate projections but less effective protection.
  • Stochasticity = Generalization: The most significant "aha" moment is that optimizing against a neighborhood of paths inherently helps the protection transfer to unseen instructions. It prevents the adversarial noise from becoming a "one-trick pony" that only works for a specific prompt or random seed.

Key Results

SPIN significantly outperformed state-of-the-art baselines like PhotoGuard, AdvDM, and SIFM across all metrics.

  • Immunization Success Rate (ISR): SPIN achieved an ISR of 90-94% under seen instructions and maintained a high 85-91% under unseen instructions. For comparison, many baselines dropped significantly when faced with new prompts.
  • Visual Disruption: Qualitatively, while baseline methods often only caused slight color shifts, SPIN caused massive structural failures in the edited images, rendering them useless for unauthorized manipulation.
  • Efficiency: SPIN is roughly 20x faster than full-trajectory methods (like PhotoGuard-D) while providing superior protection.
Qualitative comparison showing how SPIN causes structural failure in edits compared to baselines.

Limitations and Future Work

  • Input Fidelity Trade-off: Like all adversarial methods, there is a limit to how much protection you can add before the original image starts to look "noisy." The authors found $8/255$ to be the sweet spot, but very sensitive users might still notice the perturbation.
  • Adaptive Attackers: The paper primarily evaluates against standard editing pipelines. Future work could explore how these defenses hold up against attackers who are aware of SPIN and try to pre-process images to remove the protection.
  • Cross-Architecture Transfer: While SPIN works across different diffusion types (flow-matching vs. noise-prediction), further study is needed to see if a perturbation optimized for one specific model (e.g., SD3) can protect against a completely different architecture.

Summary updated

BibTeX
@misc{gu2026spin,
  author = {Fengming Gu and Jie Zhang and Zhongqi Wang and Qiankun Li and Shiguang Shan and Xilin Chen},
  title = {{SPIN: Image Immunization Against Diffusion Editing via Single-Step Projection in Stochastic Neighborhoods}},
  year = {2026},
  eprint = {2610.06334},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.06334},
}
Figure