## 4 Results and Discussion
### Data Generation Performance Testing

Table 5: Count and percentage of each attack from the generated dataset using CTGAN. Most classifiers show an improvement in accuracy from 50 to 70 epochs, with some decline or stabilization later. To compare the results with the related works, in [51], they applied TSTR using the XGBoost classifier on the TON_IoT dataset. The model was evaluated with and without the time difference as a feature. The accuracy reached 0.61 and 0.98, respectively, which matches the accuracy of the RF classifier. In [48], they also trained the model on synthetic samples from UNSW-NB15, KDDTest-21, and KDDTest+ datasets. The highest accuracy for each dataset was 0.67 with respect to the decision tree, 0.57 with respect to LSTM, and 0.77 with respect to LSTM. However, these results were lower than the findings in this paper, which achieved better accuracy after 70 epochs. The TSTR method provides an understanding of the quality and possible usability of the synthetic data that CTGAN has generated. The change in performance among classifiers and epochs shows the importance of model selection and the number of epochs in order to make the most of synthetic data in ML pipelines. ```
1. Input: DR = Concatenating(TON_IoT, MQTT-IoT-IDS2020, Bot-IoT) //TON_IoT, MQTT-IoT-IDS2020 and Bot-IoT is extracted datasets the features of the raw PCAP files
2. Categorization_preprocessing(DR)
3. for e in range (1, 101)
4. if e \(\geq\) 50
5. if e%10 == 0
6. CTGAN_Result = CTGAN(DR, epochs=)
7. Output: DG = CTGAN_Result
8. KS_test(DR, DG), RMSE(DR, DG), MAE(DR, DG), TSTR(DR, DG)
9. Max_KS_test_score = Find_max_KS_test_score(DR, DG)//KS_test_Bestscore is epoch 70
10. DgwithFeat gteFeature_selection(DG(Max_KS_test_score))
11. train(DR, DG(Max_KS_test_score), DgwithFeat)
12. RF_result = test_RF(DR, DG(Max_KS_test_score), DgwithFeat)
13. DecisionTree_result = test_DecisionTree(DR, DG(Max_KS_test_score), DgwithFeat)
14. NaiveBayes_result = test_NativeBayes(DR, DG(Max_KS_test_score), DgwithFeat)
15. MLP_result = test_MLP(DR, DG(Max_KS_test_score), DgwithFeat)
16. Gradient_Boost_result = test_Gradient_Boost(DR, DG(Max_KS_test_score), DgwithFeat)
17. accuracy_result = Find_Minimum_Differences_ML_Accuracy(RF_result, DecisionTree_result, NaiveBayes_result, MLP_result, GradientBoost_result)//The lower the difference, the more representative
18. avg_Time = avg(RF_time, Decision_time, naive_Time, MLP_Time, Gradient_Time)//Average of train and test time
19. compare(ML[DG(Max_KS_test_score), DgwithFeat], avg_Time)//Comparison of average learning and testing times between DG and DGwithFeat
20. ```  
**Algorithm 1** The proposed dataset generation and validation methodology. DR is the real data, and DG is the generated data. Figure 5 provides a comparative visualization of the cumulative sums of both real and generated datasets, as presented by [47]. This shows insights into which features the CTGAN had difficulty replicating accurately. The figure was applied to the generated data using 70 epochs, which performed the best according to the presented performance metrics. The overall figures were fairly aligned, and the generated data followed the same shape and structure as the real data, but some features, like ip.id and tcp.hdr_len, were not seamlessly generated by CTGAN.