# A Deep-Learning-Based Secure Routing Protocol to Avoid Blackhole Attacks in VANETs +
## 5 Performance Evaluation
### Numerical Results  
In this subsection, we present the simulation results of the proposed DLC and DLSR protocol. First, we exploit the impact of the number of iterations to search for the best fitness value. Then, in our experiment, we create 100.000 datasets, utilizing 90% for training and the remaining 10% for validation. Furthermore, we produce 100 distinct datasets to evaluate the performance of our trained DNN model. The objective is to examine the ability of the DNN model to predict the optimal value provided with an unfamiliar dataset. Table 10 shows the parameters we considered to examine DNN training. Figure 9(a) illustrates the convergence of the fitness function value for clustering, reaching an optimal value within the 8 th iteration using the conventional algorithm. Moreover, as the vehicle speed increases, the fitness value also increases, indicating consistent convergence within the 8 th iteration despite higher speeds. On the other hand, Figure 9(b) displays the convergence of the fitness function value for routing, reaching an optimal value within the 10 th iteration. Furthermore, with the increasing vehicle speed, the fitness value decreases consistently within the 10 th iteration. This proves the ability of the algorithm to handle an increase in speed without affecting its convergence time. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Value** \\ \hline Dataset & 100.000 \\ Epoch & 50 \\ Batch size & 256 \\ Optimizer & Adam \\ Learning rate & 0.00001 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: DNN training parameters. Figure 11 shows the RMSE of the DL framework with different numbers of hidden layers and hidden neurons. In Figure 11a, we analyze the impact of the number of hidden neurons on the DL framework with the different numbers of hidden layers for clustering. As we can see in Figure 11a, the value of RMSE with one hidden layer decreases from 0.5295 to 0.1817; with two hidden layers, it decreases from 0.4756 to 0.0917; and with four hidden layers, it decreases from 0.3220 to 0.08 when the number of hidden neurons increases from 2 to 250, respectively. Figure 11b shows the impact of the number of hidden neurons on the DL framework with the different numbers of hidden layers for blackhole detection. As can be seen in Figure 11b, the value of RMSE with one hidden layer decreases from 0.01124 to 0.00098; with two hidden layers, it decreases from 0.00855 to 0.00074; and with three hidden layers, it decreases from 0.00554 to 0.00039 when the number of hidden neurons increases from 2 to 100, respectively. In Figure 11c, we analyze the impact of the number of hidden neurons on the DL framework with the different numbers of hidden layers for routing. Figure 11c reveals that the RMSE value with one hidden layer decreases from 0.1887 to 0.0361; with two hidden layers, it decreases from 0.1764 to 0.0259; and with three hidden layers, it decreases from 0.1673 to 0.0101 when the number of hidden neurons increases from 2 to 200, respectively. Therefore, from the results shown in Figure 11, we can conclude that the performance of a DNN model improves with an increase in the number of neurons it contains. In addition, a larger number of hidden layers in the DNN model also contributes to better performance, as opposed to models with fewer hidden layers. Figure 12 provides a comparison of the execution times between the conventional methods and the DL method, considering varying quantities of data. The DL method achieves impressively short execution times, even when the quantity of data increases. In contrast, the conventional method requires a significantly longer execution time under the same conditions. As we can see in Figure 12, the conventional method requires 18 s to find the optimal solution dealing with 50 data, while the DL method accomplishes the same task in just one second for the clustering scheme.