# Machine-Learning-Enabled Intrusion Detection System for Cellular Connected UAV Networks
## 6 Discussion  
In this section, we summarize our experimental results to determine the efficiency of ML algorithms to detect various types of attacks based on selected critical IDS parameters such as accuracy, precision, FNR, and F1 score. We present the following results to analyze the best ML algorithm that can be used for IDS. The analysis of the numerical ML algorithms can be itemized in the following items:  
* The DT reached the maximum value for accuracy rate compared to all other types of ML classifiers, as indicated by the yellow bar shown in Figure 11. It obtains a 99.99% accuracy rate for Botnet, Brute force, DoS, DDoS, and Web attacks. DT has the lowest false negative rate value of 0.001%, as shown in Figure 11. KNN had second highest accuracy rate in detecting different types of attacks, as indicated by the gray bar. The accuracy rate of KNN is slightly less than that of DT classifier. On the other hand, GNB has the worst accuracy in detecting all types of attacks. The GNB algorithm shows the lowest average accuracy rate of 20.19% with the smallest precision value of 0.001. * The precision of DT is pretty good in terms of detecting most of the attack types, as can be seen from Figure 12. However, its precision performance is quite lower than that of other ML algorithms in detecting infiltration attack. The GNB classifier precision is lowest among all other ML classifiers. In detecting the DDoS attack, all the machine learning classifiers perform well and have higher precision rates except the GNB classifier. Figure 11: Accuracy of different ML approaches based on various attack types. Figure 12: Precision of different ML approaches based on various attack types. * The FNR is one of the most important parameters in evaluating the IDS. The lower the FNR, the better it is. In Figure 13, the GNB shows the worst FNR performance in detecting various attacks. The LR and K-means algorithm also performs badly in terms of FNR against various attacks. The K-means performs the worst in detecting DoS attacks, with the highest FNR value of 0.897. Most of the ML algorithms have a higher FNR in the case of infiltration attack; however, K-means performs better than any other ML algorithms, with an FNR value of 0.148. * Similarly, in the case of F1 Score, the higher value of F1 score represents a lower rate of incorrect classified packets; i.e., higher the F1 score, the better it is. F1 is considered the best when its F1 score is 1, whereas the model is a failure when the F1 score is 0. The DT has the highest F1 score value in detecting various types of attacks. KNN also performs well compared to the DT classifier, while LDA performs slightly lower than DT and KNN. However, K-means and GNB has the lowest F1 score value compared to other ML algorithms, as can be seen in Figure 14.  
Thus, the overall performance of DT classifier is better than any other ML classifier for ML based IDS. It shows the maximum percentage for detecting normal packets correctly followed by KNN. There was no considerable difference between KNN and K-means  
Figure 14: F1 Score of different ML approaches based on various attack types. Figure 13: False Negative Rate (FNR) of different ML approaches based on various attack types. classifier based on FNR parameters in case of infiltration, Brute force and web attacks. The K-means and GNB performs worst among all other ML algorithms. We also compared our results with the results of other authors' work on the same benchmark dataset, i.e., CSE CIC-IDS2018. We mainly compared our results based on accuracy obtained using Botnet attacks. Botnet attacks are common attack used by all other authors. All the authors used various ML algorithms to detect specific attack cases. A comparison is given in Table 9. It should be noted that the result for DT is as achieved by the authors in [65], with a 99.99% accuracy rate for the Botnet attack. Moreover, the accuracy rate for KNN is 99.984% in [65], which is same as our result.