Home

Awesome

🎭 Metacloak: Preventing Unauthorized Subject-driven Text-to-image Diffusion-based Synthesis via Meta-learning

TLDR; we propose robust imperceptible perturbation against unauthorized personalized generation with diffusion models (e.g., Dreambooth).

This is the official implementation of the paper "Metacloak: Preventing Unauthorized Subject-driven Text-to-image Diffusion-based Synthesis via Meta-learning" (CVPR 2024, Oral). 📄Paper; 🏠Homepage; 🤗Huggingface Dataset;

<!-- The complete code and data will be released upon acceptance. Four sampled IDs from VGGFace2 (clean and protected images with our method with $r=11/255$) are released under the `./example_data/` folder. Free feel to test out the protection performance. --> <!-- ## Algorithm Flow ![Framework](./framework.png) -->

News

Software Dependencies

python = 3.10 and refer to ./requirements_cuda118.txt for building env.

Data and Checkpoint Dependencies

Environment Setup

setup the following environment variables

# your project root
export ADB_PROJECT_ROOT="/path/to/your/project/root"
# your conda env name
export PYTHONPATH=$PYTHONPATH$:$ADB_PROJECT_ROOT

Scripts

File Structure

- script
    -- sub
        --- generic.sh # this is for evaluation of the generated perturbation
    -- gen 
        --- generic.sh # some generic config for perturbation generation
        --- Clean.sh # no perturb 
        --- metacloak.sh # metacloak perturbation
    -- gen_and_eval.sh # generate and evaluate perturbation
    -- methods_config.sh # hyper-parameter config of diff. methods  

Perturbation Generation and Evaluation

# please modify some config in the script before running
bash ./scripts/gen_and_eval.sh
# Then foor loop all the instances and compute the metrics 

Citation

If our work or codebase is useful for your research, please consider citing:

@InProceedings{Liu_2024_CVPR,
    author    = {Liu, Yixin and Fan, Chenrui and Dai, Yutong and Chen, Xun and Zhou, Pan and Sun, Lichao},
    title     = {MetaCloak: Preventing Unauthorized Subject-driven Text-to-image Diffusion-based Synthesis via Meta-learning},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2024},
    pages     = {24219-24228}
}

Acknowledgement