GenPTW: In-Generation Image Watermarking for Provenance Tracing and Tamper Localization

Zhenliang Gan, Chunya Liu, Yichao Tang, Binghao Wang, Weiqiang Wang, Xinpeng Zhang

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).

Overview of the GenPTW framework, illustrating the lifecycle from generation and watermark embedding to malicious tampering and subsequent extraction of provenance and tamper masks.

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.
Detailed architecture of GenPTW, highlighting the hierarchical embedding via Cross-Attention Fusion (CAF) and Spatial-Broadcast Fusion, and the joint extraction of watermark bits and tamper masks.

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

Abstract

The rapid development of generative image models has brought tremendous opportunities to AI-generated content (AIGC) creation, while also introducing critical challenges in ensuring content authenticity and copyright ownership. Existing image watermarking methods, though partially effective, often rely on post-processing or reference images, and struggle to balance fidelity, robustness, and tamper localization. To address these limitations, we propose GenPTW, an In-Generation image watermarking framework for latent diffusion models (LDMs), which integrates Provenance Tracing and Tamper Localization into a unified Watermark-based design. It embeds structured watermark signals during the image generation phase, enabling unified provenance tracing and tamper localization. For extraction, we construct a frequency-coordinated decoder to improve robustness and localization precision in complex editing scenarios. Additionally, a distortion layer that simulates AIGC editing is introduced to enhance robustness. Extensive experiments demonstrate that GenPTW outperforms existing methods in image fidelity, watermark extraction accuracy, and tamper localization performance, offering an efficient and practical solution for trustworthy AIGC image generation.
BibTeX
@inproceedings{gan2026genptw,
  author = {Zhenliang Gan and Chunya Liu and Yichao Tang and Binghao Wang and Weiqiang Wang and Xinpeng Zhang},
  title = {{GenPTW: In-Generation Image Watermarking for Provenance Tracing and Tamper Localization}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  url = {https://openreview.net/forum?id=iOYwSHOULJ},
}
Figure