CGI-DM: Digital Copyright Authentication for Diffusion Models via Contrasting Gradient Inversion

Xiaoyu Wu, Yang Hua, Chumeng Liang, Jiaru Zhang, Hao Wang, Tao Song, Haibing Guan · DOI

Abstract

Diffusion Models (DMs) have evolved into advanced image generation tools, especially for few-shot generation where a pretrained model is fine-tuned on a small set of images to capture a specific style or object. Despite their success, concerns exist about potential copyright violations stemming from the use of unauthorized data in this process. In response, we present Contrasting Gradient Inversion for Diffusion Models (CGI-DM), a novel method featuring vivid visual representations for digital copyright authentication. Our approach involves removing partial information of an image and recovering missing details by exploiting conceptual differences between the pretrained and fine-tuned models. We formulate the differences as KL divergence between latent variables of the two models when given the same input image, which can be maximized through Monte Carlo sampling and Projected Gradient Descent (PGD). The similarity between original and recovered images serves as a strong indicator of potential infringements. Extensive experiments on the WikiArt and Dream-booth datasets demonstrate the high accuracy of CGI-DM in digital copyright authentication, surpassing alternative validation techniques.

Introduction

The rapid advancement of few-shot generation techniques, such as Dreambooth and LoRA, has enabled users to fine-tune large-scale diffusion models (like Stable Diffusion) on minimal datasets to replicate specific artistic styles or private objects. While these tools foster creativity, they also present a significant legal challenge: the unauthorized use of copyrighted material for model training.

Existing solutions primarily focus on "precautionary" measures, such as adding invisible noise to images to prevent learning. However, there is a critical lack of "post-cautionary" forensic tools. When an artist suspects their work has been used without permission, they need robust evidence. Traditional Membership Inference Attacks (MIA) typically provide binary statistical outputs that are difficult to interpret in a legal context. CGI-DM addresses this by providing visualizable evidence—reconstructing what a model has "memorized" to prove infringement.

The CGI-DM Framework

The core concept of CGI-DM is to turn a model's capacity for memorization into a forensic signature. Generative models, particularly in few-shot scenarios, tend to memorize specific training samples rather than just learning general concepts.

CGI-DM Framework for Copyright Authentication

As illustrated in the framework overview, the process begins by taking a suspect image and applying partial masking to remove information. The system then attempts to recover these missing details by comparing the fine-tuned model against its original pretrained base. If the recovered image closely matches the original, it indicates that the fine-tuned model possesses specific knowledge of that image not present in the base model, serving as a "smoking gun" for copyright infringement.

Technical Methodology

Standard gradient inversion techniques often fail with diffusion models, resulting in unrecognizable outputs. CGI-DM overcomes this through a contrastive approach that highlights the "conceptual difference" between models.

The Optimization Loop

The method follows a four-step optimization process:

  1. Partial Information Removal: A suspected training image is masked (e.g., block-wise masking) to create a partial representation.
  2. Conceptual Difference Loss: The system calculates the KL Divergence between the latent variables of the pretrained model and the fine-tuned model. This loss function identifies what the fine-tuned model uniquely knows about the specific image.
  3. Monte Carlo Optimization: Using Projected Gradient Descent (PGD) and Monte Carlo sampling, the masked pixels are iteratively updated.
  4. Similarity Measurement: The final recovered image is compared to the original using similarity metrics (like CLIP or DINO) to determine the likelihood of infringement.
Technical Optimization Loop of CGI-DM

Experimental Evaluation

The researchers evaluated CGI-DM using the WikiArt dataset (for style-driven generation) and the Dreambooth dataset (for subject-driven generation). To ensure the model wasn't simply recognizing similar images, the team implemented near-duplicate filtering, removing any images with a CLIP similarity greater than 0.90.

Key results include:

  • High Accuracy: CGI-DM consistently maintained over 90% accuracy in identifying training samples, significantly outperforming simple inpainting or standard image-to-image generation baselines.
  • Robustness: The method proved effective across multiple versions of Stable Diffusion (v1.4, v1.5, and v2.0) and remained resilient even when training data was modified with common privacy defenses like RandAugment.
  • Efficiency: The optimization process takes approximately 5.6 minutes per image, making it a viable tool for targeted forensic audits.

Conclusion

CGI-DM provides a vital bridge between AI forensics and legal explainability. By producing intuitive visual evidence of model memorization, it offers a more convincing path for copyright holders to protect their intellectual property. While currently a white-box method requiring access to model weights, future iterations may explore black-box applications and integration with data watermarking to create a comprehensive protection ecosystem for digital creators.

Summary updated

BibTeX
@misc{wu2024cgi,
  author = {Xiaoyu Wu and Yang Hua and Chumeng Liang and Jiaru Zhang and Hao Wang and Tao Song and Haibing Guan},
  title = {{CGI-DM: Digital Copyright Authentication for Diffusion Models via Contrasting Gradient Inversion}},
  year = {2024},
  eprint = {2403.11162},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.11162},
}
Figure