# Highway Speed Prediction Using Gated Recurrent Unit Neural Networks
## 4 Results
### Hyperparameter Tuning  
This study used the GRU to predict highway section speed. Time-series data were normalized, and only one GRU layer was used for the model. The GRU layer learned in the form of a 3D array, with batch size, time steps, and features.  
Hyperparameter tuning was performed to obtain results with the highest accuracy. When the batch size is small, the learning time is short, and when the batch size is large, the generalization ability is reduced, and the learning time is extended. Therefore, it was necessary to ascertain the optimal batch size, which we determined with a manual search.  
As shown in Table 1, the batch size of 96, equivalent to the value of one day, was the best in terms of speed and accuracy. This study utilized the mean absolute error (MAE), mean absolute percentage error (MAPE) and mean squared error (MSE) to measure the effectiveness of the different batch sizes.  
Extra features, such as rainfall, car accidents, and traffic volume, were included to predict highway speed. However, it had rained twice in September. The precipitation was less than 20 mL. Similarly, there were two traffic accidents in September. These two factors could not be included due to the small number of cases. Thus we added traffic volume as a factor in addition to speed. The Korea Expressway Corporation shares the traffic volume in the experiment areas. Notably, we can get different traffic volumes for bus lanes and regular lanes. Thus we trained the DTG data and predicted speed for bus lanes and regular lanes differently.  
While building the model, we considered the number of nodes (factors) and layers. In general, there is no absolute rule of thumb on how to choose the number of nodes and layers. Tests based on various configurations and the evaluation of outcomes can lead to the best results. We examined two factors (i.e., speed and volume) and three different layers (i.e., one fully connected layer, two fully connected layers, and two fully connected  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Batch Size**} & \multicolumn{4}{c}{**Loss**} & \multirow{2}{*}{**Time Comparisons (per 1 Epoch)**} \\ \cline{2-2} \cline{4-5}  & **MAE** & & **MAPE** & **MSE** \\ \hline
96 & 4.93 & 5.76 & 45.93 & 1 (baseline) \\
192 & 6.68 & 8.31 & 45.93 & 1.5 times \\
288 & 6.67 & 8.81 & 96.82 & 1.7 times \\
384 & 6.65 & 7.81 & 80.77 & 2.0 times \\
480 & 7.03 & 9.35 & 99.89 & 2.2 times \\
576 & 6.69 & 8.92 & 100.6 & 2.3 times \\
672 & 6.34 & 8.23 & 86.15 & 2.7 times \\
768 & 6.43 & 8.28 & 90.24 & 3.7 times \\
864 & 6.48 & 8.62 & 100.90 & 4.0 times \\ \hline \hline \end{tabular}
\end{table}
Table 1: Batch size comparisons.  
Figure 8: Flow chart of the study.  
layers with 10% dropout). In terms of layers, the ANOVA test revealed no significant effect of model design on MAE levels, \(F=1.027\), \(p=0.36\). Comparing time efficiency, one fully connected layer is twice as fast as other architectures. Therefore, we used one fully connected layer for the GRU architecture.  
With regard to factors, we considered two cases (i.e., speed and speed with traffic volume). The ANOVA test revealed a significant effect of two models on levels of MAE, \(F=8.9\), \(p=0.0035\). Considering one factor, such as speed, outperformed considering two factors. Thus our final model is one fully connected layer with one factor (i.e., speed).  
This study used the RMSProp optimizer during the training process. By training the model with several epochs, we found that the optimal number of epochs was 5, each epoch with 500 steps. The models were trained with these hyperparameters to compare their accuracies.