# Machine-Learning-Based Darknet Traffic Detection System for IoT Applications
## 4 Results and Discussion  
Based on the information mentioned above and the system architecture diagram, the proposed system has been developed, implemented, and evaluated using a high-performance computing platform (employing the 11 th generation Intel Core i7 for fast processing operations and NVIDIA GeForce 4-GByte GPU for parallel computing operations) and built using MATLAB 2021b along with its accompanying learning and parallel computing tools. This section reports on the achieved investigational results of the DTDS model development using several machine-learning approaches, including several performance indicators. Table 5 contrasts the empirical results of classification accuracy and error rates obtained from modeling the DTDS-IoT using those, as mentioned earlier, six supervised machine-learning systems (BAG-DT, ADA-DT, RUS-DT, O-DT, O-DSC, O-KNN). This stage of experimentation and evaluation (i.e., results of Table 5) is a vital stage to characterize the performance of six machine-learning algorithms on this particular problem (i.e., machine-learning-based Darknet traffic detection systems (DTDS) in IoT networks) and select the optimum model for this specific problem. Figure 7: Confusion matrix with other performance evaluation measures. In addition, Figure 8 contrasts the computational complexity of the employed machine-learning techniques in terms of prediction speed (measured in the number of samples per second) and the inference overhead (measured in microseconds). According to the figure, the most rapidly predictive models are the optimizable decision trees (O-DT) and the bagging decision trees (BAG-DT), scoring a prediction speed of \(2.2\times 10^{5}\) and \(1.1\times 10^{5}\) samples per second and the lowest inferencing overhead of \(4.55\upmu\) s and \(9.09\upmu\) s, respectively. Conversely, the slowest predictive models are the optimizable k-nearest neighbor (O-kNN) and the optimizable discriminant (O-DSC), scoring a prediction speed of \(0.7\times 10^{5}\) and \(0.1\times 10^{5}\) samples per second and the lowest inferencing overhead of \(14.28\upmu\) s and \(100\upmu\) s, respectively. According to the classification accuracy proportions stated in Table 5 and the computational complexity in Figure 8, the DTDS-based bagging decision tree ensembles (BAG-DT) classifier outperforms other ML classifiers employed to develop the DTDS. Consequently, we emphasize our forthcoming analysis and discussion of the additional results obtained for the DTDS model via BAG-DT. We are also inclined to mention that BAG-DT could perform the two-class classification (normal vs. Darknet) with 100% accuracy. Since DTDS-BAG-DT is selected as the optimum model, we have traced its iterative learning process trajectory using the minimum classification error. Figure 9 shows the performance analysis curve for the BAG-DT-based DTDS system. The minimum classification error as a cost function has been inspected for the BAG-DT classifier to follow the classifier state throughput 30 iterations of the learning process. This was conducted by tracing the minimum classification error (observed vs. estimated), targeting the best point for model hyperparameters. Subsequently, according to the figure, it can be seen that the best validation performance for the DTDS-BAG-DT system is achieved after iteration number 13 with minimum classification error values less than 0.005. The classification process remained saturated and stable for the rest of the iterations, recording no abnormality in the error analysis curves. Hence, the developed DTDS-BAG-DT system achieved a near-perfect performance, scoring an error rate approaching 0 (i.e., zero error performance stands for perfect models, while near-perfect models record error rates \(\leq\)0.01). To gain more insight into the system development of the BAG-DT-based DTDS system and the solution approach, we have also investigated the overall four-class confusion matrix analysis for the DTDS-BAG-DT system, correlating the true classes vs. predicted classes, in Figure 10a.