Abstract
Latent-based watermarks, integrated into the generation process of latent diffusion models (LDMs), simplify detection and attribution of generated images. However, recent black-box forgery attacks, where an attacker needs at least one watermarked image and black-box access to the provider's model, can embed the provider's watermark into images not produced by the provider, posing outsized risk to provenance and trust. We propose SemBind, the first defense framework for latent-based watermarks that resists black-box forgery by binding latent signals to image semantics via a learned semantic masker. Trained with contrastive learning, the masker yields near-invariant codes for the same prompt and near-orthogonal codes across prompts; these codes are reshaped and permuted to modulate the target latent before any standard latent-based watermark. SemBind is generally compatible with existing latent-based watermarking schemes and keeps image quality essentially unchanged, while a simple mask-ratio parameter offers a tunable trade-off between anti-forgery strength and robustness. Across four mainstream latent-based watermark methods, our SemBind-enabled anti-forgery variants markedly reduce false acceptance under black-box forgery while providing a controllable robustness-security balance.
Introduction: The Vulnerability of Latent Watermarks
As Latent Diffusion Models (LDMs) like Stable Diffusion become ubiquitous, watermarking has emerged as a critical tool for provenance and copyright. "Latent-based" watermarking—where a pattern is embedded into the initial random noise used to generate an image—is particularly popular because it doesn't degrade image quality and is theoretically "undetectable."
However, these watermarks have a "content-agnostic" Achilles' heel. In a black-box forgery attack, an adversary can take a single watermarked image, use a proxy model to estimate the underlying noise pattern (the watermark), and then "imprint" that pattern onto a completely different, potentially harmful image. Because the watermark isn't tied to what the image actually shows, the verification system will falsely validate the forgery as a legitimate output from the original provider. SemBind aims to break this "copy-paste" vulnerability by locking the watermark to the image's semantic content.
Methods: Semantic Binding via Learned Masking
The core of SemBind is a Semantic Masker ($f_\theta$) that "binds" the watermark to the image's meaning.
- Semantic Encoding: The system uses a frozen DINOv2 backbone to extract a global embedding of the image's semantics.
- Contrastive Learning: The masker is trained using a two-stage contrastive loss. It learns to produce nearly identical binary codes for images generated from the same prompt (even with augmentations) and nearly orthogonal (completely different) codes for images from different prompts.
- Latent Modulation: Before the standard watermark (like Tree-Ring or Gaussian Shading) is applied, the binary code is expanded into a spatial mask, permuted with a secret key, and used to modulate the initial latent noise.
- Verification: During extraction, the system re-computes the semantic code from the generated image. If an attacker tries to put the watermark on an image with different semantics, the masks won't align, the modulation won't be reversed correctly, and the watermark extraction will fail.
A key feature is the mask-ratio ($\sigma$), a tunable parameter that allows providers to decide what percentage of the latent coordinates are modulated, offering a direct trade-off between anti-forgery strength and robustness to benign edits.
Datasets and Training
The authors introduced a significant new dataset for training the semantic masker:
- SemCon-3M: A corpus of ~3 million embeddings derived from 96,041 unique prompts (sourced from MS-COCO and Stable Diffusion Prompts). For each prompt, they generated 16 independent images and 16 augmented versions to ensure the masker is robust to visual variations that don't change the core meaning.
For evaluation, they used standard benchmarks including MS-COCO and Stable Diffusion Prompts (SDP) for quality and robustness testing, and Inappropriate Image Prompts (I2P) to simulate malicious "reprompting" attacks.
Key Insights
- Relational Consistency: The semantic masker doesn't need to "understand" the image in a human sense; it just needs to be a consistent hashing function that maps similar concepts to the same bitstring and different concepts to different ones.
- Preserving Undetectability: The authors provide a theoretical proof that SemBind preserves the "provable undetectability" of the underlying watermarking schemes. Since the modulation essentially just flips the signs of Gaussian noise, the statistical distribution remains Gaussian and indistinguishable from unwatermarked noise.
- The "Mismatch" Advantage: The defense is even more effective when the attacker uses a different model (e.g., trying to attack an SD 2.1 system using an SD 1.5 proxy).
Key Results
- Forgery Resistance: In "imprinting" attacks, SemBind reduced the False Acceptance Rate (the rate at which forged images were verified as real) from nearly 100% down to below 10% for several mainstream watermarking methods.
- Quality Preservation: Using FID (Fréchet Inception Distance) and CLIP scores, the authors showed that SemBind has a negligible impact on image quality. In some cases, the semantic masking actually improved FID scores by acting as a mild, content-conditioned randomization.
- Robustness: The system remains effective even after common image distortions like JPEG compression, blurring, and resizing, maintaining high detection accuracy for legitimate images.
Limitations and Future Work
Currently, SemBind requires generating an auxiliary "clean" image during the embedding process to extract the semantic code, which adds computational cost at the time of generation. A promising future direction is deriving the semantic mask directly from the text prompt. Additionally, while SemBind resists "pixel-level spoofing" unless a massive portion of the image is overwritten, more sophisticated adaptive attacks remain a subject for future research.
Summary updated