Giter VIP home page Giter VIP logo

horizontalcas's Introduction

HorizontalCAS

This repository describes how to generate HorizontalCAS score tables and train a neural network representation. HorizontalCAS is a simple, notional collision avoidance system (CAS) that gives horizontal turning advisories to an aircraft to avoid an intruder. This system is inspired by early prototypes of ACAS Xu and neural networks trained to represent the score table, but HorizontalCAS is not related in any way to ACAS. This simple system is inteded to facilitate research towards safety-critical neural networks and their verification in the hopes that lessons learned can be applied to real systems.

This repository supports a paper presented at the Digital Avionics Systems Conference (DASC) in 2019, which can be found here.

If HorizontalCAS is useful for your research, please cite

@inproceedings{julian2019guaranteeing,
  title={Guaranteeing safety for neural network-based aircraft collision avoidance systems},
  author={Julian, Kyle D and Kochenderfer, Mykel J},
  booktitle={Digital Avionics Systems Conference (DASC)},
  year={2019}
}

Saved training data and neural networks

Although this repository contains the source code used to generate the advisory score table and train a neural network representation, saved copies of training data and trained neural networks can be found here:

The remainder of this README describes how the score table is generated in Julia, how neural networks are trained in Python using tensorflow, and how the neural network policies can be visualized using Julia kernel for a Jupyter notebook.

Generate MDP Policy

Required Julia Packages: Printf, POMDPs, POMDPModelTools, LocalFunctionApproximation, GridInterpolations, Distributed, SharedArrays, StaticArrays, HDF5

Tested with Julia v1.1

The policy is generated in parallel via Julia by running julia -p NUM_PROCS SolveMDP.jl in the GenerateTable folder, where NUM_PROCS is the number of processors you want to use. The top of SolveMatrix.jl specifies where the table should be written to as an HDF5 file.

Train Neural Networks

Required Python Packages: numpy, h5py, tensorflow

Tested with Python v3.6

After generating the table, the table needs to be formatted into training data for the neural network. To do this, run python genTrainingData.py in the GenerateNetworks folder. The top of the file specifies the MDP table policy folder and the format for the resulting training data files. Note that the table is split into separate files, one for each previous advisory and tau combinations, which allows separate networks to be trained for each combination.

Next, run python trainHCAS.py PREV_ADV TAU <gpu_ind>, where PREV_ADV is the index of the previous advsiroy you want to train, TAU is the tau value, and gpu_ind is an optional input to specify which GPU to use. If you want to use a CPU instead, use -1 (the default if omitted). Options at the top of the file allow you to specify where the training data is stored and where the .nnet files should be written. There are additional options for the user to specify additional setting for network training.

Visualize the Policies

Required Julia Packages: GridInterpolations, Interact, PGFPlots, Colors, ColorBrewer, HDF5

Tested with Julia v1.1

After generating MDP policies and training neural networks, the policies can be visualized. There is an example Jupyter notebook in the PolicyViz folder that shows how the policies can be interactively visualized.

horizontalcas's People

Contributors

kjulian3 avatar ahmed-irfan avatar nskh avatar

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.