Leakage-free evaluation of residual graph convolutional networks for network intrusion detection
Organizations: Department of Computer Science, Faculty of Computing and Information Technology, University of Gujrat, 50700, Punjab, Pakistan
Abstract
Graph neural networks are increasingly proposed for network intrusion detection, yet many reported results come from protocols in which test flows shape the graph used for training, duplicated flows sit on both sides of the split, or a single split is reported. This study measures what a residual graph convolutional network gains over simpler models once these sources of optimism are removed. CICIDS2017 and NF-UNSW-NB15-v2 were cleaned with label-aware removal of exact duplicates, removing 69% of NF-UNSW-NB15-v2 flows. Flows were linked in a nearest-neighbour graph built from training flows only, and validation and test flows were attached to their nearest training flows at prediction time. A two-layer residual network was compared with eight models under the same settings, including a nearest-neighbour vote over the same graph, gradient-boosted trees and a random forest, over three seeds that each draw a new split, with ablations, leave-one-family-out and feature-noise tests. On CICIDS2017 the residual network reached a binary F1 of 98.11% (SD 0.18) and on NF-UNSW-NB15-v2 90.57% (0.38), indistinguishable from a multilayer perceptron without the graph and from other graph networks. Tree ensembles were 1.48 to 1.57 F1 points higher on CICIDS2017 and led on the area under the precision-recall curve on both datasets; their CICIDS2017 multiclass macro-F1 reached 93.08% against 64.51%, a gap mainly from benign flows the residual network assigned to small attack classes. No ablation, including transductive graph construction, changed F1 beyond seed variation. Under Gaussian feature noise (SD 0.5), the residual network kept an F1 of 96.16%, while XGBoost fell to 0.67%. Under a leakage-controlled protocol, message passing over flow graphs adds no measurable accuracy over a perceptron, and tree ensembles remain stronger on both; the advantage of graph models lies in robustness to feature noise.
Figures & tables
| Study | Nodes; edges | Model; learning | Edges of test flows | Split | Repeated runs | Datasets |
|---|---|---|---|---|---|---|
| E-GraphSAGE [ 14 ] | hosts; flows | E-GraphSAGE; supervised | – | 70/30 | – | BoT-IoT, ToN-IoT, NF-BoT-IoT, NF-ToN-IoT |
| Anomal-E [ 2 ] | hosts; flows | E-GraphSAGE + DGI; self-supervised | – | – | – | NF-UNSW-NB15-v2, NF-CSE-CIC-IDS2018-v2 |
| E-ResSAGE, E-ResGAT [ 23 ] | endpoints; flows | GraphSAGE, GAT + feature concatenation; supervised | – | 50/20/30 | – | UNSW-NB15, CIC-DarkNet, CSE-CIC-IDS, ToN-IoT |
| TKSGF [ 4 ] | flows; Top- cosine | GraphSAGE (GCN, GAT); supervised | among test flows (graph per partition) | 60/20/20, 70/15/15 | 5 | NF-ToN-IoT, NF-BoT-IoT |
| GraphIDS [ 3 ] | hosts; flows | E-GraphSAGE + masked autoencoder; benign-only | among test flows (graph per partition) | 80/10/10 | several seeds, mean SD | NF-UNSW-NB15, NF-CSE-CIC-IDS2018 (v2, v3) |
| This study | flows; NN, | R-GCN and 8 baselines; supervised | to training flows only | 60/20/20 | 3 seeds, new split each | CICIDS2017, NF-UNSW-NB15-v2 (de-duplicated) |
| Setting | Value |
|---|---|
| Neural models (shared) | |
| Graph | NN of flows, , Euclidean distance, inductive (training flows only) |
| Layers / hidden units | 2 / 64 |
| Normalisation / dropout | batch normalisation; dropout 0.2 |
| Residual (R-GCN only) | for |
| GAT heads / GraphSAGE | 4 heads / mean aggregation |
| Model | F1 | MCC | PR-AUC | FPR | Recall at 0.1% FPR | Recall at 1% FPR |
|---|---|---|---|---|---|---|
| R-GCN | 98.11 0.18 | 0.977 0.002 | 99.86 0.01 | 0.64 0.07 | 97.39 0.14 | 99.52 0.04 |
| GCN | 98.15 0.15 | 0.978 0.002 | 99.86 0.01 | 0.62 0.06 | 97.67 0.18 | 99.53 0.03 |
| GraphSAGE | 98.14 0.17 | 0.978 0.002 | 99.86 0.00 | 0.62 0.09 | 97.40 0.29 | 99.49 0.01 |
| GAT | 98.33 0.26 | 0.980 0.003 | 99.85 0.02 | 0.51 0.17 | 97.29 0.85 | 99.52 0.05 |
| NN vote | 99.27 0.02 | 0.991 0.000 | 99.55 0.01 | 0.15 0.01 | 98.71 0.07 | 99.81 0.01 |
| MLP | 97.92 0.04 | 0.975 0.001 | 99.84 0.01 | 0.71 0.02 | 97.11 0.28 | 99.43 0.04 |
| Model | F1 | MCC | PR-AUC | FPR | Recall at 0.1% FPR | Recall at 1% FPR |
|---|---|---|---|---|---|---|
| R-GCN | 90.57 0.38 | 0.904 0.004 | 95.11 0.14 | 1.22 0.06 | 43.62 1.25 | 97.97 0.35 |
| GCN | 90.82 0.41 | 0.906 0.004 | 95.04 0.22 | 1.19 0.05 | 44.33 0.24 | 98.27 0.21 |
| GraphSAGE | 90.87 0.16 | 0.907 0.002 | 94.82 0.24 | 1.19 0.02 | 42.31 3.19 | 98.27 0.46 |
| GAT | 90.96 0.22 | 0.908 0.002 | 95.01 0.06 | 1.17 0.03 | 43.53 1.39 | 98.17 0.21 |
| NN vote | 92.47 0.14 | 0.920 0.001 | 94.95 0.10 | 0.64 0.02 | 0.00 0.00 | 98.42 0.03 |
| MLP | 90.57 0.50 | 0.904 0.005 | 94.90 0.17 | 1.23 0.07 | 40.79 1.19 | 98.42 0.23 |
| R-GCN minus | F1 | 95% CI | Holm | PR-AUC | 95% CI | Holm |
| CICIDS2017 | ||||||
| GCN | −0.04 | [−0.56, +0.48] | 1.000 | 0.00 | [−0.02, +0.01] | 0.595 |
| GraphSAGE | −0.04 | [−0.77, +0.70] | 1.000 | 0.00 | [−0.02, +0.02] | 1.000 |
| GAT | −0.22 | [−1.13, +0.68] | 1.000 | 0.00 | [−0.02, +0.03] | 1.000 |
| NN vote | −1.16 | [−1.57, −0.75] | 0.033 | +0.31 | [+0.28, +0.34] | 0.004 |
| MLP | +0.19 | [−0.27, +0.65] | 0.887 | +0.01 | [+0.01, +0.02] | 0.061 |
| Model | Macro-F1 | Weighted F1 | Accuracy |
|---|---|---|---|
| R-GCN | 64.51 0.23 | 97.80 0.05 | 96.60 0.04 |
| GCN | 64.65 0.38 | 97.85 0.15 | 96.65 0.21 |
| NN vote | 81.52 1.81 | 99.74 0.01 | 99.74 0.01 |
| MLP | 62.39 0.59 | 96.47 0.71 | 94.65 1.09 |
| XGBoost | 93.08 1.22 | 99.85 0.01 | 99.84 0.01 |
| LightGBM | 81.57 0.75 | 99.66 0.01 | 99.58 0.04 |
| Model | Macro-F1 | Weighted F1 | Accuracy |
|---|---|---|---|
| R-GCN | 44.21 1.07 | 97.04 0.11 | 96.25 0.21 |
| NN vote | 48.72 0.31 | 97.79 0.01 | 97.88 0.01 |
| MLP | 45.85 1.24 | 97.02 0.17 | 96.19 0.33 |
| XGBoost | 55.98 0.88 | 97.90 0.06 | 97.48 0.08 |
| LightGBM | 53.82 1.04 | 97.83 0.05 | 97.39 0.07 |
| Configuration | F1 | PR-AUC | FPR | F1 [95% CI] | Holm |
|---|---|---|---|---|---|
| R-GCN reference (2 layers, residual, ) | 98.11 0.18 | 99.86 0.01 | 0.64 0.07 | – | – |
| 2 layers, no skip (GCN) | 98.15 0.15 | 99.86 0.01 | 0.62 0.06 | +0.04 [−0.48, +0.56] | 1.000 |
| 98.03 0.10 | 99.85 0.01 | 0.67 0.03 | −0.07 [−0.30, +0.16] | 1.000 | |
| 98.06 0.10 | 99.84 0.01 | 0.66 0.04 | −0.04 [−0.27, +0.18] | 1.000 | |
| 98.22 0.35 | 99.82 0.01 | 0.53 0.20 | +0.11 [−0.30, +0.53] | 1.000 | |
| 1 layer | 97.66 0.14 | 99.75 0.02 | 0.75 0.13 | −0.45 [−1.24, +0.34] | 1.000 |
| Held-out family | Flows | R-GCN | NN vote | MLP | XGBoost |
|---|---|---|---|---|---|
| DoS | 38,749 | 49.37 0.67 | 50.36 0.68 | 10.49 8.56 | 3.19 0.07 |
| DDoS | 25,603 | 63.42 0.27 | 63.42 0.27 | 63.16 0.44 | 59.42 5.47 |
| PortScan | 18,139 | 0.24 0.08 | 0.18 0.03 | 0.28 0.10 | 0.39 0.11 |
| BruteForce | 1,830 | 0.24 0.14 | 0.09 0.08 | 0.24 0.17 | 0.26 0.03 |
| Web | 428 | 0.31 0.36 | 1.01 0.36 | 0.31 0.36 | 83.36 1.81 |
| Bot | 389 | 0.00 0.00 | 0.00 0.00 | 0.00 0.00 | 0.00 0.00 |
| Model | ||||
|---|---|---|---|---|
| R-GCN | 98.26 0.24 | 98.21 0.21 | 97.91 0.25 | 96.16 0.29 |
| GCN | 98.12 0.07 | 98.11 0.08 | 97.78 0.05 | 96.04 0.08 |
| NN vote | 99.32 0.03 | 98.71 0.01 | 98.07 0.07 | 95.47 0.05 |
| MLP | 97.94 0.04 | 97.76 0.13 | 93.47 0.78 | 77.70 2.65 |
| XGBoost | 99.69 0.04 | 5.84 2.51 | 1.84 0.96 | 0.67 0.40 |
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