Adversarial-Example Agnostic Detection in Network Intrusion Detection Systems
摘要
Machine learning is central to modern network intrusion detection systems (NIDS), but their susceptibility to adversarial examples (AEs) undermines reliability in adversarial settings. Existing detection methods often assume access to adversarial data or knowledge of specific attacks during the training phase. This assumption limits the generalization to abnormally parameterized attacks and novel attacks. In this work, we propose a two-stage detection framework trained solely on benign traffic, avoiding the need to tune the detector using adversarial samples. The first stage applies contrastive learning with protocol-aware data augmentations to obtain semantically consistent representations of benign flows. The second stage models the benign distribution using a multi-centroid Mahalanobis score with shrinkage covariance estimation, so that deviations introduced by previously unseen AEs can be detected. Evaluation on three benchmarks (NSL-KDD, CIC-IDS2017, CIC-IDS2018) and four representative attacks (FGSM, BIM, PGD, CW) across two surrogate models (MLP, DCN) shows that the detector achieves high true-positive rates at low false-positive rates. Runtime analysis shows sub-millisecond inference overhead, indicating that the proposed detector introduces negligible computational overhead. Overall, the results demonstrate that adversarial-example-agnostic detection based on benign-only modeling is a promising direction for improving the adversarial robustness of ML-based NIDS.