Manuscript Offprint

arXiv:2610.06334

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

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

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Diffusion models have greatly advanced instruction-guided image editing, while also raising concerns about unauthorized image manipulation. Image immunization addresses this risk by adding imperceptible perturbations to an input image to disrupt subsequent edits. Since editing requests are unknown at image release, protection should remain effective beyond the instruction used to construct the perturbation. Existing immunization methods either require costly full-trajectory backpropagation or use intermediate objectives whose effects may be weakened by subsequent denoising. Meanwhile, a single inference path provides limited feedback about alternative denoising continuations. To address these challenges, we propose SPIN, a framework for image immunization via one-step projection over local stochastic trajectory neighborhoods. Starting from an early denoising state, SPIN generates stochastic neighboring states under the same instruction and predicts their clean latents through one-step projection without full unrolling. We then optimize a bounded input perturbation to maximize the average deviation of these predictions from a clean-edit reference, encouraging the perturbation to disrupt multiple possible editing outcomes. Experiments on two image editors demonstrate substantial gains in protection performance, with SPIN outperforming compared methods across all six metrics under seen instructions and in the more challenging unseen instruction setting.

1 INTRODUCTION

Instruction-guided diffusion models have made it possible to modify a source image using natural-language instructions while preserving content unrelated to the requested changes (Brooks et al., 2023; Zhao et al., 2024). Publicly available image editing models have substantially lowered the barriers to personalized image manipulation. However, the same accessibility also makes publicly released images vulnerable to unauthorized editing, which may compromise personal privacy and reputation or facilitate misleading content. Deepfake detection (Rossler et al., 2019) and AI-generated image detection (Ojha et al., 2023) can identify manipulated content, but operate only after such content has been produced. This motivates proactive protection that is embedded imperceptibly in images before release.

Image immunization protects source images by adding imperceptible perturbations that disrupt subsequent unauthorized edits. A direct approach optimizes perturbations against the final editing output, but backpropagation through the denoising trajectory incurs substantial computational cost (Salman et al., 2023). More efficient alternatives construct surrogate objectives from denoising predictions or intermediate representations (Liang et al., 2023; Liang & Wu, 2023). Such objectives can target encoder representations (Xue et al., 2024), instruction-related cross-attention (Lo et al., 2024), or early denoising states (Choi et al., 2025), providing protection signals through shorter gradient paths.

Nevertheless, deviations induced by intermediate representations may be attenuated by subsequent denoising, weakening their effect on the final edit. Protection under a fixed editing instruction may also depend on the specific sampling trajectory. This dependence becomes particularly relevant when future editing requests are unknown, as a single trajectory offers limited feedback about other possible continuations. The challenge is therefore to construct an effective optimization signal that reflects the perturbation's impact on editing outcomes across multiple possible continuations, enabling protection beyond the original editing instruction.

We address this challenge by proposing SPIN (Single-step Projection in Stochastic Neighborhoods), an image-immunization framework that uses predicted editing outcomes to guide protective perturbations. Single-step projection predicts a clean latent from an early denoising state. The discrepancy between this prediction and a fixed clean-edit reference provides an effective surrogate for optimizing perturbations that disrupt the final editing output. To extend this signal beyond a single inference path, SPIN generates neighboring candidate states through stochastic transitions from a shared early state. We then optimize a bounded input perturbation to maximize the average discrepancy between their projected outcomes and the reference, reducing dependence on a single construction path and promoting generalization to unseen editing instructions.

Experiments on SD3 and InstructPix2Pix show that SPIN outperforms all baselines across six metrics under both seen and unseen editing instructions. Immunization success rates reach 90% and 94% under seen instructions (85% and 91% under unseen instructions), consistently exceeding those of competing methods. Ablations demonstrate that single-step projection provides an effective protection signal, while stochastic neighborhood sampling further improves generalization over single-candidate projection.

Our main contributions are summarized as follows:

• We propose SPIN, an image-immunization framework that uses single-step projection to guide perturbation optimization with predicted editing outcomes, providing an effective signal for disrupting the final edit.

• We introduce stochastic neighborhood optimization to construct a single perturbation that targets multiple possible continuations of the editing process. By driving their projected outcomes away from the clean-edit reference, this strategy promotes disruption across different inference paths and improves generalization to unseen editing instructions.

• Experiments under standard editing pipelines show that SPIN consistently outperforms the evaluated baselines in immunization success rate under both seen and unseen instructions, across flow-matching and noise-prediction diffusion editors.

References (34)

  • Synthesizing robust adversarial examples
  • Qwen3-VL Technical Report
  • Dct-shield: a robust frequency domain defense against malicious image editing
  • Instructpix2pix: Learning to follow image editing instructions
  • Test-time reinforcement learning for flow matching
  • Editshield: Protecting unauthorized image editing by instruction-guided diffusion models
  • Diffusionguard: A robust defense against malicious diffusion-based image editing
  • Semantic mismatch and perceptual degradation: A new perspective on image editing immunity (opens arXiv in a new tab)
  • Boosting adversarial attacks with momentum
  • Explaining and harnessing adversarial examples
  • Prompt-to-prompt image editing with cross-attention control
  • Imagic: Text-based real image editing with diffusion models
  • Superedit: Rectifying and facilitating supervision for instruction-based image editing
  • Derivative-free guidance in continuous and discrete diffusion models with soft value-based decoding
  • Mist: Towards improved adversarial examples for diffusion models (opens arXiv in a new tab)
  • Adversarial example does good: Preventing painting imitation from diffusion models via adversarial examples
  • Flow-grpo: Training flow matching models via online rl
  • Distraction is all you need: Memory-efficient image immunization against diffusion-based image editing
  • Towards deep learning models resistant to adversarial attacks
  • SDEdit: Guided image synthesis and editing with stochastic differential equations
  • Universal adversarial perturbations
  • Towards universal fake image detectors that generalize across generative models
  • Faceforensics++: Learning to detect manipulated facial images
  • Raising the cost of malicious AI-powered image editing
  • Image information and visual quality
  • Score-based generative modeling through stochastic differential equations
  • Kimi K2.5: Visual Agentic Intelligence
  • Enhancing the transferability of adversarial attacks through variance tuning
  • Mean squared error: Love it or leave it? a new look at signal fidelity measures
  • Image quality assessment: from error visibility to structural similarity
  • Toward effective protection against diffusion-based mimicry through score distillation
  • Fsim: A feature similarity index for image quality assessment
  • The unreasonable effectiveness of deep features as a perceptual metric
  • Ultraedit: Instruction-based fine-grained image editing at scale