Code Monkey home page Code Monkey logo

VeriStable: Harnessing Neuron Stability to Improve DNN Verification

Content

  • src/: source code

  • benchmark/: benchmarks for experiment

  • results/: experimental results

  • env.yaml: required packages

Installation

Dependencies

Installation

  • Make sure you have Anaconda/Miniconda and Gurobi properly installed.

  • Remove pre-installed environment

conda deactivate 
conda env remove --name veristable
  • Install required packages
conda env create -f env.yaml

Getting Started

Usages

  • Activate conda environment
conda activate veristable
  • Minimal command
python3 main.py --net ONNX_PATH --spec VNNLIB_PATH
  • More options
python3 main.py --net ONNX_PATH --spec VNNLIB_PATH 
               [--beam_candidate BEAM_CANDIDATE] [--stabilize_candidate STABILIZE_CANDIDATE]
               [--timeout TIMEOUT] [--device {cpu,cuda}]
               [--result_file RESULT_FILE] [--export_cex]
               [--disable_restart] [--disable_stabilize]
               [--verbosity {0,1,2}] [--test]

Options

Use -h or --help to see options that can be passed into VeriStable.

  • --net: load pretrained ONNX model from this specified path.
  • --spec: path to VNNLIB specification file.
  • --beam_candidate: DPLL(T) search parallelism factor (n)
  • --stabilize_candidate: stabilization parallelism factor (k)
  • --timeout: timeout in seconds
  • --device: device to use (either cpu or cuda).
  • --verbosity: logging options (0: NOTSET, 1: INFO, 2: DEBUG).
  • --result_file: file to save execution results.
  • --export_cex: enable writing counter-example to result_file.
  • --disable_restart: disable RESTART heuristic.
  • --disable_stabilize: disable STABILIZE.
  • --test: test on small example with special settings.

Examples

  • Unit test
python3 test.py
  • Examples showing VeriStable verifies properties (i.e., UNSAT results):
python3 main.py --net "example/mnistfc-medium-net-554.onnx" --spec "example/test.vnnlib"
# unsat,29.7011
python3 main.py --net "example/cifar10_2_255_simplified.onnx" --spec "example/cifar10_spec_idx_4_eps_0.00784_n1.vnnlib"
# unsat,20.0496
python3 main.py --net "example/ACASXU_run2a_1_1_batch_2000.onnx" --spec "example/prop_6.vnnlib"
# unsat,4.3972
  • Examples showing VeriStable disproves properties (i.e., SAT results):
python3 main.py --net "example/ACASXU_run2a_1_9_batch_2000.onnx" --spec "example/prop_7.vnnlib"
# sat,4.2924
python3 main.py --net "example/mnist-net_256x2.onnx" --spec "example/prop_1_0.05.vnnlib"
# sat,1.4306

veristable's Projects

veristable icon veristable

Harnessing Neuron Stability to Improve DNN Verification

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.