GitXplorerGitXplorer
h

PeregriNN

public
0 stars
0 forks
0 issues

Commits

List of commits on branch vnn2022.
Unverified
779e7eb973cc6715bf0681535b3e250590bb0086

Update README

hhaithamkhedr committed a year ago
Unverified
acc6546ae124e10369b7225ce5f3c1f9c780e769

Remove some optional args

hhaithamkhedr committed a year ago
Unverified
4f28d1c094f0ebf2e81e04ddfa3b7cb34ed78a55

Change env name and remove prefix

hhaithamkhedr committed a year ago
Unverified
b544384237090361ed2784be091cbb4f3376c9e9

Add TLLBench

hhaithamkhedr committed a year ago
Verified
4d315135dd34da5fc25b258fc4d40e1cf5a14ed9

Update config.py

hhaithamkhedr committed 2 years ago
Unverified
29788c9ffea757ae20c6b3303a988b80a052d110

Fixes

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.