GithubHelp home page GithubHelp logo

princeton-sysml / gradattack Goto Github PK

View Code? Open in Web Editor NEW
175.0 175.0 38.0 5.46 MB

GradAttack is a Python library for easy evaluation of privacy risks in public gradients in Federated Learning, as well as corresponding mitigation strategies.

Home Page: https://pypi.org/project/GradAttack/

License: MIT License

Python 100.00%

gradattack's People

Contributors

hazelsuko07 avatar samkg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gradattack's Issues

Pytorch Lightning version 1.3.1 vs 1.5.1

Hi,

The requirements file lists Pytorch-lightning 1.5.1, however pip install Gradattack has pytorch-lightning 1.3.1 which has the deprecated manual backward being used. Can you please confirm which pytorch-lightning version to use?

Also, I've had issues replicating the baseline you achieved for the no defense method, where the reconstructions are very poor (even with a pretrained Resnet18 for 200 epochs, with 93% test accuracy, BN exact, and all the other recommended hyperparameters in your paper). Could I be missing an argument or something else?

Missing GradInversion Additional Information other than Gradient

In the documentation relative to the papers introducing gradient inversion attacks (GradAttack/papers/gradient_inversion.md) the GradInversion paper by Yin et al. lists "Good approximation of private labels" as additional information needed other than gradient.

The table entry is missing that the above paper also requires BatchNorm statistics (Section 3.3) as part of the regularization terms.

some question with this code

I noticed opacus is not supported batchnorm2d,so we should use convert_batchnorm_modules to convert batchnorm2d module to groupnorm. In this way, we can not use batchnorm statistics to conduct grad_attack, so how can solve this question. Thanks for your reply.

Error while running example script

Having issues while testing the example script (side note the slack link is expired)

Versions:
Python 3.8.10
PyTorch 1.8.1+cu102
NumPy 1.21.4

python3 attack_cifar10_gradinversion.py --batch_size 16 --tv 0.05 --bn_reg 0.001 --reconstruct_labels

{'reconstruct_labels': True, 'signed_image': False, 'mini': False, 'large': False, 'BN_exact': False, 'attacker_eval_mode': False, 'defender_eval_mode': False, 'total_variation': 0.05, 'epoch': 0, 'bn_reg': 0.001, 'attack_lr': 0.1}
Global seed set to 1234
[ToTensor(), Normalize(mean=(0.4914, 0.4822, 0.4465), std=(0.2023, 0.1994, 0.201))]
Files already downloaded and verified
Files already downloaded and verified
Loaded data!
Traceback (most recent call last):
File "attack_cifar10_gradinversion.py", line 199, in
pipeline, attack_hparams = setup_attack()
File "attack_cifar10_gradinversion.py", line 77, in setup_attack
model = create_lightning_module(
File "/home/ubuntu/.local/lib/python3.8/site-packages/gradattack/models/init.py", line 493, in create_lightning_module
assert os.path.exists(ckpt), f"Failed to load checkpoint {ckpt}"
AssertionError: Failed to load checkpoint checkpoint/vanilla_epoch=1-step=1531.ckpt

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.