https://github.com/causallearning/hsja
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.0%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: CausalLearning
- Language: Python
- Default Branch: master
- Size: 4.01 MB
Statistics
- Stars: 111
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
HopSkipJumpAttack
(previously named as Boundary Attack++) Code for HopSkipJumpAttack: A Query-Efficient Decision-Based Adversarial Attack by Jianbo Chen, Michael I. Jordan, Martin J. Wainwright.
Clarification
If you are using the code to compare HSJA with other algorithms, you will need to set your own counter for the number of model evaluations. "maxnumevals" in hsja.py is the maximum number of evaluations for estimating gradient (for each iteration), not the total number of model evaluations. To increase the total number of model evaluations, set a larger num_iterations.
Dependencies
The code for HopSkipJumpAttack runs with Python and requires Tensorflow of version 1.2.1 or higher. Please pip install the following packages:
- numpy
- tensorflow
- keras
- scipy
Running in Docker, MacOS or Ubuntu
We provide as an example the source code to run HopSkipJumpAttack on a ResNet trained on CIFAR-10. Run the following commands in shell:
```shell
Omit if already git cloned.
git clone https://github.com/Jianbo-Lab/HSJA cd HSJA
#########################################
Carry out L2 based untargeted attack on 5 samples.
python main.py --constraint l2 --attacktype untargeted --numsamples 5
Carry out L2 based targeted attack on 5 samples.
python main.py --constraint l2 --attacktype targeted --numsamples 5
Carry out Linf based untargeted attack on 5 samples.
python main.py --constraint linf --attacktype untargeted --numsamples 5
Carry out Linf based targeted attack on 5 samples.
python main.py --constraint linf --attacktype targeted --numsamples 5
Results are stored in cifar10resnet/figs/.
For each image, the left-hand side is the original example and
the right-hand side is its perturbed version.
```
See main.py and hsja.py for details.
Citation
If you use this code for your research, please cite our paper:
@article{chen2019boundary,
title={HopSkipJumpAttack: A Query-Efficient Decision-Based Adversarial Attack},
author={Chen, Jianbo and Jordan, Michael I. and Wainwright, Martin J.},
journal={arXiv preprint arXiv:1904.02144},
year={2019}
}
Owner
- Name: CausalLearning
- Login: CausalLearning
- Kind: organization
- Repositories: 1
- Profile: https://github.com/CausalLearning
GitHub Events
Total
- Watch event: 66
Last Year
- Watch event: 66