Generative Active Adaptation for Drifting and Imbalanced Network Intrusion Detection

Ragini Gupta, Shinan Liu, Ruixiao Zhang, Xinyue Hu, Pranav Kommaraju, Xiaoyang Wang, Hadjer Benkraouda, Nick Feamster, Klara NahrstedtarXiv 2025

Abstract

Machine learning has shown promise in network intrusion detection systems (NIDS), yet its performance often degrades due to concept drift and imbalanced data. These challenges are compounded by the labor-intensive process of labeling network traffic, especially when dealing with evolving and rare attack types. To address these issues, we propose NetGuard, a generative active adaptation framework that minimizes labeling effort while enhancing model robustness. Our approach employs density-aware dataset prior selection to identify the most informative samples for annotation and leverages deep generative models to conditionally synthesize diverse samples, augmenting the training set and mitigating the effects of concept drift. We evaluate NetGuard on both simulated IDS data and a real-world ISP dataset, demonstrating significant improvements. Our method boosts the overall F1-score from 0.60 to 0.86, with dramatic improvements in rare attack detection (e.g., FTP-BruteForce improving from 0.00 to 0.71) while requiring only 1% of new data to be manually labeled.

The Challenge: Concept Drift and Class Imbalance

Most machine learning-based NIDS are trained on static datasets, but real-world network traffic is dynamic. This leads to two major hurdles:

  1. Concept Drift: As software updates and attacker tactics evolve, the statistical distribution of traffic changes. A model accurate at deployment may see its performance plummet as the environment shifts.
  2. Class Imbalance: Benign traffic typically accounts for over 99.9% of network data. Standard models often become biased toward this majority class, failing to detect rare but critical "zero-day" or evolving attacks.

Traditional "Active Learning" methods, which ask humans to label uncertain samples, often fail in NIDS because drifting benign traffic creates high uncertainty, wasting the labeling budget on non-malicious noise.

The NetGuard Framework

NetGuard is a closed-loop framework designed to adapt to new environments efficiently. It consists of two primary modules:

Density-Aware Dataset Prior Selection

Instead of selecting samples based solely on model uncertainty, NetGuard uses Gaussian Mixture Models (GMMs) to compare historical training data with new, unlabeled traffic. It identifies "priors"—samples that represent the new distribution but reside in low-density areas of the original feature space. This ensures that human experts label the most informative samples that represent actual drift rather than just noise.

t-SNE visualization of multi-class network traffic and decision boundaries for various attack types.

Diversity-Aware Generative Augmentation

Once informative samples are labeled, NetGuard employs deep generative models—such as TVAE (Tabular Variational Autoencoder) or RealTabFormer (a Transformer-based model)—to synthesize thousands of diverse, realistic variations of rare attacks. This process "beefs up" the training set for classes making up less than 5% of the data, forcing the classifier to learn the nuances of rare threats even when real examples are scarce.

Experimental Results

We evaluated NetGuard on the CIC-IDS 2017/2018 benchmarks and the real-world UGR’16 ISP dataset.

  • Detection Performance: On CIC-IDS, NetGuard improved the overall F1-score from 0.60 to 0.86. It successfully "resurrected" detection for rare attacks that previously had near-zero detection rates, such as Infiltration (0.001 to 0.30) and Web Attacks (0.04 to 0.50).
  • Labeling Efficiency: On the UGR'16 dataset, NetGuard achieved an F1-score of 99.29% using only 1% of labeled data, nearly matching the 99.55% achieved by full adaptation requiring 100% labeling.
  • Computational Speed: The GMM-based selection is highly efficient, processing 1,000 samples in approximately 6 milliseconds on a standard CPU.
t-SNE projection showing the clear separation achieved for specific attack types like DDoS HTTP and UDP.

Key Insights

Our research highlights that uncertainty is a trap in drifting network environments; targeted density-aware selection is far more effective. Furthermore, we found that Transformers for Tabular Data (like RealTabFormer) produce higher-quality synthetic data than standard VAEs, particularly for complex attack patterns. Finally, interpretability analysis using the "Trustee" tool confirmed that NetGuard's logic with 1% labels maintains 89% feature commonality with models trained on 100% of the data, proving it identifies the correct security features.

Conclusion

NetGuard effectively enhances rare attack detection while drastically reducing labeling costs. By combining intelligent sample selection with generative data augmentation, it provides a scalable and practical solution for maintaining robust network intrusion detection in a shifting digital landscape.

Summary updated

BibTeX
@misc{gupta2025generative,
  author = {Ragini Gupta and Shinan Liu and Ruixiao Zhang and Xinyue Hu and Pranav Kommaraju and Xiaoyang Wang and Hadjer Benkraouda and Nick Feamster and Klara Nahrstedt},
  title = {{Generative Active Adaptation for Drifting and Imbalanced Network Intrusion Detection}},
  year = {2025},
  eprint = {2503.03022},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.03022},
}
Figure