# Deep Learning for Predicting Traffic in V2X Networks
## 6 Simulation Results  
This paper investigates how to predict V2X traffic using the DL-based LSTM model. We used the V2X network dataset (see Figure 1) for training the DL algorithm. We studied the prediction process in different situations according to the number of packets/s transmitted--4, 6, 8, 12, and 14 packets/s. We fitted the model to 1000 epochs with a batch size of 32 and an LSTM layer size of 200 hidden neurons. RMSE and MAPE were used to evaluate prediction accuracy. Table 1 displays the V2X traffic forecast accuracy using RMSE and MAPE. \[RMSE=\sqrt{\frac{1}{\mathrm{N}}\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}} \tag{9}\]  
\[MAPE=\frac{1}{\mathrm{N}}\sum_{i=1}^{n}\left|\frac{y_{i}-\hat{y}_{i}}{x_{t}}\right| \tag{10}\]  
Table 2 shows the prediction accuracy of V2X traffic according to the numbers of packets transmitted of 4, 6, 8, 10, 12, and 14 packets per second in terms of RMSE, MAPE, and processing time. According to the above table, the best prediction accuracy was obtained at a transmission rate of 4 packets/s with an RMSE value of 0.5427 and a MAPE value of 9.86%. In this case, the maximum average improvement is 18.47%. With an RMSE value of 0.6321 and a MAPE value of 10.77%, the performance of 6 packets/s is almost identical to that of 4 packets/s. In this case, the maximum average improvement is 17.56%. For 8 packets/s, 10 packets/s, and 12 packets/s, the average improvement is 13.2%, 7.57%, and 6.2%, respectively. However, the models predicted at 14 packets per second have the worst prediction accuracy. On the other hand, the models predicted at 12 packets per second have the fastest processing time, while the model predicted at 14 packets per second has the longest processing time. Figures 3-8 illustrates the predicted throughput with a DL-LSTM model. Depending on the number of packets transmitted in the V2X network, we performed the procedures in different cases. Each figure has two curves, the first of which shows how the predicted traffic changes over time. The relationship between prediction loss and time is depicted by the second curve. As can be seen from Figure 3, in the case of 4 packets transmitted per second, the prediction model that has the best prediction accuracy increases at 1 s, then gradually decreases until 11 s and becomes constant until 16 s, resulting in better accuracy. The second curve shows that the prediction loss is highest at 8 s and lowest at 1 s.  
In Figure 4, using 6 packets transmitted per second, it can be seen that the predicted model increases at 1 s, gradually decreases until 6 s, and then remains constant until 16 s. The predicted model is the same as the predicted model. The second curve shows that the highest prediction loss occurs at 4 s and 8 s and gradually decreases until 15 s, and the lowest prediction loss occurs at 1 s and 6 s.  
In Figure 5, with 8 packets transmitted per second, the prediction model increases at 1 s, then gradually decreases until 5 s, and then remains constant until 15 s. As can be seen in the second curve, in this case, the highest prediction loss occurs at 4 s and the lowest loss occurs at 1 s and 6 s.  
Looking at Figure 6, using 10 packets transmitted per second, in the first curve the prediction model increases at 1 s, decreases to 6 s, remains constant to 8 s, and then increases slightly to 16 s. The prediction loss in the second curve is largest at 4 s and 8 s and gradually decreases until 15 s, and the smallest prediction loss occurs at 1 s and 6 s.  
As can be seen in Figure 7, using 12 packets transmitted per second in the figure, the actual and predicted models increase over time. The predicted model increases at 1 s, decreases until 12 s, and then increases again until 16 s, as shown in the figure. The largest loss occurs between 6 and 10 s and then decreases until 15 s, while the smallest prediction loss occurs at 1 s, 4 s, 7 s, and 15 s.