# Severity Prediction of Traffic Accidents with Recurrent Neural Networks

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

## 2. Recurrent Neural Networks (RNNs)

## 3. The Proposed Network Framework

#### 3.1. Network Architecture

#### 3.2. Training Methodology

#### 3.3. Mitigating Overfitting

#### 3.4. Hyperparameter Tuning

## 4. Experimental Results and Discussion

#### 4.1. Data

^{2}was calculated for each factor. Second, the Variance Inflation Factor (VIF) was calculated from the multiple R

^{2}for each factor (Table 3). The highest correlation of 0.27 was found between lighting condition factor and surface condition factor. However, the highest multiple R

^{2}and VIF were found to be 0.135 and 1.156 for surface condition factor. There was no multicollinearity found among the factors if VIF = 1.0, however when the value exceeded 1.0, then moderate multicollinearity was found. In both cases, no high correlation was found during the model training and testing phase. Therefore, none of the factors was removed.

#### 4.2. Results of RNN Model Performance

#### 4.3. Sensitivity Analysis of Optimization Algorithm

#### 4.4. Sensitivity Analysis of Learning Rate and RNN Sequence Length

#### 4.5. Network Depth Analysis

#### 4.6. Extraction Factor Contribution in the RNN Model

#### 4.7. Comparative Experiment

^{2}) between the RNN and BLR ranks was 0.72. In contrast, RNN and MLP did not agree on the ranking of the factors and their ranking correlation was the lowest (0.38).

#### 4.8. Computational Complexity of the Model

#### 4.9. Applicability and Limitations of the Proposed Method

## 5. Conclusions

## Author Contributions

## Conflicts of Interest

## References

- Sameen, M.I.; Pradhan, B. Assessment of the effects of expressway geometric design features on the frequency of accident crash rates using high-resolution laser scanning data and gis. Geomat. Nat. Hazards Risk
**2016**, 1–15. [Google Scholar] [CrossRef] - Pei, X.; Wong, S.; Sze, N.-N. A joint-probability approach to crash prediction models. Accid. Anal. Prev.
**2011**, 43, 1160–1166. [Google Scholar] [CrossRef] [PubMed] - Fogue, M.; Garrido, P.; Martinez, F.J.; Cano, J.-C.; Calafate, C.T.; Manzoni, P. A system for automatic notification and severity estimation of automotive accidents. IEEE Trans. Mob. Comput.
**2014**, 13, 948–963. [Google Scholar] [CrossRef] - Pawlus, W.; Reza, H.; Robbersmyr, K.G. Application of viscoelastic hybrid models to vehicle crash simulation. Int. J. Crashworthiness
**2011**, 16, 195–205. [Google Scholar] [CrossRef] - Pawlus, W.; Robbersmyr, K.G.; Karimi, H.R. Mathematical modeling and parameters estimation of a car crash using data-based regressive model approach. Appl. Math. Model.
**2011**, 35, 5091–5107. [Google Scholar] [CrossRef] - Pawlus, W.; Karimi, H.R.; Robbersmyr, K.G. Mathematical modeling of a vehicle crash test based on elasto-plastic unloading scenarios of spring-mass models. Int. J. Adv. Manuf. Technol.
**2011**, 55, 369–378. [Google Scholar] [CrossRef] - Karimi, H.R.; Pawlus, W.; Robbersmyr, K.G. Signal reconstruction, modeling and simulation of a vehicle full-scale crash test based on morlet wavelets. Neurocomputing
**2012**, 93, 88–99. [Google Scholar] [CrossRef] - Abdelwahab, H.; Abdel-Aty, M. Development of artificial neural network models to predict driver injury severity in traffic accidents at signalized intersections. Transp. Res. Rec. J. Transp. Res. Board
**2001**, 1746, 6–13. [Google Scholar] [CrossRef] - Lv, Y.; Duan, Y.; Kang, W.; Li, Z.; Wang, F.-Y. Traffic flow prediction with big data: A deep learning approach. IEEE Trans. Intell. Transp. Syst.
**2015**, 16, 865–873. [Google Scholar] [CrossRef] - Duan, Y.; Lv, Y.; Liu, Y.-L.; Wang, F.-Y. An efficient realization of deep learning for traffic data imputation. Transp. Res. C
**2016**, 72, 168–181. [Google Scholar] [CrossRef] - Alkheder, S.; Taamneh, M.; Taamneh, S. Severity prediction of traffic accident using an artificial neural network. J. Forecast.
**2017**, 36, 100–108. [Google Scholar] [CrossRef] - Yu, R.; Li, Y.; Shahabi, C.; Demiryurek, U.; Liu, Y. Deep learning: A generic approach for extreme condition traffic forecasting. In Proceedings of the 2017 SIAM International Conference on Data Mining (SDM), Houston, TE, USA, 27–29 April 2017. [Google Scholar]
- Delen, D.; Sharda, R.; Bessonov, M. Identifying significant predictors of injury severity in traffic accidents using a series of artificial neural networks. Accid. Anal. Prev.
**2006**, 38, 434–444. [Google Scholar] [CrossRef] [PubMed] - Hashmienejad, S.H.-A.; Hasheminejad, S.M.H. Traffic accident severity prediction using a novel multi-objective genetic algorithm. Int. J. Crashworthiness
**2017**, 1–16. [Google Scholar] [CrossRef] - Zeng, Q.; Huang, H. A stable and optimized neural network model for crash injury severity prediction. Accid. Anal. Prev.
**2014**, 73, 351–358. [Google Scholar] [CrossRef] [PubMed] - Dean, J.; Corrado, G.; Monga, R.; Chen, K.; Devin, M.; Mao, M.; Senior, A.; Tucker, P.; Yang, K.; Le, Q.V. Advances in neural information processing systems. In Large Scale Distributed Deep Networks; Association for Computing Machinery: New York, NY, USA, 2012; pp. 1223–1231. [Google Scholar]
- Collobert, R.; Weston, J. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th International Conference on Machine learning, New York, NY, USA, 5–9 July 2008; pp. 160–167. [Google Scholar]
- Huang, W.; Song, G.; Hong, H.; Xie, K. Deep architecture for traffic flow prediction: Deep belief networks with multitask learning. IEEE Trans. Intell. Transp. Syst.
**2014**, 15, 2191–2201. [Google Scholar] [CrossRef] - Xie, Z.; Yan, J. Detecting traffic accident clusters with network kernel density estimation and local spatial statistics: An integrated approach. J. Transp. Geogr.
**2013**, 31, 64–71. [Google Scholar] [CrossRef] - LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature
**2015**, 521, 436–444. [Google Scholar] [CrossRef] [PubMed] - Sutskever, I.; Martens, J.; Hinton, G.E. Generating text with recurrent neural networks. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), Bellevue, WA, USA, 28 June–2 July 2011; pp. 1017–1024. [Google Scholar]
- Graves, A.; Mohamed, A.-r.; Hinton, G. Speech recognition with deep recurrent neural networks. In Proceedings of the 2013 IEEE International Conference on Acoustics, Speech and Signal Processing, Vancouver, BC, Canada, 26–31 May 2013; pp. 6645–6649. [Google Scholar]
- Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput.
**1997**, 9, 1735–1780. [Google Scholar] [CrossRef] [PubMed] - Donahue, J.; Anne Hendricks, L.; Guadarrama, S.; Rohrbach, M.; Venugopalan, S.; Saenko, K.; Darrell, T. Long-Term Recurrent Convolutional Networks for Visual Recognition and Description. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–15 June 2015; pp. 2625–2634. [Google Scholar]
- Wang, X.; Abdel-Aty, M. Temporal and spatial analyses of rear-end crashes at signalized intersections. Accid. Anal. Prev.
**2006**, 38, 1137–1150. [Google Scholar] [CrossRef] [PubMed] - Krizhevsky, A.; Sutskever, I.; Hinton, G.E. Imagenet classification with deep convolutional neural networks. In Proceedings of the Advances in Neural Information Processing Systems, Lake Tahoe, NV, USA, 3–6 December 2012; pp. 1097–1105. [Google Scholar]
- Srivastava, N.; Hinton, G.E.; Krizhevsky, A.; Sutskever, I.; Salakhutdinov, R. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res.
**2014**, 15, 1929–1958. [Google Scholar] - Hinton, G.; Rumelhart, D.; Williams, R. Learning internal representations by back-propagating errors. In Parallel Distributed Processing: Explorations in the Microstructure of Cognition; MIT Press: London, UK, 1985; Volume 1. [Google Scholar]
- Hinton, G.E.; Srivastava, N.; Krizhevsky, A.; Sutskever, I.; Salakhutdinov, R.R. Improving neural networks by preventing co-adaptation of feature detectors. arXiv
**2012**. [Google Scholar] - Bousquet, O.; Bottou, L. The tradeoffs of large scale learning. In Proceedings of the Advances in Neural Information Processing Systems, Vancouver, BC, Canada; 2008; pp. 161–168. [Google Scholar]
- Pascanu, R.; Mikolov, T.; Bengio, Y. On the difficulty of training recurrent neural networks. In Proceedings of the 30th International Conference on International Conference on Machine Learning, Atalnta, GA, USA, 16–21 June 2013; pp. 1310–1318. [Google Scholar]
- Zur, R.M.; Jiang, Y.; Pesce, L.L.; Drukker, K. Noise injection for training artificial neural networks: A comparison with weight decay and early stopping. Med. Phys.
**2009**, 36, 4810–4818. [Google Scholar] [CrossRef] [PubMed] - Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V. Scikit-learn: Machine learning in python. J. Mach. Learn. Res.
**2011**, 12, 2825–2830. [Google Scholar] - Abadi, M.; Agarwal, A.; Barham, P.; Brevdo, E.; Chen, Z.; Citro, C.; Corrado, G.S.; Davis, A.; Dean, J.; Devin, M. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv
**2016**. [Google Scholar] - Duchi, J.; Hazan, E.; Singer, Y. Adaptive subgradient methods for online learning and stochastic optimization. J. Mach. Learn. Res.
**2011**, 12, 2121–2159. [Google Scholar] - Tieleman, T.; Hinton, G. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA Neural Netw. Mach. Learn.
**2012**, 4, 26–31. [Google Scholar] - Kingma, D.; Ba, J. Adam: A method for stochastic optimization. arXiv
**2014**. [Google Scholar] - Ruder, S. An overview of gradient descent optimization algorithms. arXiv
**2016**. [Google Scholar] - Lek, S.; Belaud, A.; Dimopoulos, I.; Lauga, J.; Moreau, J. Improved estimation, using neural networks, of the food consumption of fish populations. Oceanogr. Lit. Rev.
**1996**, 9, 929. [Google Scholar] [CrossRef] - Lek, S.; Belaud, A.; Dimopoulos, I.; Lauga, J.; Moreau, J. Improved estimation, using neural networks, of the food consumption of fish populations. Mar. Freshw. Res.
**1995**, 46, 1229–1236. [Google Scholar] [CrossRef] - Xu, C.; Wang, W.; Liu, P.; Guo, R.; Li, Z. Using the bayesian updating approach to improve the spatial and temporal transferability of real-time crash risk prediction models. Transp. Res. C
**2014**, 38, 167–176. [Google Scholar] [CrossRef] - El-Basyouny, K.; Sayed, T. Application of generalized link functions in developing accident prediction models. Saf. Sci.
**2010**, 48, 410–416. [Google Scholar] [CrossRef] - Wang, C.; Quddus, M.A.; Ison, S.G. Predicting accident frequency at their severity levels and its application in site ranking using a two-stage mixed multivariate model. Accid. Anal. Prev.
**2011**, 43, 1979–1990. [Google Scholar] [CrossRef] [PubMed]

**Figure 1.**The structure of a memory cell in the Long Short-Term Memory–Recurrent Neural Network (LSTM–RNN).

**Figure 4.**Accuracy performance and loss of the RNN model calculated for 100 epochs; (

**a**) model accuracy; and (

**b**) model loss.

**Figure 5.**The sensitivity of the RNN model for different learning rate and sequence length configurations.

Hyper-Parameter | Best Value | Description |
---|---|---|

Minibatch size | 32 | Number of training cases over which SGD update is computed. |

Loss function | Categorical crossentropy | The objective function or optimization score function is also called as multiclass logloss which is appropriate for categorical targets. |

Optimizer | SGD | Stochastic gradient descent optimizer. |

Learning rate | 0.01 | The learning rate used by SGD optimizer |

Gradient momentum | 0.80 | Gradient momentum used by SGD optimizer. |

Weight decay | 0.9 | Learning rate decay over each update. |

Factor | Property Damage Only | Evident Injury | Disabling Injury | Total |
---|---|---|---|---|

Location | ||||

210–214 | 185 | 172 | 58 | 415 |

215–219 | 234 | 47 | 56 | 337 |

220–225 | 238 | 58 | 82 | 378 |

Road-bound | ||||

South | 453 | 99 | 139 | 691 |

North | 287 | 73 | 79 | 439 |

Accident zone | ||||

Interchange | 14 | 3 | 0 | 17 |

Junction | ||||

Lay-by | 2 | 0 | 1 | 3 |

Main Route | 666 | 155 | 209 | 1030 |

North Bound Entry Ramp | 8 | 2 | 0 | 10 |

North Bound Exit Ramp | 4 | 2 | 0 | 6 |

Rest and Service Area | 21 | 4 | 2 | 27 |

South Bound Entry Ramp | 2 | 0 | 1 | 3 |

South Bound Exit Ramp | 7 | 1 | 3 | 11 |

Toll Plaza | 16 | 5 | 2 | 23 |

Accident reported cause | ||||

Bad Pavement Condition | 0 | 1 | 0 | 1 |

Brake Failure | 6 | 2 | 1 | 9 |

Bump-bump | 37 | 12 | 27 | 76 |

Dangerous Pedestrian Behaviour | 0 | 0 | 1 | 1 |

Drunk | 0 | 0 | 1 | 1 |

Loss of Wheel | 1 | 0 | 2 | 3 |

Lost control | 75 | 18 | 22 | 115 |

Mechanical | 5 | 1 | 0 | 6 |

Mechanical/Electrical Failure | 11 | 0 | 1 | 12 |

Obstacle | 43 | 12 | 6 | 61 |

Other Bad Driving | 15 | 1 | 4 | 20 |

Other Human Factor/Over Load/Over Height | 3 | 0 | 0 | 3 |

Over speeding | 345 | 61 | 91 | 497 |

Parked Vehicle | 4 | 4 | 10 | 18 |

Skidding | 1 | 0 | 0 | 1 |

Sleepy Driver | 134 | 44 | 42 | 220 |

Stray Animal | 13 | 1 | 2 | 16 |

Tire burst | 47 | 15 | 8 | 70 |

Lighting condition | ||||

Dark with Street Light | 47 | 6 | 8 | 61 |

Dark without Street Light | 225 | 74 | 89 | 388 |

Dawn/Dusk | 35 | 9 | 9 | 53 |

Day Light | 433 | 83 | 112 | 628 |

Surface condition | ||||

Dry | 460 | 146 | 190 | 796 |

Wet | 280 | 26 | 28 | 334 |

Collision type | ||||

Angular Collision | 9 | 2 | 0 | 11 |

Broken Windscreen | 2 | 0 | 0 | 2 |

Cross direction | 2 | 0 | 1 | 3 |

Head-on Collision | 0 | 1 | 4 | 5 |

Hitting Animal | 12 | 1 | 2 | 15 |

Hitting Object On Road | 44 | 12 | 7 | 63 |

Others | 20 | 0 | 6 | 26 |

Out of Control | 457 | 92 | 107 | 656 |

Overturned | 33 | 11 | 7 | 51 |

Rear Collision | 137 | 48 | 81 | 266 |

Right Angle Side Collision | 11 | 1 | 1 | 13 |

Side Swipe | 13 | 4 | 2 | 19 |

Accident time | ||||

Day time | 677 | 156 | 203 | 1036 |

Night time | 63 | 16 | 15 | 94 |

Vehicle type | ||||

Car-Bus | 7 | 3 | 6 | 16 |

Car-Car | 499 | 68 | 60 | 627 |

Car-Heavy Car | 51 | 11 | 14 | 76 |

Car-Motorcycle | 4 | 7 | 22 | 33 |

Heavy Car | 131 | 23 | 25 | 179 |

Heavy Car-Bus | 2 | 3 | 3 | 8 |

Heavy Car-Heavy Car | 24 | 9 | 15 | 48 |

Heavy Car-Motorcycle | 0 | 1 | 6 | 7 |

Heavy Car-Taxi | 2 | 0 | 0 | 2 |

Motorcycle | 11 | 42 | 60 | 113 |

Motorcycle-Taxi | 0 | 1 | 1 | 2 |

Motorcycle-Van | 0 | 0 | 2 | 2 |

Taxi | 1 | 0 | 1 | 2 |

Van | 8 | 4 | 3 | 15 |

Factor | Multiple R^{2} | VIF |
---|---|---|

Accident location | 0.062 | 1.066 |

Road bound | 0.012 | 1.012 |

Accident zone | 0.040 | 1.042 |

Accident reported cause | 0.060 | 1.063 |

Lighting condition | 0.095 | 1.105 |

Surface condition | 0.135 | 1.156 |

Collision type | 0.033 | 1.034 |

Accident time | 0.009 | 1.009 |

Vehicle type | 0.090 | 1.099 |

Optimizer | Parameters | Training Accuracy (%) | Validation Accuracy (%) |
---|---|---|---|

SGD | lr = 0.01, momentum = 0.0, decay = 0.0, nesterov = False | 71.79 | 71.77 |

RMSprop | lr = 0.001, rho = 0.9, epsilon = 1 × 10^{−8}, decay = 0.0 | 71.90 | 70.80 |

Adagrad | lr = 0.01, epsilon = 1 × 10^{−8}, decay = 0.0 | 71.35 | 71.24 |

Adadelta | lr = 1.0, rho = 0.95, epsilon = 1 × 10^{−8}, decay = 0.0 | 70.24 | 71.24 |

Adam | lr = 0.001, beta_1 = 0.9, beta_2 = 0.999, epsilon = 1 × 10^{−8}, decay = 0.0 | 73.12 | 71.68 |

Adamax | Lr = 0.002, beta_1 = 0.9, beta_2 = 0.999, epsilon = 1 × 10^{−8}, decay = 0.0 | 70.46 | 71.24 |

Nadam | Lr = 0.002, beta_1 = 0.9, beta_2 = 0.999, epsilon = 1 × 10^{−8}, schedule_decay = 0.004 | 74.67 | 71.68 |

**Table 5.**The training and validation accuracy of the proposed RNN model with a different number of dense layers.

Number of Dense Layers | Training Accuracy (%) | Validation Accuracy (%) |
---|---|---|

2 | 71.79 | 71.77 |

3 | 70.09 | 71.24 |

5 | 67.26 | 70.35 |

8 | 65.27 | 56.37 |

**Table 6.**The training and validation accuracy of the proposed RNN model with a different number of LSTM layers.

Number of LSTM Layers | Training Accuracy (%) | Validation Accuracy (%) |
---|---|---|

1 | 71.79 | 71.77 |

2 | 71.30 | 71.58 |

3 | 67.11 | 65.34 |

Factor | Weight |
---|---|

Accident location | −0.0074 |

Road bound | 0.2899 |

Accident zone | 0.0779 |

Accident reported cause | 0.0469 |

Lighting condition | −0.0892 |

Surface condition | 0.1785 |

Collision type | −0.0603 |

Accident time | 0.3612 |

Vehicle type | −0.0468 |

**Table 8.**Performance comparison of the proposed RNN model with Multilayer Perceptron (MLP) and Bayesian Logistic Regression (BLR) models.

Method | Training Accuracy (%) | Validation Accuracy (%) |
---|---|---|

MLP | 68.90 | 65.48 |

BLR | 70.30 | 58.30 |

RNN | 71.79 | 71.77 |

Factor | MLP | BLR | RNN |
---|---|---|---|

Accident location | 2 | 6 | 6 |

Road bound | 8 | 4 | 2 |

Accident zone | 5 | 3 | 4 |

Accident reported cause | 3 | 5 | 5 |

Lighting condition | 4 | 7 | 9 |

Surface condition | 9 | 1 | 3 |

Collision type | 6 | 8 | 8 |

Accident time | 7 | 2 | 1 |

Vehicle type | 1 | 9 | 7 |

BLR:MLP: R^{2} = 0.51RNN:MLP: R ^{2} = 0.38MLP:BLR: R ^{2} = 0.51RNN:BLR: R ^{2} = 0.72 |

Time (milliseconds per iteration) | RNN Model |
---|---|

Training Time | 150.23 |

Testing Time | 13.17 |

© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Sameen, M.I.; Pradhan, B.
Severity Prediction of Traffic Accidents with Recurrent Neural Networks. *Appl. Sci.* **2017**, *7*, 476.
https://doi.org/10.3390/app7060476

**AMA Style**

Sameen MI, Pradhan B.
Severity Prediction of Traffic Accidents with Recurrent Neural Networks. *Applied Sciences*. 2017; 7(6):476.
https://doi.org/10.3390/app7060476

**Chicago/Turabian Style**

Sameen, Maher Ibrahim, and Biswajeet Pradhan.
2017. "Severity Prediction of Traffic Accidents with Recurrent Neural Networks" *Applied Sciences* 7, no. 6: 476.
https://doi.org/10.3390/app7060476