Comments (6)
Hi,
we provide links to download the checkpoints in the README of this repo (here) and the models are available in the folders logit_pairing
and post_avg
.
If you want to run our attack on them, please see the section Running the code.
Hope this will help you!
from square-attack.
@fra31 1. The logits pair method is written in Tensorflow. https://github.com/max-andr/square-attack/blob/master/logit_pairing/models.py#L1
But your square attack is using Pytorch, how to experment this method ?
post_averaging
method only usesPGD
or other white box attack such as FGSM to attack.Because it usesrobust_ml
interface, how to experiment your square attack on this defensive method.
https://github.com/YupingLin171/PostAvgDefense/blob/master/robustml_test_cifar10.py#L54
from square-attack.
For the TF models there's here a wrapper, so that the forward pass is computed in TF but the logits are returned as numpy array. The same happens for PT models, as the main operations of our attack are performed in numpy.
To attack all the defenses and models we provide, you can use directly the available code, e.g. for the Post-averaging models you can use
python attack.py --attack=square_linf --model=pt_post_avg_cifar10 --n_ex=1000 --eps=8.0 --p=0.3 --n_iter=20000
python attack.py --attack=square_linf --model=pt_post_avg_imagenet --n_ex=1000 --eps=8.0 --p=0.3 --n_iter=20000
for CIFAR-10 and ImageNet respectively. In this way the models are restored in the correct format to be used as target models for our attack (for more details see here).
Hope this helps!
from square-attack.
@fra31 I have tested the post-averging method, but it runs too slow. I check the code and I guess the reason is because it uses multiple shifted image as a big batch to feed into CNN. Do you have any suggestion on how to accelerate post-averging method?
from square-attack.
Hi,
The post-averaging method is supposed to be slow since it's a randomized classifier. Which means that in order to evaluate it once, we have to do multiple forward passes with different noise samples.
There is nothing one can do about that. If it helps, you can try to attack the classifier not on the whole test set, but rather select some subset of points (e.g. 100 or 1000).
To really speed it up you can try to use parallelization. The simplest would be to divide the test set on a few batches and run the attack in parallel, and then average the results.
Best,
Maksym
from square-attack.
@max-andr
Which defensive model do you suggest to use?
I am preparing another paper of query-based black-box attack. I want to add a defensive model experiment. Which defensive model can have the fast speed to test? Because CVPR deadline is near, I don't have much time.
from square-attack.
Related Issues (13)
- Where does this paper published on? HOT 4
- L2 targeted attack taking very much query with low success rate HOT 2
- Bugs when running Linf attack on pt_inception HOT 4
- 1.Hi, I would like to know what do you refer to as Rademacher distribution in A.4, and why HOT 2
- Why the value of epsilon in step 4 in Algorithm 2 needs to be multiplied by 2? HOT 3
- Why do you use two windows in L2 norm attack? I don't understand the mass moving (Fig.2) HOT 10
- Why the loss type is margin_loss in untargeted attack, but cross_entropy loss in targeted attack. HOT 2
- Why the perturbation with its value equals the maximum bound of Linf and L2 attack should be used in update? HOT 4
- The Linf version HOT 2
- FileNotFoundError: '/scratch/maksym/imagenet/val_orig' HOT 1
- Results of MNIST and CIFAR10 HOT 2
- Why L2 norm attack samples the same window over one-batch's images? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from square-attack.