Abstract: Generative models have enabled the creation of contents that are indistinguishable from those taken from nature. Open-source development of such models raised concerns about the risks of their misuse for malicious purposes. One potential risk mitigation strategy is to attribute generative models via fingerprinting. Current fingerprinting methods exhibit a significant tradeoff between robust attribution accuracy and generation quality while lacking design principles to improve this tradeoff. This paper investigates the use of latent semantic dimensions as fingerprints, from where we can analyze the effects of design variables, including the choice of fingerprinting dimensions, strength, and capacity, on the accuracy-quality tradeoff. Compared with previous SOTA, our method requires minimum computation and is more applicable to large-scale models. We use StyleGAN2 and the latent diffusion model to demonstrate the efficacy of our method.
- NVIDIA GPU + CUDA 10.1 or above
- Python 3.7 or above
- pytorch 1.11 or above
- Anaconda recommended
- To install the other Python dependencies using anaconda, run
conda env create -f env.yml
.
We experiment on FFHQ, AFHQ-cat, and AFHQ-dog.
Checkpoints can be downloaded below.
Make checkpoint folder in src folder and put weights under src/checkpoint/.
Pretrained Weights:
FFHQ
AFHQ
- Run, e.g.,
where
python generator.py --model sg2 --save_dir '../result/' --key_len 64 --sigma 1 --shift 448
save_dir
: Directory for output savingkey_len
: Digits of binary key, higher key length will increase the key capacity. For key length = 64, the key capacity would be 2^64sigma
: Fingerprint perturbation strengthshift
: Initial index of consecutive principal axis ranked from a descent order based on it's corresponding variance. E.g. the set of editing direction V follows V = PC[shift:shift+key_len]
After running the code, fingerprinted images will be saved under result folder.
- Run, e.g.,
besides the argumentation from above, we have additional argument:
python main.py --model sg2 --save_dir '../result/' --key_len 64 --sigma 1 --shift 448 --step 2000 --sample_size 100 --n 20
step
: optimization steps to attribute fingerprinted imagesample_size
: number of attribution tests user would like to performn
: Number of initial guess from Latin Hypercube sampling method
The result will be saved under result folder.
-LDM version can be found here