## 5 Discussion
The high precision score of 99.71% indicates that the Transformer-CNN model effectively identified true positives with very few false positives, while the 99.71% recall score shows that it captured nearly all true positive instances, minimizing false negatives. The F1-score of 99.71% reflects a nearly perfect balance between precision and recall, showcasing the model's overall effectiveness and reliability. On the CICIDS2017 dataset, the Transformer-CNN model demonstrated even greater performance, achieving an accuracy of 99.93%, along with matching precision, recall, and F1-score metrics of 99.93%. In contrast, the standalone auto encoder exhibited lower performance metrics on both datasets, with accuracy, precision, recall, and F1-score around 99.66% on NF-UNSW-NB15-v2 and 99.73% on CICIDS2017. The standalone CNN achieved slightly better metrics of 99.69% on NF-UNSW-NB15-v2 and 99.86% on CICIDS2017. The DNN model had metrics of 99.68% on NF-UNSW-NB15-v2 and 99.88% on CICIDS2017. Ultimately, the Transformer-CNN model stands out due to its robust overall performance on both datasets, reinforcing its suitability for binary classification tasks. Figure 3: Proposed Transformer-CNN versus binary classifiers on NF-UNSW-NB15-v2 dataset. Figure 2: Confusion matrix for binary classification using Transformer-CNN on **(a)** NF-UNSW-NB15-v2 dataset and **(b)** CICIDS2017 dataset. The effectiveness of the Transformer-CNN model in binary classification is further validated by its exemplary performance metrics across different classes on the NF-UNSW-NB15-v2 and CICIDS2017 datasets. For the NF-UNSW-NB15-v2 dataset, the model achieved an overall accuracy of 99.71%, along with precision, recall, and F1-score all at 99.71%. Specifically, for the 'Normal' class, it recorded an accuracy of 99.59%, a perfect precision of 100%, a recall of 99.59%, and an F1-score of 99.79%, showcasing its ability to accurately identify benign traffic. In the 'Attack' class, it achieved a perfect accuracy of 100%, precision of 99.01%, recall of 100%, and an F1-score of 99.50%, underscoring its effectiveness in detecting malicious traffic while minimizing false positives and false negatives. On the CICIDS2017 dataset, the model also demonstrated outstanding results, achieving an overall accuracy of 99.93%, precision of 99.93%, recall of 99.93%, and an F1-score of 99.93%. For the 'Normal' class, it attained an accuracy of 99.89%, precision of 99.98%, recall of 99.89%, and an F1-score of 99.94%, highlighting its precision in identifying benign traffic. For the 'Attack' class, the model achieved an accuracy of 99.97%, precision of 99.86%, recall of 99.97%, and an F1-score of 99.92%, validating its robustness in distinguishing attack traffic with high reliability. The results summarized in Tables 34 and 35 illustrate the Transformer-CNN model's ability to perform consistently across diverse datasets. The detailed performance metrics for individual classes further emphasize the model's precision and reliability, making it well-suited for deployment in real-world intrusion detection systems where the consequences of misclassification can be critical. Figure 4: Proposed Transformer-CNN versus binary classifiers on CICIDS2017 dataset. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Label** & **Accuracy** & **Precision** & **Recall** & **F-Score** \\ \hline Normal & 99.59\% & 100\% & 99.59\% & 99.79\% \\ \hline Attack & 100\% & 99.01\% & 100\% & 99.50\% \\ \hline \hline \end{tabular}
\end{table} 
Table 34: Performance metrics for Transformer-CNN across several classes in binary classification on NF-UNSW-NB15-v2 dataset.