# A Dense Neural Network Approach for Detecting Clone ID Attacks on the RPL Protocol of the IoT
## 5 Results and Discussion  
This section presents and discusses the experimental results obtained from the Unsupervised pre-training and Supervised classification. To configure the learning steps, the sets \(\{\textit{cloneid\_20n},\textit{cloneid\_50n},\textit{cloneid\_100n}\}\in D\) were split into a training subset \(X_{train}\) built with 80% of random samples from each data set contained in \(D\), a validation set \(X_{val}\) with 20% of random samples from \(X_{train}\), and a test set \(X_{test}\) containing 20% of random samples of each data set in \(D\). In total, three different approaches were proposed for the conjunction of data pre-processing, Unsupervised pre-training, and Supervised classification stages, as detailed in Table 9.  
To evaluate the performance of the proposed models, two metrics were calculated: _Accuracy_ and _F1 score_. The accuracy is an indicator of the total number of correct predictions made by the resulting classification model:  
\[Accuracy=\frac{T_{P}+T_{N}}{T_{P}+T_{N}+F_{P}+F_{N}} \tag{6}\]  
Equation (6) is based on the premise of True Positives (\(T_{P}\)), True Negatives (\(T_{N}\)), False Positives (\(F_{P}\)), and False Negatives (\(F_{N}\)), where:  
* \(T_{P}\) is the number of attacks classified as attacks;  
Figure 11: DNN configuration and hyper-parameters. \begin{table}
\begin{tabular}{c c} \hline \hline
**No. of Model** & **Configuration** \\ \hline
1 & No Autoencoder + DNN \\ \hline
2 & SAE + DNN \\ \hline
3 & AE + DNN \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Ensemble of Autoencoders and DNN architectures. * \(T_{N}\) is the number of normal conversations classified as normal;
* \(F_{P}\) is the number of normal conversations misclassified as attacks; and
* \(F_{N}\) is the number of attacks misclassified as normal conversations. The _F1 score_ is determined as the harmonic mean of precision and recall (i.e., as a compensation between \(F_{P}\) and \(F_{N}\)), thus describing whether the resulting classification model performs as expected:  
\[F1\text{-}score=2\times\frac{Precision\times Recall}{Precision+Recall}, \tag{7}\]  
where _Precision_ is the mathematical baseline between the number of positive predictions and the total number of positive class values predicted (i.e., how precise the positive predictions are):  
\[Precision=\frac{T_{P}}{T_{P}+F_{P}}, \tag{8}\]  
and  
\[Recall=\frac{T_{P}}{T_{P}+F_{N}} \tag{9}\]  
In an independent manner, a test was conducted using \(k\)-fold cross-validation, taking into account the time span since the training procedure started and finished. Tables 10-12 depict, in bold rows, the best _Precision_ and _F1-scores_ values for \(\{\)_cloneid_20n_, _cloneid_50n_, _cloneid_100n_\(\}\in D\) sets, subjected to the proposed models configurations. As the results show, the most effective models were the DNN+SAE configurations for the _cloneid_50n_ and _cloneid_100n_ data sets. Even though the _cloneid_20n_ data set presented the lowest performance metrics, the implementation of SAE and AE Autoencoders were \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**No. of Model** & **Configuration** & **Accuracy** & **F1-Score** & **Total Time** & **Complexity \({}^{*}\) \\ \hline
**1** & **SAE + DNN** & **96.72** & **96.70** & **3:29:44** & \(\Omega(2^{h})\) \\
2 & AE + DNN & 94.41 & 94.43 & 3:13:54 & \(\Omega(2^{h})\) \\
3 & No Autoencoder + DNN & 93.46 & 93.36 & 4:20:30 & \(\Omega(2^{h})\) \\ \hline \hline \end{tabular} \({}^{*}\) Based on the proposition described in [67], where it was explained that the hidden units of deep networks can grow exponentially, where \(h\) is the number of hidden units and \(\Omega\) specifies that the algorithm will at least take a certain amount of time to produce and operate, without exceeding a certain period of time.  
\end{table} 
Table 10: Performance metrics for the _cloneid_20n_ data set.