All Projects → mit-acl → nn_robustness_analysis

mit-acl / nn_robustness_analysis

Licence: MIT License
Python tools for analyzing the robustness properties of neural networks (NNs) from MIT ACL

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to nn robustness analysis

Control Toolbox
The Control Toolbox - An Open-Source C++ Library for Robotics, Optimal and Model Predictive Control
Stars: ✭ 562 (+1461.11%)
Mutual labels:  robotics, control-systems
bht-ams-playerstage
Player/Stage SLAM
Stars: ✭ 35 (-2.78%)
Mutual labels:  robotics, control-systems
Qdriverstation
Cross-platform clone of the FRC Driver Station
Stars: ✭ 133 (+269.44%)
Mutual labels:  robotics, control-systems
EL6483 EmbeddedSystems
All course materials, build systems, etc. for the graduate Real-Time Embedded Systems Course, Spring 2017
Stars: ✭ 14 (-61.11%)
Mutual labels:  robotics, control-systems
LibDS
Library for controling FRC robots
Stars: ✭ 29 (-19.44%)
Mutual labels:  robotics, control-systems
TORA.jl
Trajectory Optimization for Robot Arms
Stars: ✭ 27 (-25%)
Mutual labels:  robotics
Director
Director is a facility scale broadcast orchestration and control suite. Not actively maintained
Stars: ✭ 35 (-2.78%)
Mutual labels:  control-systems
MeshCatMechanisms.jl
3D Visualization of mechanisms and URDFs using MeshCat.jl and RigidBodyDynamics.jl
Stars: ✭ 36 (+0%)
Mutual labels:  robotics
ROS-GPS
GPS Localization with ROS, OSM and rviz
Stars: ✭ 19 (-47.22%)
Mutual labels:  robotics
ROS-TCP-Connector
No description or website provided.
Stars: ✭ 123 (+241.67%)
Mutual labels:  robotics
robust-ood-detection
Robust Out-of-distribution Detection in Neural Networks
Stars: ✭ 55 (+52.78%)
Mutual labels:  adversarial-attacks
braccio-ik-unity
Braccio robotic arm simulator with IK (inverse kinematics) and controller via Serial in Unity.
Stars: ✭ 50 (+38.89%)
Mutual labels:  robotics
l2r
Open-source reinforcement learning environment for autonomous racing.
Stars: ✭ 38 (+5.56%)
Mutual labels:  robotics
brax
Massively parallel rigidbody physics simulation on accelerator hardware.
Stars: ✭ 1,208 (+3255.56%)
Mutual labels:  robotics
advrank
Adversarial Ranking Attack and Defense, ECCV, 2020.
Stars: ✭ 19 (-47.22%)
Mutual labels:  adversarial-attacks
MuJoCo RL UR5
A MuJoCo/Gym environment for robot control using Reinforcement Learning. The task of agents in this environment is pixel-wise prediction of grasp success chances.
Stars: ✭ 108 (+200%)
Mutual labels:  robotics
Drona
Drona is a programming framework for building safe robotics systems
Stars: ✭ 26 (-27.78%)
Mutual labels:  robotics
rapcores
Robotic Application Processor
Stars: ✭ 14 (-61.11%)
Mutual labels:  robotics
trajopt
Trajectory optimization algorithms for robotic control.
Stars: ✭ 74 (+105.56%)
Mutual labels:  robotics
ndt localizer
This robot lcoalisation package for lidar-map based localisation using multi-sensor state estimation.
Stars: ✭ 32 (-11.11%)
Mutual labels:  robotics

About

This repository provides Python implementations for the robustness analysis tools in some of our recent papers. This research is supported by Ford Motor Company.

nn_partition

We introduce the concepts of Analyzer, Propagator, and Partitioner in our LCSS/ACC '21 paper and implement several instances of each concept as a starting point. This modular view on NN robustness analysis essentially defines an API that decouples each component. This decoupling enables improvements in either Propagator or Partitioner algorithms to have a wide impact across many analysis/verification problems.

nn_partition

nn_closed_loop

Since NNs are rarely deployed in isolation, we developed a framework for analyzing closed-loop systems that employ NN control policies. The nn_closed_loop codebase follows a similar API as the nn_partition package, leveraging analogous ClosedLoopAnalyzer, ClosedLoopPropagator and ClosedLoopPartitioner concepts. The typical problem statement is: given a known initial state set (and a known dynamics model), compute bounds on the reachable sets for N steps into the future. These bounds provide a safety guarantee for autonomous systems employing NN controllers, as they guarantee that the system will never enter parts of the state space outside of the reachable set bounds.

Reach-LP-Partition Reach-LP w/ Polytopes
nn_partition_polytope nn_partition_polytope

nn_closed_loop


We build on excellent open-source repositories from the neural network analysis community. These repositories are imported as Git submodules or re-implemented in Python here, with some changes to reflect the slightly different problem statements:

Get the code

git clone --recursive <this_repo>

Install

You might need to install these dependencies on Linux (for cvxpy's SCS solver and to generate reasonably sized animation files) (did not need to on OSX):

sudo apt-get install libblas-dev liblapack-dev gifsicle

Create a virtualenv for this repo:

python -m virtualenv venv
source venv/bin/activate

Install the various python packages in this repo:

python -m pip install -e crown_ibp 
python -m pip install -e auto_LiRPA
python -m pip install -e robust_sdp
python -m pip install -e nn_partition
python -m pip install -e nn_closed_loop

You're good to go!

Simple Examples

Try running a simple example where the Analyzer computes bounds on the NN output (given bounds on the NN input):

python -m nn_partition.example \
	--partitioner GreedySimGuided \
	--propagator CROWN_LIRPA \
	--term_type time_budget \
	--term_val 2 \
	--interior_condition lower_bnds \
	--model random_weights \
	--activation relu \
	--show_input --show_output --show_plot

Or, compute reachable sets for a closed-loop system with a pre-trained NN control policy:

python -m nn_closed_loop.example \
	--partitioner None \
	--propagator CROWN \
	--system double_integrator \
	--state_feedback \
	--t_max 5 \
	--show_plot

Or, compute backward reachable sets for a closed-loop system with a pre-trained NN control policy:

python -m nn_closed_loop.example_backward \
	--partitioner None \
	--propagator CROWN \
	--system double_integrator \
	--state_feedback \
	--show_plot --boundaries polytope

Jupyter Notebooks

Please see the jupyter_notebooks folder for an interactive version of the above examples.

Replicate plots from the papers:

If you find this code useful, please consider citing:

For the partitioning-only code (LCSS/ACC '21):

@article{everett2020robustness,
  title={Robustness Analysis of Neural Networks via Efficient Partitioning with Applications in Control Systems},
  author={Everett, Michael and Habibi, Golnaz and How, Jonathan P},
  journal={IEEE Control Systems Letters},
  year={2021},
  publisher={IEEE},
  doi={10.1109/LCSYS.2020.3045323}
}

For the closed-loop system analysis code (ICRA '21):

@inproceedings{Everett21_ICRA,
    Author = {Michael Everett and Golnaz Habibi and Jonathan P. How},
    Booktitle = {IEEE International Conference on Robotics and Automation (ICRA)},
    Title = {Efficient Reachability Analysis for Closed-Loop Systems with Neural Network Controllers},
    Year = {2021},
    Url = {https://arxiv.org/pdf/2101.01815.pdf},
    }

and/or:

@article{Everett21_journal,
    Author = {Michael Everett and Golnaz Habibi and Chuangchuang Sun and Jonathan P. How},
    Title = {Reachability Analysis of Neural Feedback Loops},
    journal={IEEE Access},
    Year = {2021 (accepted)},
    Url = {https://arxiv.org/pdf/2101.01815.pdf},
    }

TODOS:

  • ICRA Fig 3 as single script
  • ICRA Fig 3b make pkl
  • ICRA Fig 3c from pkl
  • get animation working for ICRA

Someday soon...

  • add rtdocs (auto-fill code snippets from test files)
  • LCSS Fig 8
  • Replicate LCSS Table 6b
  • Replicate LCSS Table I
  • ICRA Fig 4a make pkl
  • ICRA Fig 4a from pkl
  • ICRA Fig 4b as single script
  • ICRA Fig 4b load correct model
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].