Adversarial Robustness Is Not Zero-Day Generalization: A Controlled Evaluation of Flow-Based Intrusion Detectors on Corrected CIC-IDS2017
Organizations: College of Professions and Applied Sciences, Hebron University, Hebron, Palestine
Abstract
Synthetic variants of known attacks, including feature-space adversarial perturbations, are sometimes used as stand-ins for unseen ("zero-day") attacks when evaluating machine-learning network intrusion detection systems (NIDS). We test whether this proxy holds. On the corrected CIC-IDS2017 release we train Random Forest, XGBoost, a 1D-CNN and an FT-Transformer and compare, at a fixed 1% false-positive rate over five seeds, detection under constrained perturbations of known attacks (gradient-based and black-box attacks on 42 attacker-controllable features) with leave-one-attack-family-out (LOAO) detection, where an entire family is absent from training. Detection under the strongest perturbation we tested, with budgets of at most 0.2, stays between 90.9% and 99.7%, yet mean detection of held-out families falls to 76.2% (RF), 40.2% (XGBoost), 25.8% (1D-CNN) and 22.8% (FT-Transformer). Robustness exceeds LOAO detection for every model (gaps of 24 to 72 percentage points, 23 to 66 when robustness is also averaged over families; Holm-adjusted p 0.00096), and the two measures agree at most on a coarse ranking of the models. An exact mixed-integer evasion search confirms the tree ensembles' scores. Benign-only anomaly detectors and a simple multi-class open-set baseline do not close the gap. A temporal split on 5 seeds (3 of the 4 models) leaves the gap in place. On CSE-CIC-IDS2018 the gap recurs for every model (16 to 68 points). On these benchmarks and under this threat model, a robustness score should not be read as a zero-day score, and the two should be reported separately. Code and per-seed results are publicly available.
Figures & tables
| Family | Unique flows | Train | Test |
|---|---|---|---|
| Benign | 1,432,904 | 80,000 (+20,000 val.) | 40,000 |
| DoS | 171,634 | 15,000 | 5,000 |
| DDoS | 95,144 | 15,000 | 5,000 |
| PortScan | 7,695 | 5,386 | 2,309 |
| BruteForce | 6,933 | 4,853 | 2,080 |
| Botnet | 736 | 515 | 221 |
| Model | Detection | FPR | F1 | AUROC |
|---|---|---|---|---|
| RF | 1.0000 0.0000 | 0.0098 0.0013 | 0.987 0.002 | 1.0000 |
| XGBoost | 0.9999 0.0001 | 0.0103 0.0013 | 0.986 0.002 | 1.0000 |
| 1D-CNN | 0.9995 0.0003 | 0.0104 0.0011 | 0.986 0.001 | 0.9999 |
| FT-Transformer | 0.9991 0.0005 | 0.0097 0.0007 | 0.986 0.001 | 0.9999 |
| Model | Split | Known DR | Test FPR | Robustness | LOAO | Gap |
|---|---|---|---|---|---|---|
| RF | random | 1.000 | 0.010 | 0.998 | 0.762 | 23.6 |
| temporal | 0.995 | 0.016 | 0.985 | 0.696 | 28.9 | |
| XGBoost | random | 1.000 | 0.010 | 0.998 | 0.402 | 59.5 |
| temporal | 0.998 | 0.014 | 0.982 | 0.372 | 61.0 | |
| 1D-CNN | random | 0.999 | 0.010 | 0.909 | 0.258 | 65.0 |
| temporal | 0.962 | 0.016 | 0.803 | 0.182 | 62.1 |
| Procedure | RF | XGBoost | 1D-CNN | FT-Transformer | ||
|---|---|---|---|---|---|---|
| Random sign | 0.05 | 14,642 | 1.000 0.000 | 0.999 0.000 | 0.999 0.000 | 0.999 0.000 |
| Random sign | 0.1 | 14,642 | 1.000 0.000 | 0.999 0.000 | 0.999 0.000 | 0.999 0.001 |
| Random sign | 0.2 | 14,642 | 1.000 0.000 | 0.999 0.000 | 0.999 0.001 | 0.997 0.003 |
| Random sign | 0.5 | 14,642 | 1.000 0.000 | 0.999 0.000 | 0.967 0.020 | 0.988 0.013 |
| FGSM (transfer) | 0.05 | 14,642 | 1.000 0.000 | 1.000 0.000 | 0.999 0.000 | 0.999 0.001 |
| FGSM (transfer) | 0.1 | 14,642 | 1.000 0.000 | 0.999 0.000 | 0.999 0.001 | 0.998 0.001 |
| Held-out family | RF | XGBoost | 1D-CNN | FT-Transformer | |
|---|---|---|---|---|---|
| DoS | 5,000 | 0.988 0.007 | 0.979 0.010 | 0.043 0.061 | 0.038 0.023 |
| DDoS | 5,000 | 1.000 0.000 | 1.000 0.000 | 1.000 0.000 | 1.000 0.000 |
| PortScan | 2,309 | 0.481 0.396 | 0.097 0.009 | 0.058 0.027 | 0.069 0.015 |
| BruteForce | 2,080 | 0.573 0.022 | 0.042 0.104 | 0.000 0.000 | 0.023 0.060 |
| Botnet | 221 | 0.940 0.030 | 0.206 0.402 | 0.285 0.482 | 0.176 0.490 |
| WebAttack | 32 | 0.588 0.428 | 0.087 0.043 | 0.163 0.154 | 0.062 0.027 |
| Isolation Forest | Autoencoder | ||||
|---|---|---|---|---|---|
| Family | DR | AUROC | DR | AUROC | |
| DoS | 5,000 | 0.003 | 0.884 | 0.047 | 0.855 |
| DDoS | 5,000 | 0.000 | 0.883 | 0.006 | 0.959 |
| PortScan | 2,309 | 0.610 | 0.973 | 0.179 | 0.974 |
| BruteForce | 2,080 | 0.000 | 0.867 | 0.000 | 0.886 |
| Botnet | 221 | 0.017 | 0.747 | 0.045 | 0.780 |
| RF | XGBoost | |||
|---|---|---|---|---|
| Held-out | Binary | MSP | Binary | MSP |
| DoS | 0.988 | 0.983 | 0.979 | 0.958 |
| DDoS | 1.000 | 1.000 | 1.000 | 1.000 |
| PortScan | 0.481 | 0.271 | 0.097 | 0.131 |
| BruteForce | 0.573 | 0.573 | 0.042 | 0.006 |
| Botnet | 0.940 | 0.910 | 0.206 | 0.899 |
| All six families | Four large families | Flow-weighted | |||||
|---|---|---|---|---|---|---|---|
| Model | Robustness | LOAO | Gap | LOAO | Gap | LOAO | Gap |
| RF | 0.997 | 0.762 | 23.5 | 0.760 | 23.6 | 0.851 | 14.5 |
| XGBoost | 0.997 | 0.402 | 59.5 | 0.530 | 46.7 | 0.700 | 29.6 |
| 1D-CNN | 0.909 | 0.258 | 65.0 | 0.275 | 63.3 | 0.370 | 53.8 |
| FT-Transformer | 0.946 | 0.228 | 71.8 | 0.282 | 66.3 | 0.371 | 57.5 |
| Worst case, | SimBA, | ||||
|---|---|---|---|---|---|
| Model | No repair | Repair | No repair | Repair | Gap (repair) |
| RF | 0.998 | 0.998 | 0.998 | 0.997 ( =0.59) | 0.236 0.078 |
| XGBoost | 0.998 | 0.998 | 0.993 | 0.994 ( =0.19) | 0.595 0.067 |
| 1D-CNN | 0.909 | 0.943 | 0.187 | 0.207 ( =0.23) | 0.685 0.119 |
| FT-Transformer | 0.946 | 0.932 | 0.667 | 0.656 ( =0.56) | 0.704 0.080 |
| Model | Known | Robust. | DoS | DDoS | PortScan | BruteForce | Botnet | WebAttack | LOAO | Gap |
|---|---|---|---|---|---|---|---|---|---|---|
| RF | 1.000 | 0.998 | 0.999 | 1.000 | 0.445 | 1.000 | 1.000 | 0.557 | 0.833 | 16.5 |
| XGBoost | 1.000 | 0.991 | 0.993 | 0.943 | 0.179 | 1.000 | 0.999 | 0.145 | 0.710 | 28.1 |
| 1D-CNN | 0.999 | 0.963 | 0.060 | 0.406 | 0.112 | 0.073 | 0.670 | 0.388 | 0.285 | 67.9 |
Network Intrusion Detection
Network intrusion detection identifies malicious or abnormal network activity to help protect computers, connected devices, and critical infrastructure.
See all 174 papers