trhoangdung / RnnVerify

Tool for formal verification of Recurrent Neural Networks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

*** RnnVerify - June 2020 ***

This repository contains the proof-of-concept implementation of the RnnVerify tool, as described in the paper:

Y. Jacoby, C. Barrett and G. Katz. Verifying Recurrent Neural Networks using Invariant Inference

The paper may be found at:

https://arxiv.org/abs/2004.02462

This file contains instructions for compiling RnnVerify and for running the experiments described in the paper, and also some information on the RnnVerify code and the various folders.

We use Marabou as an underline feed-forward verification tool, Marabou's code is included here and was last updated at Nov 2019

Compilation Instructions

The implementation was run and tested on Ubuntu 16.04.

Installing Gurobi: Get Gurobi license (free academic license is available) Install the Gurobi Python Interface

Compiling Marabou:

  mkdir build
  cd build
  cmake ..
  cmake --build .

Get python dependencies (we do recommand using virtualenv):

pip install -r requirements.txt

Note that this will not install gurobipy (since it does not support pip), here is one solution to make gurobipy work in virtualenv

Running the experiments

The experiments files are in rnn_experiment folder and can be devided into two categories:

(i) algorithms_compare - Compression of RnnVerify to the Unrolling method used in RNSVerify.

(ii) self_compare - Using RnnVerify to prove local robustness for Speaker Recognition networks.

This repository contains the code for all described experiments. All experiments are run using simple python scripts, we keep raw results in pickle's (and save them in the 'pickles' folder).

To run the first experiment (comperssion with RNSverify), use: PYTHONPATH=. python3 rnn_experiment/algorithms_compare/experiment.py exp 25

For the second experiment: PYTHONPATH=. python3 rnn_experiment/self_compare/experiment.py exp all 20

Information regarding the RnnVerify code

The main folder of the tool are:

  1. RNN : The added implementation on top of the feed forward verification tool. Contains integration with the Marabou framework (via python API), and the implementation of the suggested algorithms

  2. src - Marabou implementation : Marabou is a Verification tool for Feed Forward Networks For more details see the paper or Marabou repository

  3. models: This folder contains tensorflow-keras trained networks for speaker recognition which were used for the different experiments.

Tests

There are multiple test suites that demonstare a simple query to RnnVerify and demonstare the method on more (random) networks. To run all tests use: PYTHONPATH=. pytest RNN/*

About

Tool for formal verification of Recurrent Neural Networks


Languages

Language:C++ 75.4%Language:Python 21.0%Language:Perl 1.4%Language:CMake 0.7%Language:C 0.7%Language:Jupyter Notebook 0.5%Language:Shell 0.1%Language:HTML 0.1%Language:Makefile 0.0%Language:Batchfile 0.0%