GitXplorerGitXplorer
h

PeregriNN

public
0 stars
0 forks
0 issues

Commits

List of commits on branch vnn2022.
Unverified
5116c979c2cbe4461ee9eae3be9c977bc1b055c0

remove some files

hhaithamkhedr committed 2 years ago
Unverified
0f969a8cf7f5450c752f47364a02c53f35b6c4e2

Fixes

hhaithamkhedr committed 2 years ago
Verified
b4f46d4961c83d1c539b093097aeb0d77f59583f

Update simplify_network.py

hhaithamkhedr committed 2 years ago
Verified
1cc562c782bb03a78543f55aaef38e83089f9168

Update simplify_network.py

hhaithamkhedr committed 2 years ago
Verified
fbd718dfb3d86a301098b9d5c1a62282253cac72

Update config.py

hhaithamkhedr committed 2 years ago
Verified
e95001c125f546cba2a6545a9cd254e4de271e56

Update run_instance.sh

hhaithamkhedr committed 2 years ago

README

The README file for this repository.

PeregriNN (CAV 21')

PeregriNN is an efficient model checker that verifies the input/output behaviour of ReLU Neural networks using search and optimization tecnhiques. It uses a unique convex objective to identify the most "problematic" neurons and use them as a heursitic to guide the search aspect. Detailed information about the solver can be found in the paper PEREGRiNN: Penalized-Relaxation Greedy Neural Network Verifier.

This repository contains the version of PeregriNN submitted to VNN 2022 competition. This version supports networks in ONNX format, and accepts specifications in VNNLIB format.

System requirements

PeregriNN is tested on a fresh installation of Ubuntu 20.04.2 LTS. We recommend a single core machine with 32 GB of memory.

Installation

We recommend using conda for installing PeregriNN and we'll provide a step by step guide for the setup of conda environment on a Ubuntu.

Install some packages required for the build.

sudo apt install gcc libgmp3-dev

Install the latest version of Anaconda.

Create a conda environment with all the dependencies by running

conda env create --name envname --file=environment.yml

make sure to replace envname with the environment name you'd like. Make sure the environment was created without errors.

License

PeregriNN relies on Gurobi commercial solver which isn't open source. However, they provide a free academic license. Please request an academic license from here

Test installation

After installing Gurboi license, we can test the installation by running

conda activate envname
python -u peregriNN.py examples/mnistfc/mnist-net_256x2.onnx examples/mnistfc/prop_2_0.03.vnnlib --category mnist_fc

and make sure the program terminates without error, you can check out.txt to see the verification result.

VNN 2022 competition benchmarks

To evaluate PeregriNN on VNN 2022 benchmarks, run git submodule update --init --recursive to pull the benchmark repo vnncomp2022_benchmarks. Extract all the test cases for the benchmarks by running

cd vnncomp2022_benchmarks
./setup.sh

You can run PeregriNN on the benchmarks using run_all_categories.sh and providing the path to PeregriNN's vnn_scripts folder as well as the names of the desired benchmarks. Please check run_all_categories.sh for the arguments list.

Running PeregriNN on a specific instance

To run PeregriNN on a single instance of the supported datasets, run the following command

python -u peregriNN.py $model $spec --category $CATEGORY --result_file $FILE

where the first two positional arguments model and spec are the relative paths to the Neural network ONNX file and the VNNLIB spec file, the optional arguments include --timeout (defaults to 300 seconds) and --category which determines which dataset you are working with (default is mnisft_fc). The --result_file argument specifies the verification result output file (defaults to out.txt). Please check utils/dataset_info.py and utils/config.py to know the supported datasets and to add other datasets.