# A Comparative Analysis of the TDCGAN Model for Data Balancing and Intrusion Detection
## 4 Results and Discussion
### Discussion  
Before data balancing, the decision tree model yielded respectable performance across the datasets, with accuracies ranging from 0.69 to 0.75. However, there were noticeable disparities in performance metrics such as recall and F1-score, particularly for the KDD-cup 99 dataset, where the recall was relatively low at 0.63, indicating that the model struggled to correctly identify instances of the positive class. After data balancing, there is a clear improvement in the performance of the decision tree model across all datasets. The accuracy has generally increased, with significant enhancements in metrics like precision, recall, and F1-score. For instance, in the CIC-IDS2017 dataset, the recall increased from 0.86 to 0.90, indicating that the model became more adept at correctly identifying instances of the positive class. Similar improvements are observed in other datasets as well. The random forest model exhibited varying degrees of performance across the datasets. While it achieved relatively high accuracies, there were notable differences in precision, recall, and F1-score among the datasets. For instance, in the CSE-CIC-IDS2018 dataset, the precision was 0.79, indicating that the model correctly identified only 79% of the positive class instances, which might not be desirable depending on the application. After data balancing, there is a substantial improvement in the performance of the random forest model across all datasets. The accuracy has notably increased, and there are significant enhancements in precision, recall, and F1-score as well. For example, in the CIC-IDS2017 dataset, the recall increased from 0.78 to 0.83, indicating a significant improvement in correctly identifying instances of the positive class. The multilayer perceptron (MLP) model demonstrated strong performance across all datasets, with accuracies ranging from 0.82 to 0.85. Additionally, the model exhibited a good precision, recall, and F1-score values, indicating its ability to accurately classify instances from both classes. For instance, in the CIC-IDS2017 dataset, the model achieved a precision of 0.84, suggesting that 84% of the instances classified as positive were indeed true positives. Likewise, the recall and F1-score values were also high, demonstrating a strong balance between accurately identifying positive instances and reducing false negatives. Even with its already strong performance, data balancing further improved the MLP model's effectiveness. Following data balancing, there was a noticeable enhancement in accuracy, precision, recall, and F1-score across all datasets. For instance, in the CIC-IDS2017 dataset, accuracy rose from 0.82 to 0.92, reflecting a significant boost in the model's capability to correctly classify instances from both classes. Likewise, precision, recall, and F1-score also saw improvements, indicating a more balanced and accurate classification, particularly for the minority class. Lastly, before data balancing, the Naive Bayes model exhibited moderate performance across all datasets, with accuracies ranging from 0.60 to 0.72. While the model achieved  
Figure 6: BOT-IOT. relatively high recall values, indicating its ability to correctly identify instances of the positive class, precision and F1-score values were comparatively lower, suggesting a higher rate of false positives and a suboptimal balance between precision and recall. After data balancing, there is a noticeable improvement in the performance of the Naive Bayes model across all datasets. The accuracy has generally increased, and there are significant enhancements in precision, recall, and F1-score as well. For example, in the CIC-IDS2017 dataset, the accuracy increased from 0.60 to 0.80, indicating a substantial improvement in the model's overall classification performance. Moreover, precision, recall, and F1-score also improved, suggesting a more balanced and accurate classification across both classes.