Transformer-based Network Intrusion Detection: A Multi-dataset Analysis
Grijesh Nemiwal, Deepa Rani, Rajeev Kumar · 2025
The present study presents a novel transformerbased method for detecting network intrusions, tackling the difficulties of handling substantial network traffic data and identifying advanced cyberthreats. The proposed architecture employs multi-head attention mechanisms optimized for network traffic analysis, complemented by advanced preprocessing techniques for handling imbalanced classes. The system demonstrates exceptional performance across both KDD Cup and NSL-KDD datasets, achieving superior accuracy with balanced precision and recall metrics across diverse attack categories. Comprehensive evaluation against established baselines, including traditional machine learning approaches and modern deep learning architectures, validates the effectiveness of the proposed methodology. The research advances cybersecurity systems by demonstrating how transformer architectures can process network traffic data efficiently while maintaining high detection accuracy. The results show that the transformer-based architecture achieves 99.8 % accuracy on the KDD Cup 1999 dataset and 99.7 % accuracy on the NSL-KDD dataset, significantly outperforming other models in comparison.