Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 4 committers (25.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.4%) to scientific vocabulary
Keywords
Repository
Deep Neural Network Falsification
Basic Info
- Host: GitHub
- Owner: dlshriver
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://dnnf.readthedocs.io/
- Size: 463 KB
Statistics
- Stars: 7
- Watchers: 2
- Forks: 4
- Open Issues: 3
- Releases: 8
Topics
Metadata Files
README.md
Reducing DNN Properties to Enable Falsification with Adversarial Attacks
This repo accompanies the paper Reducing DNN Properties to Enable Falsification with Adversarial Attacks, and provides a tool for running falsification methods such as adversarial attacks on DNN property specifications specified using the DNNP language of DNNV. For an overview of our paper, check out our video presentation.
Additional documentation can be found on Read the Docs.
Install
We provide instructions for installing DNNF with pip, installing DNNF from source, as well as for building and running a docker image.
Pip Install
DNNF can be installed using pip by running:
bash
$ pip install dnnf
This will install the latest release of DNNF on PyPI.
To install the optional falsification backends, you can replace dnnf in the above command with dnnf[BACKENDS],
where BACKENDS is a comma separated list of the backends you wish to include (i.e., cleverhans or foolbox).
To install the most recent changes from GitHub, run:
bash
$ pip install git+https://github.com/dlshriver/dnnf.git@main
To install the cleverhans or foolbox backends, run the above command with the option --install-option="--extras-require=cleverhans,foolbox" included.
Installation with pip will not install the TensorFuzz falsification backend. Currently this backend is only available through manual installation or the provided docker image.
Source Install
The required dependencies to install DNNF from source are:
- python3
- git
The additional, optional tensorfuzz backend also requires:
- python2.7
- virtualenv
If you do not plan to use tensorfuzz, then these dependencies are not required. Please ensure that the required dependencies are installed prior to running the installation script. For example, on a fresh Ubuntu 20.04 system, the dependencies can be installed using apt as follows:
bash
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt-get update
$ sudo apt-get install git python3.8 # python2.7 virtualenv
To install DNNF in the local directory, download this repo and run the provided installation script, optionally specifying which backends to include during installation:
bash
$ ./install.sh [--include-cleverhans] [--include-foolbox] [--include-tensorfuzz]
To see additional installation options, use the -h option.
We have successfully tested this installation procedure on machines running Ubuntu 20.04 and CentOS 7.
Docker Install
We provide a pre-built docker image containing DNNF, available on Docker Hub. To use this image, run the following:
bash
$ docker pull dlshriver/dnnf
$ docker run --rm -it dlshriver/dnnf
(.venv) dnnf@hostname:~$ dnnf -h
To build a docker image with the latest changes to DNNF, run:
bash
$ docker build . -t dlshriver/dnnf
$ docker run --rm -it dlshriver/dnnf
(.venv) dnnf@hostname:~$ dnnf -h
Execution
DNNF can be run on correctness problems specified using ONNX and DNNP. DNNP is the same property specification language used by the DNNV verifier framework. A description of this specification language can be found in the DNNV documentation.
To execute DNNF, first activate the virtual environment with:
bash
$ . .venv/bin/activate
This is only required if DNNF was installed manually. The virtual environment should open automatically if using the docker image.
The DNNF tool can then be run as follows:
bash
$ dnnf PROPERTY --network NAME PATH
Where PROPERTY is the path to the property specification, NAME is the name of the network used in the property specification (typically N), and PATH is the path to a DNN model in the ONNX format.
To see additional options, run:
bash
$ dnnf -h
To see the currently available falsification backends, use the --long-help option.
Running on the Benchmarks
We provide several DNN verification benchmarks in DNNP and ONNX formats in dlshriver/dnnv-benchmarks. This benchmark repository includes both the DNNF-GHPR and the DNNF-CIFAR-EQ benchmarks introduced by DNNF!
To execute DNNF on a problem in one of the benchmarks,
first navigate to the desired benchmark directory in benchmarks (e.g., DNNF-GHPR, DNNF-GHPR).
Then run DNNF as specified above.
For example, to run DNNF with the Projected Gradient Descent adversarial attack from cleverhans on an DNNF-GHPR property and network,
run:
bash
$ cd benchmarks/DNNF-GHPR
$ dnnf properties/dronet_property_0.py --network N onnx/dronet.onnx --backend cleverhans.projected_gradient_descent
Which will produce output similar to:
```bash Falsifying: Forall(x, (((0 <= x) & (x <= 1) & (N(slice(2, -3, None), 1) <= -2.1972245773362196)) ==> ((-0.08726646259971647 <= N(slice(2, -1, None), 0)) & (N(slice(2, -1, None), 0) <= 0.08726646259971647))))
dnnf result: sat falsification time: 0.6901 total time: 2.3260 ```
The available backends for falsification are:
-
cleverhans.carlini_wagner_l2cleverhans.fast_gradient_methodcleverhans.hop_skip_jump_attackcleverhans.projected_gradient_descentcleverhans.spsa
-
foolbox.ATTACKwhereATTACKis the name of an adversarial attack from this list
-
tensorfuzz
Attack specific parameters can be set using the --set BACKEND NAME VALUE option.
For example, to set the nb_iter parameter of the cleverhans.projected_gradient_descent attack to 40 steps,
you can specify --set cleverhans.projected_gradient_descent nb_iter 40.
If a property uses parameters, then the parameter value can be set using --prop.PARAMETER=VALUE,
e.g., --prop.epsilon=1, similar to DNNV.
Acknowledgements
This material is based in part upon work supported by the National Science Foundation under grant number 1900676 and 2019239.
Owner
- Name: David Shriver
- Login: dlshriver
- Kind: user
- Location: Pittsburgh, PA
- Website: dlshriver.com
- Repositories: 6
- Profile: https://github.com/dlshriver
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Shriver"
given-names: "David"
orcid: "https://orcid.org/0000-0003-0208-6517"
website: "https://davidshriver.me"
title: "DNNF"
version: 0.1.5
date-released: 2022-03-24
url: "https://github.com/dlshriver/DNNF"
preferred-citation:
type: conference-paper
authors:
- family-names: "Shriver"
given-names: "David"
orcid: "https://orcid.org/0000-0003-0208-6517"
website: "https://davidshriver.me"
- family-names: "Elbaum"
given-names: "Sebastian"
orcid: "https://orcid.org/0000-0001-9592-1352"
- family-names: "Dwyer"
given-names: "Matthew"
orcid: "https://orcid.org/0000-0002-1937-1544"
doi: "10.1109/ICSE43902.2021.00036"
title: "Reducing DNN Properties to Enable Falsification with Adversarial Attacks"
conference:
name: "International Conference on Software Engineering"
collection-title: "43rd IEEE/ACM International Conference on Software Engineering, ICSE 2021, Madrid, Spain, 22-30 May 2021"
publisher: "IEEE"
start: 275 # First page number
end: 287 # Last page number
month: 5
year: 2021
GitHub Events
Total
Last Year
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 122
- Total Committers: 4
- Avg Commits per committer: 30.5
- Development Distribution Score (DDS): 0.352
Top Committers
| Name | Commits | |
|---|---|---|
| David Shriver | d****c@v****u | 79 |
| David Shriver | d****r@o****m | 40 |
| Meriel von Stein | m****n@g****m | 2 |
| snyk-bot | s****t@s****o | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 8
- Total pull requests: 6
- Average time to close issues: 18 days
- Average time to close pull requests: 5 days
- Total issue authors: 3
- Total pull request authors: 4
- Average comments per issue: 3.13
- Average comments per pull request: 0.5
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- mrivera42 (4)
- shenw000 (3)
- swarupmohalik (1)
Pull Request Authors
- MissMeriel (3)
- dlshriver (1)
- Felipetoledo4815 (1)
- snyk-bot (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- furo *
- sphinx *
- black *
- cleverhans *
- coverage *
- dnnv *
- foolbox *
- furo *
- mypy *
- numpy >=1.20,<1.22
- onnx >=1.8,<1.11
- pytest *
- scipy *
- sphinx *
- torch *
- torchvision *