Skip to content

somuchtome/SimAC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of contents
  1. Environment setup
  2. Dataset
  3. How to run
  4. Contacts
  5. Acknowledgement
  6. Citation

SimAC: A Simple Anti-Customization Method for Protecting Face Privacy against Text-to-Image Synthesis of Diffusion Models (CVPR'24)

This repository provides the official PyTorch implementation of the following paper:


Environment setup

Install dependencies:

cd SimAC
conda create -n simac python=3.9  
conda activate simac
pip install -r requirements.txt  

Pretrained checkpoints of different Stable Diffusion versions can be downloaded from provided links in the table below:

Version Link
2.1 stable-diffusion-2-1-base
1.5 stable-diffusion-v1-5
1.4 stable-diffusion-v1-4

Please download the pretrain weights and define "$MODEL_PATH" in the script. Note: Stable Diffusion version 2.1 is the default version in all of our experiments.

GPU allocation: All experiments are performed on a single NVIDIA 48GB A6000 GPU.

Dataset

Thanks for Anti-Dreambooth's great efforts, there are two datasets: VGGFace2 and CelebA-HQ which are provided at here.

For convenient testing, we have provided a split set of one subject in CelebA-HQ at ./data/CelebA-HQ/103 as the Anti-dreambooth does.

How to run

To defense Stable Diffusion version 2.1 (default) with ASPL, you can run

bash scripts/attack_aspl.sh

To defense Stable Diffusion version 2.1 (default) with SimAC, you can run

bash scripts/attack_timesteps.sh

If you want to train a DreamBooth model from your own data, whether it is clean or perturbed, you may run the following script:

bash scripts/train_dreambooth_alone.sh

Inference: generates examples with multiple-prompts

python infer.py --model_path <path to DREAMBOOTH model>/checkpoint-1000 --output_dir $<path to DREAMBOOTH model>/checkpoint-1000-test-infer

Contacts

If you have any problems, please open an issue in this repository or send an email to wangfeifei@mail.ustc.edu.cn.

Acknowledgement

This repo is heavil based on Anti-DB. Thanks for their impressive works!

Citation

Details of algorithms and experimental results can be found in our following paper:

@inproceedings{wang2024simac,
  title={SimAC: A Simple Anti-Customization Method for Protecting Face Privacy against Text-to-Image Synthesis of Diffusion Models},
  author={Feifei Wang and Zhentao Tan and Tianyi Wei and Yue Yue and Qidong Huang},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={12047--12056},
  year={2024}
}

Please CITE our paper if you find this work useful for your research.

About

[CVPR 2024] official code for SimAC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors