This repository contains the paper and the code of "Scene Flow Specifications: Encoding and Monitoring Rich Temporal Safety Properties of Autonomous Systems". The code is written in Python and requires conda and 7z to be installed. The code was tested using Ubuntu 20.04.
Below are three example violations from the HazardAtSideLaneTwoWays scenarios that were automatically identified by the technique.
The vehicle crosses into the opposing lane to pass the bikes in its lane. This is allowed as the opposing lane is free. However, the vehicle remains in the opposing lane too long after passing the bikes, coming too close to a vehicle approaching in the opposing lane. This is a violation as the opposing lane was not clear for the duration of the maneuver.
While the three-foot distance cited in the driving code is observed here, it is only barely met. These violations were identified by increasing the required safety buffer.
This has been tested on a Ubuntu 20.04.
To install everything needed to run the code, execute the following command:
./unpack_data.shThe installation script will do the following:
- Unpack the included study data from
study_data.7zandstudy_timing_data.sh - Create the conda environments as needed.
- Install mona using the
install_mona.shscript
To reproduce the results of the paper, execute the following command:
source run.shThis will run for ~6 hours. If you are running on a machine with at least 10 cores, you can substantially reduce this time by using the multithreaded version below.
source run_threaded.shThis script will do the following:
- Activate the conda environments as needed.
- Unpack the scene graphs used in the experiment for RQ2 and RQ3.
- Check the properties specified in the paper, located in the
symbolic_properties.pyfile, using the scene graphs and the monitor instantiation. The violations will appear in./results/ - Generate tables that show the property violations for each RQ.
The times taken to evaluate each from of the SG as described in RQ4 are stored in ./study_timing_data/.
To reproduce Fig. 7, and the equivalent version including monitoring for all vehicles, run:
conda activate tcp_env
python3 time_parser.pyThis will create:
frame_time_hist_ego_only.pdf(Fig. 7)frame_time_hist_all.pdf(Equivalent to Fig. 7, but with comparing properties checking all vehicles and only ego)
Both of these files have been included in the repo.


