Abstract
The proliferation of generative image models has revolutionized AIGC creation while amplifying concerns over content provenance and manipulation forensics. Existing methods are typically either unable to localize tampering or restricted to specific generative settings, limiting their practical utility. We propose GenPTW, a General watermarking framework that unifies Provenance tracing and Tamper localization in latent space. It supports both in-generation and post-generation embedding without altering the generative process, and is plug-and-play compatible with latent diffusion models (LDMs) and visual autoregressive (VAR) models. To achieve precise provenance tracing and tamper localization, we embed the watermark using two complementary mechanisms: cross-attention fusion aligned with latent semantics and spatial fusion providing explicit spatial guidance for edit sensitivity. A tamper-aware extractor jointly conducts provenance tracing and tamper localization by leveraging watermark features together with high-frequency features. Experiments show that GenPTW maintains high visual fidelity and strong robustness against diverse AIGC-editing.
Introduction
Generative AI models like Stable Diffusion and Midjourney have made it incredibly easy to create and edit hyper-realistic images. This capability is a double-edged sword, introducing severe risks around content misuse, deepfakes, and ambiguous copyright ownership. To combat these risks, researchers employ image watermarking. However, existing methods often suffer from single-task focus (either ownership or tampering), post-generation bottlenecks, or architecture lock-in (e.g., only working for specific diffusion models).
GenPTW addresses these challenges by building a unified, model-agnostic watermarking framework that embeds a robust signal directly during the image generation process without degrading the original model's output quality.
Methodology
GenPTW achieves its goals by embedding the watermark directly into the latent space decoding process. It uses a coarse-to-fine strategy with two key modules:
- Cross-Attention Fusion (CAF): Instead of blindly adding noise, CAF uses a cross-attention mechanism where the image's latent features guide the watermark injection. This allows the watermark to "diffuse" naturally along the image's structural textures, balancing robustness with visual imperceptibility.
- Spatial Fusion (SF): At the final, high-resolution decoding stage, the watermark is injected as an explicit spatial prior. This dense, pixel-aligned grid allows the model to detect exactly where an image is tampered with later.
- Tamper-Aware Extractor: The extractor looks at both embedded watermark features and high-frequency artifacts (extracted via Discrete Cosine Transform). By combining the fragile watermark grid with the unnatural high-frequency noise left by AI editing tools, the extractor jointly recovers the ownership message and outputs a precise tamper mask.
Experimental Setup
The framework was trained and tested using the MS COCO dataset. For AI-specific evaluation, 1,000 images were generated using Stable Diffusion v2 and 1,000 using VAR models. To simulate real-world tampering, the authors utilized the UltraEdit protocol, which includes manipulations like Stable Diffusion Inpainting, Lama (splicing), and InstructP2P.
Key Results and Insights
GenPTW demonstrates that the latent space is a universal target for watermarking, achieving true "plug-and-play" compatibility across different generative architectures.
- Exceptional Localization: GenPTW achieved near-perfect tamper localization on AI-generated images (F1: 0.965–0.976, AUC: 0.993–0.997), significantly outperforming passive baselines like PSCC-Net.
- High Visual Fidelity: The framework maintained excellent visual quality with a PSNR of 39.56 dB, surpassing existing in-generation baselines like Stable Signature.
- Robustness: GenPTW maintained 100% bit recovery accuracy against common degradations (JPEG compression, blurring) and aggressive AI edits.
Conclusion
GenPTW offers a robust, unified forensic solution for the AIGC era. While it excels at localizing edits, it currently flags the entire image as tampered during full-image semantic rewrites (like style changes). Future work will focus on streamlining the computational overhead of the attention blocks to enable faster, real-time generation.
Summary updated