# A Comparative Analysis of the TDCGAN Model for Data Balancing and Intrusion Detection
## 4 Results and Discussion  
### Experimental Results  
To asses data balancing for each dataset after using TDCGAN model, we compared the class distribution before and after data balancing; the results are shown in Table 2.  
After that, TDCGAN is utilized on the testing data for each dataset to evaluate its performance in classification tasks. This crucial step allows us to assess how effectively the model can categorize data instances following the balancing process. After applying the TDCGAN model, we perform thorough evaluations to assess its accuracy, precision, recall, and F1-score metrics. These results provide valuable insights into the effectiveness of the model in handling the testing data, offering a clear understanding of its classification capabilities in real-world scenarios. The results are presented in Table 3. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Dataset** & **Class Distribution before Data Balancing** & **Class Distribution after Data Balancing** \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The class distribution before and after data balancing using the TDCGAN model. To scrutinize the efficacy of data balancing techniques applied to TDCGAN across four distinct datasets, our experimental methodology involves conducting thorough assessments on both the training data prior to and following the data balancing process for each machine learning classifier. By doing so, we can elucidate the impact of data balancing on the classifiers' performance. Additionally, we employ the testing data to directly compare the performance of each classifier before and after the data balancing procedure. This comprehensive approach enables us to gauge the effectiveness of TDCGAN in improving classification accuracy and the robustness of various classifiers across diverse datasets. The results are presented in the Tables 4-11 below. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Accuracy** & **Precision** & **Recall** & **F1-Score** \\ \hline CIC-IDS2017 & 0.68 & 0.83 & 0.77 & 0.72 \\ \hline CSE-CIC-IDS2018 & 0.61 & 0.79 & 0.78 & 0.80 \\ \hline KDD-cup 99 & 0.70 & 0.82 & 0.75 & 0.82 \\ \hline BOT-IOT & 0.81 & 0.87 & 0.88 & 0.90 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: The performance metrics for random forest before data balancing. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Accuracy** & **Precision** & **Recall** & **F1-Score** \\ \hline CIC-IDS2017 & 0.96 & 0.97 & 0.99 & 0.98 \\ \hline CSE-CIC-IDS2018 & 0.95 & 0.95 & 0.97 & 0.98 \\ \hline KDD-cup 99 & 0.95 & 0.96 & 0.95 & 0.96 \\ \hline BOT-IOT & 0.96 & 0.95 & 0.95 & 0.96 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The performance metrics for the TDCGAN model on testing data after data balancing. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dataset** & **Accuracy** & **Precision** & **Recall** & **F1-Score** \\ \hline CIC-IDS2017 & 0.70 & 0.92 & 0.86 & 0.89 \\ \hline CSE-CIC-IDS2018 & 0.69 & 0.89 & 0.82 & 0.86 \\ \hline KDD-cup 99 & 0.75 & 0.85 & 0.63 & 0.73 \\ \hline BOT-IOT & 0.72 & 0.83 & 0.79 & 0.80 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The performance metrics for decision tree before data balancing. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Accuracy** & **Precision** & **Recall** & **F1-Score** \\ \hline CIC-IDS2017 & 0.68 & 0.83 & 0.77 & 0.72 \\ \hline CSE-CIC-IDS2018 & 0.61 & 0.79 & 0.78 & 0.80 \\ \hline KDD-cup 99 & 0.70 & 0.82 & 0.75 & 0.82 \\ \hline BOT-IOT & 0.81 & 0.87 & 0.88 & 0.90 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: The performance metrics for decision tree after data balancing. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Accuracy** & **Precision** & **Recall** & **F1-Score** \\ \hline CIC-IDS2017 & 0.78 & 0.80 & 0.83 & 0.79 \\ \hline CSE-CIC-IDS2018 & 0.82 & 0.84 & 0.86 & 0.87 \\ \hline KDD-cup 99 & 0.88 & 0.90 & 0.89 & 0.89 \\ \hline BOT-IOT & 0.90 & 0.89 & 0.91 & 0.91 \\ \hline \hline \end{tabular}
\end{table}