This repository is the official implementation of the Intellectual Property Protection of Diffusion Models via the Watermark Diffusion Process. It is based on the parent repository improved-diffusion and guided-diffusion.
We use Mamba to manage the environment requirements.
mamba create -n wdm python=3.10
mamba activate wdm
mamba install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
mamba install tensorflow-gpu matplotlib blobfile mpi4py tqdm PyYAML pandasand intall the package:
pip install -e .To prepare for the task and watermark dataset, run the following:
python cifar10.pypython single_wm.pypython multiple_wm.pyTo train the baseline models in the paper, configure configs/train_mse.yaml and run this command:
python scripts/image_train.py --p configs/train_mse.yamlor multi-GPU version (replace $NUM_GPUS)
mpiexec -n $NUM_GPUS python scripts/image_train.py --p configs/train_mse.yamlTo embed the watermark data into the baseline models, configure configs/train_mse_wdp.yaml and run this command:
python scripts/image_train.py --p configs/train_mse_wdp.yamlTo sample from the task, configure the configs/sample_mse.yaml run this command:
python scripts/image_sample.py --p configs/sample_mse.yamlTo extract the watermark from the suspected model, configure the configs/sample_mse_wdp.yaml run this command:
python scripts/image_sample.py --p configs/sample_mse_wdp.yamlThe evaluation is based on the guided diffusion repo.
python scripts/evaluator.py <reference_batch> <evaluated_batch>@inproceedings{peng2025intellectual,
title={Intellectual property protection of diffusion models via the watermark diffusion process},
author={Peng, Sen and Chen, Yufei and Wang, Cong and Jia, Xiaohua},
booktitle={International Conference on Web Information Systems Engineering},
pages={290--305},
year={2025},
organization={Springer}
}