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.
For detailed insights and the methodology behind DiffusionShield, refer to the paper: DiffusionShield: A Watermark for Copyright Protection against Generative Diffusion Models.
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.
To train the Watermark Patches and Detector, execute the following command:
sh train.sh
To embed a watermark into your images, use the command:
python add_watermark.py
For detecting watermarks on images and calculating the bit accuracy, run:
python test_acc.py
We have uploaded the code regarding the watermark used for fine-tuning Latent Diffusion Model. (Inside the LDM directory)
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.