Skip to content

Yingqiancui/DiffusionShield

Repository files navigation

DiffusionShield

DiffusionShield offers a novel approach to copyright protection for digital images against generative diffusion models. This tool allows users to embed watermarks into images and detect them, providing an added layer of security and authenticity.

Paper Reference

For detailed insights and the methodology behind DiffusionShield, refer to the paper: DiffusionShield: A Watermark for Copyright Protection against Generative Diffusion Models.

Getting Started

Before you can start using DiffusionShield to train watermark patches, add watermarks to images, or detect watermarks, ensure you have the necessary environment and dependencies set up.

Training Watermark Patches and Detector

To train the Watermark Patches and Detector, execute the following command:

sh train.sh

Adding Watermark to Images

To embed a watermark into your images, use the command:

python add_watermark.py

Detecting Watermarks on Images

For detecting watermarks on images and calculating the bit accuracy, run:

python test_acc.py

Update

We have uploaded the code regarding the watermark used for fine-tuning Latent Diffusion Model. (Inside the LDM directory)

Acknowledgement

This project incorporates DiffJPEG, developed by Marcela Lomnitz, to enable differentiable JPEG compression critical for enhancing the robustness of watermark patches and classifier.The software is accessible at DiffJPEG's GitHub repository and is utilized in accordance with the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published