arXiv:2512.16625cs.CV2025-12被引 4

通过干扰注意力机制,防止扩散模型未经授权修改图片。

DeContext as Defense: Safe Image Editing in Diffusion Transformers

  • 在多模态注意力层注入微小扰动,切断输入图像与输出的关联
  • 在Flux Kontext和Step1X-Edit上成功阻止恶意编辑,保持图像质量
  • 方法高效且针对关键层级设计,适合隐私保护场景

上下文扩散模型让用户能轻松、逼真地修改图像,但这也带来严重隐私风险:个人图像可能被用于身份冒用、虚假信息等恶意用途,且未经所有者同意。尽管已有研究探索输入扰动以防御个性化文本到图像生成中的滥用,但对大规模基于DiT的上下文模型的鲁棒性仍缺乏深入分析。本文提出DeContext,一种保护输入图像免受未经授权的上下文编辑的新方法。核心思路是:源图像的上下文信息主要通过多模态注意力层传递至输出。通过注入小而精准的扰动,削弱这些跨注意力路径,可有效切断输入与输出间的联系。该防御方法简单高效且具有鲁棒性。我们进一步发现,早期去噪步骤和特定Transformer块主导了上下文传播,因此可将扰动集中于关键位置。在Flux Kontext和Step1X-Edit上的实验表明,DeContext能持续阻止非授权图像编辑,同时保持视觉质量。结果证明,基于注意力的扰动是抵御图像篡改的强大防御手段。代码已开源:https://github.com/LinghuiiShen/DeContext。

原文摘要 · Abstract (English)

In-context diffusion models allow users to modify images with remarkable ease and realism. However, the same power raises serious privacy concerns: personal images can be easily manipulated for identity impersonation, misinformation, or other malicious uses, all without the owner's consent. While prior work has explored input perturbations to protect against misuse in personalized text-to-image generation, the robustness of modern, large-scale in-context DiT-based models remains largely unexamined. In this paper, we propose DeContext, a new method to safeguard input images from unauthorized in-context editing. Our key insight is that contextual information from the source image propagates to the output primarily through multimodal attention layers. By injecting small, targeted perturbations that weaken these cross-attention pathways, DeContext breaks this flow, effectively decouples the link between input and output. This simple defense is both efficient and robust. We further show that early denoising steps and specific transformer blocks dominate context propagation, which allows us to concentrate perturbations where they matter most. Experiments on Flux Kontext and Step1X-Edit show that DeContext consistently blocks unwanted image edits while preserving visual quality. These results highlight the effectiveness of attention-based perturbations as a powerful defense against image manipulation. Code is available at https://github.com/LinghuiiShen/DeContext.

图像安全扩散模型隐私保护

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。