With the continuous evolution of the network environment and attack patterns, existing deep learning (DL)-based traffic monitoring systems face challenges in terms of adaptability and computational resource requirements. To address these issues, this article proposes an innovative traffic detection system, DeepFlow-BiViTGAN, which combines generative adversarial network (GAN) and Vision Transformer (ViT) architectures with an improved loss function to enhance detection accuracy and system robustness. The experimental results indicate that DeepFlow-BiViTGAN achieves state-of-the-art (SOTA) detection performance on multiple public datasets when trained with approximately 3%–5% of the total dataset. Its lightweight design enables efficient operation on the resource-constrained Internet of Things (IoT) devices, offering excellent adaptability and scalability. This article provides new insights into the application of DL in traffic monitoring, particularly in the IoT scenarios with limited data, and demonstrates significant advantages.
This study proposes ViTWGAN, a novel and effective intrusion detection model designed to enhance data privacy protection by detecting malicious traffic within network flows. By improving the discriminator’s loss function, our approach reduces blind spots in the discriminator by explicitly reinforcing the learning of hard negative samples, thereby mitigating the forgetting of negative samples in the generative adversarial network. A Vision Transformer is employed as the backbone architecture for both the generator and the discriminator, while the Wasserstein distance is introduced to prevent mode collapse, enabling the generator to produce diverse normal traffic and consequently improving the discriminator’s detection capability. Extensive experiments on the NSL-KDD and CIC-DDoS2019 datasets demonstrate the superior performance of the proposed model, achieving accuracy rates of 96.45% and 99.37%, respectively. These results highlight the effectiveness of ViTWGAN as a high-performance solution for general intrusion detection systems.