Git Product home page Git Product logo

vmi's Introduction

Variational Model Inversion Attacks

Kuan-Chieh Wang, Yan Fu, Ke Li, Ashish Khisti, Richard Zemel, Alireza Makhzani

Fig1

  • Most commands are in run_scripts.
  • We outline a few example commands here.
    • Commands below end with a suffix <mode>. Setting <mode>=0 will run code locally. <mode>=1 was used with SLURM on a computing cluster.
  • The environment variable ROOT1 was set to my home directory.

Set up task (data & pretrained models, etc.)

Check out the StyleGAN repo and place it in the same directory hierarchy as the present repo. This is used to make sure you can load and run the pretrained StyleGAN checkpoints.

For CelebA experiments:

  • Data --
    • download the "Align&Cropped Images" from the CelebA website into the directory data/img_align_celeba.
    • make sure in data/img_align_celeba, there are 000001.jpg to 202599.jpg.
    • download identity_CelebA.txt and put it in data/celeb_a.
  • Pretrained DCGAN -- download and untar this into the folder pretrained/gans/neurips2021-celeba.
  • Pretrained StyleGAN -- download and untar this into the folder pretrained/stylegan/neurips2021-celeba.
  • Pretrained Target Classifier -- download and untar this into the folder pretrained/classifiers/neurips2021-celeba.
  • Evaluation Classifier --
    • check out the InsightFace repo and place it in the same directory hierarchy as the present repo.
    • follow instructions in that repo, and download the ir_se50 model, which is used as the evaluation classifier.

Train VMI

CelebA

  • the script below runs VMI attack on the first 100 IDs and saves the results to results/celeba-id<ID>.
run_scripts/neurips2021-celeba-stylegan-flow.sh
  • generate and aggregate the attack samples by running the command below. The results will be saved to results/images_pt/stylegan-attack-with-labels-id0-100.pt.
python generate_vmi_attack_samples.py
  • evaluate the generated samples by running:
fprefix=results/images_pt/stylegan-attack-with-labels-id0-100

python evaluate_samples.py \
	--name load_samples_pt \
	--samples_pt_prefix $fprefix \
	--eval_what stats \
	--nclass 100

Acknowledgements

Code contain snippets from:
https://github.com/adjidieng/PresGANs
https://github.com/pytorch/examples/tree/master/mnist
https://github.com/wyharveychen/CloserLookFewShot

vmi's People

Contributors

wangkua1 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.