# Severity Prediction of Traffic Accidents with Recurrent Neural Networks
## 4 Experimental Results and Discussion
### Comparative Experiment  
In this experiment, the proposed RNN model was compared with the traditional MLP model and the BLR approach. The advantages of MLP networks over Radial Basis Function (RBF) networks are that MLP networks are compact, less sensitive to including unnecessary inputs, and more effective for modeling data with categorical inputs. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Number of LSTM Layers** & **Training Accuracy (\%)** & **Validation Accuracy (\%)** \\ \hline
1 & 71.79 & 71.77 \\
2 & 71.30 & 71.58 \\
3 & 67.11 & 65.34 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: The training and validation accuracy of the proposed RNN model with a different number of LSTM layers. \begin{table}
\begin{tabular}{c c} \hline \hline
**Factor** & **Weight** \\ \hline 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\) \\ \hline \hline \end{tabular}
\end{table} 
Table 7: The calculated weights of accident related factors. The Grid Search algorithm was used to search the space of MLP network architectures and configurations. The number of units in the hidden layer, activation functions and the learning rate were optimized. The search space of the number of hidden units was 4 to 64 units. Five activation functions were tested such as Gaussian, Identity, Sigmoid, Softmax, and Exponential for the hidden and output layers. In addition, five values of learning rate (0.5, 0.1, 0.05, 0.01, and 0.001) were evaluated. The suboptimal network was then determined according to the best validation accuracy. The suboptimal network is the one that best represents the relationship between the input and output variables. In total, 100 network architectures with different combinations of selected parameters and network configurations were executed, and the validation accuracy on 20% of the data was computed for each created model. Then, the best network was retained. The best network had eight (8) hidden units with identity activation function, a Softmax activation in the output layer, and a learning rate of 0.01. The training and validation performance of the network was 68.90% and 65.48% respectively. On the other hand, the BLR [41] and the computation of Markov chain Monte Carlo (MCMC) simulations were implemented in OpenBUGS software. BUGS modeling language (Bayesian Inference using Gibbs Sampling) is an effective and simplified platform to allow the computation using MCMC algorithms for all sorts of Bayesian models including BLR applied. The simulation of the posterior distribution of beta (\(\beta\)) allowed estimating the mean, standard deviation, and quartiles of the parameters of each explanatory variable. In the simulation stage, two MCMC chains were used to ensure convergence. The initial 100,000 iterations were discarded as burn-ins to achieve convergence and a further 20,000 iterations for each chain were performed and kept to calculate the posterior estimates of interested parameters. In developing the Bayesian model, monitoring convergence is important because it ensures that the posterior distribution was achieved at the beginning of sampling of parameters. Convergence of multiple chains is assessed using the Brooks-Gelman-Rubin (BGR) statistic [42]. A value of less than 1.2 BGR statistic indicates convergence [42]. Convergence is also assessed by visual inspection of the MCMC trace plots for the model parameters and by monitoring the ratios of the Monte Carlo errors with respect to the corresponding standard deviation. The estimates of these ratios should be less than 0.05. In addition, MC error less than 0.05 also indicates that convergence may have been achieved [43]. The results of BLR showed training and validation accuracies of 70.30% and 58.30% respectively.