A Network Intrusion Detection System Based on VAE-CWGAN and Feature Selection
Shiwen Li, Ruifeng Shi · Information · 2026
In network intrusion detection, class imbalance, the scarcity of minority-class attack samples, high feature dimensionality, and substantial feature redundancy are prevalent issues that limit the detection capability of intrusion detection models. To address these issues, this paper proposes a network traffic anomaly detection method based on a Variational Autoencoder and a Conditional Wasserstein Generative Adversarial Network (VAE-CWGAN). First, a feature selection strategy that combines ANOVA and mutual information is employed to select informative network traffic features, thereby improving the discriminative capability of the input features. Second, a minority-class sample generation model that integrates VAE and CWGAN is constructed. The VAE is used to learn the latent distribution characteristics of minority-class attack samples, while class-conditional constraints and the Wasserstein distance are introduced to generate high-quality synthetic minority-class samples, thereby alleviating class imbalance in the training dataset. Finally, Random Forest (RF), a representative machine learning classifier, is adopted for the classification experiments. Experimental results on the NSL-KDD dataset demonstrate that the proposed method performs well in minority-class attack detection, achieving Precision, Recall, and F1-score values of 95.89%, 75.18%, and 84.28% for the R2L class and 77.08%, 55.22%, and 64.35% for the U2R class, respectively.