项目介绍

fahadshamshad/Clip2Protect 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,目前获得 107 个 Star、11 次 Fork。

仓库全名
fahadshamshad/Clip2Protect
Star 数
107
Fork 数
11
未关闭 Issue
3

README 摘要

Table of Contents Updates Central Idea Motivation Limitation of existing works Pipeline Instructions for Code usage Citation CLIP2Protect: Protecting Facial Privacy using Text-Guided Makeup via Adversarial Latent Search [CVPR 2023] Fahad Shamshad , Muzammal Naseer , Karthik Nandakumar MBZUAI, UAE . Updates :loudspeaker: July-19 : Code released. June-19 : Code and demo release coming soon. Stay tuned! 🎯 Central Idea…

完整内容见 GitHub 原始 README 或本页 。

常见问题

Clip2Protect 用什么语言开发?

主要使用 Python 编写,目前有 107 个 Star。

如何获取 Clip2Protect 的源码?

可以直接克隆仓库:git clone https://github.com/fahadshamshad/Clip2Protect.git,默认分支为 main;安装与运行步骤见仓库 README。

Clip2Protect 最近还在维护吗?

仓库最近一次更新为 2024年3月25日,当前有 3 个未关闭 Issue;Star 数为 107,可作为社区活跃度的参考。

关于

[CVPR 2023] Official repository of paper titled "CLIP2Protect: Protecting Facial Privacy using Text-Guided Makeup via Adversarial Latent Search".

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

语言占比

Cuda
Python

README

Table of Contents

CLIP2Protect: Protecting Facial Privacy using Text-Guided Makeup via Adversarial Latent Search [CVPR 2023]

Fahad Shamshad, Muzammal Naseer, Karthik Nandakumar
MBZUAI, UAE.

Updates :loudspeaker:

  • July-19 : Code released.
  • June-19 : Code and demo release coming soon. Stay tuned!

🎯 Central Idea 🎯

We all love sharing photos online, but do you know big companies and even governments can use sneaky 🕵️‍♂️ face recognition software to track us? Our research takes this challenge head-on with a simple and creative idea 🌟: using carefully crafted makeup 💄 to outsmart the tracking software. The cherry on top? We’re using everyday, easy-to-understand language 🗣️ to guide the makeup application, giving users much more flexibility! Our approach keeps your photos safe 🛡️ from unwanted trackers without making you look weird or having bizarre patches on your face, issues commonly seen with previous solutions.

Motivation :muscle: :fire:

  • Malicious black-box Face recognition systems pose a serious threat to personal security/privacy of 5 billions people using social media.
  • Unauthorized entities can use FR systems to track user activities by scraping face images from social media platforms.
  • There is an urgent demand for effective privacy preservation methods.

Limitation of existing works :warning:

  • Recent noise-based facial privacy protection approaches result in artefacts.
  • Patch-based privacy approaches provide low privacy protection and their large visible pattern compromises naturalness.

Pipeline

CLIP2Protect generates face images that look natural and real. But here’s the special part: it also ensures a high level of privacy protection. This means you can keep sharing images without worrying about unwanted tracking. It consists of two stages.

  • The latent code initialization stage reconstructs the given face image in the latent space by fine-tuning the generative model.
  • The text-guided adversarial optimization stage utilizes user-defined makeup text prompts and identity-preserving regularization to guide the search for adversarial codes within the latent space to effectively protect the facial privacy.

Intructions for Code usage

Setup

  • Get code
git clone https://github.com/fahadshamshad/Clip2Protect.git
  • Build environment
cd Clip2Protect
# use anaconda to build environment 
conda create -n clip2protect python=3.8
conda activate clip2protect
# install packages
pip install -r requirements.txt

Steps for Protecting Faces

  1. Our solution relies on the Rosinality PyTorch implementation of StyleGAN2.

  2. Download the pre-trained StyleGAN2 weights:

    • Download the pre-trained StyleGAN2 weights from here.
    • Place the weights in the ‘pretrained_models’ folder.
  3. Download pretrained face recognition models and dataset instructions:

    • To acquire pretrained face recognition models and dataset instructions, including target images, please refer to the AMT-GAN page here.
    • Place the pretrained face recognition model in the models folder.
  4. Acquire latent codes:

    • We assume the latent codes are available in the latents.pt file.
    • You can acquire the latent codes of the face images to be protected using the encoder4editing (e4e) method available here.
  5. Run the code:

    • The core functionality is in main.py.
    • Provide the latents.pt file and the corresponding faces directory, named ‘input_images’.
    • Generate the protected faces in the ‘results’ folder by running the following command:
      python main.py --data_dir input_images --latent_path latents.pt --protected_face_dir results
      
  6. Generator finetuning and adversarial optimization stages:

    • The generator finetuning is implemented in pivot_tuning.py.
    • The adversarial optimization is implemented in adversarial_optimization.py.

Citation

If you’re using CLIP2Protect in your research or applications, please cite using this BibTeX:

@inproceedings{shamshad2023clip2protect,
  title={CLIP2Protect: Protecting Facial Privacy Using Text-Guided Makeup via Adversarial Latent Search},
  author={Shamshad, Fahad and Naseer, Muzammal and Nandakumar, Karthik},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={20595--20605},
  year={2023}
  }

评论

暂无评论