Here, a tensorflow implementation for Characterizing Driving Styles with Deep Learning is provided.
- Python 2.7
- Tensorflow 1.3.0
- Cuda 8.0.61
A sample data file for 5 drivers, with 5 trajectories for each, is shared in 'data' folder. The data file has following columns: Driver, ID, Time, Lat, and Lon.
- Statistical Feature Matrix: In order to create the statistical feature matrix as described in the paper, you need to run 'IBM16_FeatureMatrix.py' which creates two files in data folder.
- CNN: In oredr to train and test the CNN-based architecture in the paper, you need to run 'IBM16_CNN.py'. This script trains and saves the best model in 'models' folder, and uses the best model for testing.
- RNN: In oredr to train and test the RNN-based architecture in the paper, you need to run 'IBM16_RNN.py'. This script trains and saves the best model in 'models' folder, and uses the best model for testing.
Our best results for driver classification task based on a real-world, private, and non-anonymized (gps coordinates) dataset of 50 drivers with 200 trajectories for each is as follows (prediction is on segment-level, and not the trip-level):
Model | #Drivers | #Trajectories | Test Accuracy (Segment) | Note |
---|---|---|---|---|
CNN | 50 | 200 | 16.4% | Using Momentum Nestrov Optimizer; Momentum=0.9 |
RNN | 50 | 200 | 25.0% | LSTM cells, 2 Layers; Dropout on Second layer (0.6), Batch 256 |
Note that here we used LSTM cells, instead of using RNN cells with identity matrix for recurrent weight initialization, as such thing is not available in Tensorflow currently. However, as noted by Le et al., the identity-matrix initialization of recurrent weights provides comaprable results to LSTM cells.