# Predicting Road Traffic Accidents--Artificial Neural Network Approach
## 2 Methodology
### ANN Models  
In research by [PERSON] [61], several ANN models were developed to forecast road accidents. A few parameters were considered to optimize the anticipation of road accidents by building the optimal predicting model (considering the number of neurons in the hidden layers and the nature of the transfer functions). The relative performance indicators of the deep neural network (DNN), gene expression programming (GEP), and regular negative binomial model (RENB) models suggest that the DNN model delivered the best accuracy compared to GEP and RENB models and arised in the lowest root mean squared error, [PERSON] et al. [62]. According to these references, the ANN model simulation was developed in this study. The structure and outcomes of an artificial neural network heavily rely on the  
Figure 7: The PCA biplot diagram, depicting the relationships among AADT, SL, EI, DI, F, PDO, MS, and TA: (**a**) PC 1 and PC 2, (**b**) PC 1 and PC 3.  
initial assumptions of matrix parameters such as biases and weight coefficients. These parameters are crucial in building and fitting the ANN to experimental data. Furthermore, the performance of the ANN model can also be affected by the number of neurons in the hidden layer. To mitigate this problem, each topology was subjected to 100,000 runs to avoid any random correlation caused by initial assumptions and random weight initialization. By following this approach, the ANN model achieved the highest \(r^{2}\) value during the training cycle when using nine hidden neurons (Figure 8a). The ANN1 model was trained for 100 epochs, and the training results, i.e., train accuracy and error (loss), are presented in Figure 5b. The training accuracy increased with the number of training cycles increment until the 40-50 th epoch, when it reached almost constant value. More than 50 epochs for training would possibly cause high overfitting, and 60 epochs would be enough to achieve high model accuracy without any risk of overfitting (Figure 8b) Similar results were obtained for ANN2 model. The acquired optimal neural network models showed good generalization capabilities for the collected data foresee, and could be used to accurately predict the observed outputs, based on the input parameters. The number of neurons for ANN1 model was: 9 (network MLP 13-9-1) to obtain the highest values of \(r^{2}\) (the \(r^{2}\) values for prediction of output variables were 0.986, 0.988 and 0.977, for training, testing and validation cycles, respectively). On the other hand, the number of neurons for ANN2 model was: \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Cycle** & **Outputs** & **Skew** & **Kurt** & **Mean** & **StDev** & **Var** \\ \hline train & EI & 0.954 & 0.431 & 0.067 & 0.381 & 0.145 \\  & DI & 1.186 & 1.273 & 0.025 & 0.200 & 0.040 \\  & F & 5.889 & 37.494 & 0.042 & 0.333 & 0.111 \\  & PDO & \(-0.161\) & 0.657 & \(-0.107\) & 0.910 & 0.828 \\  & TA & 0.334 & 0.550 & 0.016 & 1.358 & 1.843 \\ \hline test & EI & \(-0.265\) & 0.668 & \(-0.069\) & 0.232 & 0.054 \\  & DI & 0.807 & \(-1.075\) & \(-0.045\) & 0.165 & 0.027 \\  & F & 1.433 & 2.234 & \(-0.008\) & 0.069 & 0.005 \\  & PDO & \(-0.475\) & \(-0.703\) & \(-0.434\) & 0.768 & 0.590 \\  & TA & \(-0.695\) & \(-0.175\) & \(-0.579\) & 0.900 & 0.810 \\ \hline valid & EI & \(-0.208\) & 0.013 & 0.068 & 0.374 & 0.140 \\  & DI & 0.347 & \(-1.252\) & 0.056 & 0.236 & 0.056 \\  & F & 0.583 & \(-1.325\) & \(-0.003\) & 0.090 & 0.008 \\  & PDO & \(0.721\) & 0.992 & 0.721 & 1.912 & 3.658 \\  & TA & \(-0.382\) & 1.396 & 0.838 & 2.228 & 4.965 \\ \hline ANN2 & EI & 0.756 & 0.644 & 0.039 & 0.354 & 0.126 \\  & DI & 0.941 & 0.338 & 0.017 & 0.202 & 0.041 \\  & F & 7.276 & 59.253 & 0.022 & 0.261 & 0.068 \\  & PDO & \(1.198\) & 4.305 & \(-0.004\) & 1.210 & 1.465 \\  & TA & \(0.804\) & 2.374 & 0.063 & 1.554 & 2.414 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: The “goodness of fit” tests for the developed ANN2 model.