Skip to content

Leakage-Free GCN Evaluation: Trees Still Beat Graph Models on NIDS

THE ARGUMENT

Once leakage and duplicate flows are removed, message passing over flow graphs buys no measurable accuracy, and tree ensembles stay the stronger detectors on both benchmarks; the graph models' real edge is robustness to feature noise.

On this page

2 F1 points on a benchmark table look like a clear win, but a buyer deciding whether to pay for a graph-neural-network intrusion detector needs to know where those points come from. The usual advice is to read the reported F1 and pick the highest row. Yet many near-ceiling results come from protocols where test flows shape the training graph, duplicates sit on both sides of the split, or a single split is reported. This paper strips those sources of optimism out and then re-measures what the graph actually adds [1].

The default read: a higher graph-model score means a better detector

Network intrusion detection systems classify traffic records, usually aggregated into flows, as benign or as one of several attack types. Most learning-based detectors treat each flow as an independent row of features. Graph neural networks relax that assumption by letting a flow's prediction depend on related flows, either through shared hosts or through feature similarity [1]. Many recent systems report high scores on public benchmarks with such models, and near-ceiling numbers are hard to interpret.

Two documented problems compound the interpretation. CICIDS2017 carries mislabelled flows and flow-construction artefacts, and corrected releases shift the measured accuracy of standard classifiers [1]. On tabular intrusion data, tree-based classifiers were not outperformed by the deep networks evaluated in a recent comparison [1]. Any paper proposing a neural detector therefore needs strong tree baselines, or the reader cannot tell whether the gain comes from the model or from the protocol.

De-duplication alone removes 69% of NF-UNSW-NB15-v2

The study uses two benchmarks: the eight labelled flow files of CICIDS2017 and the NetFlow v2 release of UNSW-NB15, NF-UNSW-NB15-v2, which provides 43 NetFlow features per flow. Cleaning treated infinite values as missing, dropped rows with missing values, and removed exact duplicate rows when both the features and the class matched. That label-aware rule guarantees no flow can sit on both sides of the split.

DatasetRaw flowsAfter label-aware de-duplicationModel inputs
CICIDS20172,830,7432,520,79868
NF-UNSW-NB15-v22,390,275731,81038

The effect is asymmetric. CICIDS2017 fell from 2,830,743 to 2,520,798 flows and kept 69 columns, leaving 68 model inputs once the destination port is excluded. NF-UNSW-NB15-v2 fell from 2,390,275 to 731,810 flows, so de-duplication alone removed 69% of it, and kept 39 columns, or 38 model inputs. Each test partition holds 20% of the flows: 504,160 for CICIDS2017 and 146,362 for NF-UNSW-NB15-v2.

Test flows link only to training flows: an inductive kNN graph

Flows are nodes of a k-nearest-neighbour graph in feature space, with k set to 10 and Euclidean distance. The graph is directed and inductive: during training it contains training flows only, and a validation or test flow is attached to its k nearest training flows at prediction time. No edge joins two query flows and no training flow receives a message from a query flow, so a test prediction depends on its own features and on training data alone.

Each of three seeds draws a new stratified 60/20/20 split, and every preprocessing statistic is fitted on the training partition. The destination port is excluded by default because a port number can act as a shortcut to the label, and an ablation adds it back. The residual network is two layers with 64 hidden units, dropout 0.2, Adam at 0.01 and 200 epochs, trained with a class-weighted cross-entropy.

  • A plain GCN without the residual connection
  • GraphSAGE with mean aggregation
  • A four-head graph attention network
  • A multilayer perceptron that ignores the graph
  • A kNN vote over the same k=10 neighbours
  • XGBoost
  • LightGBM
  • A random forest

All eight share the width, loss, optimiser, epoch budget and model-selection rule of the residual network, and differ only in how neighbours are aggregated. E-GraphSAGE runs separately on a host graph built per partition, so its numbers are reported apart from the kNN-graph models.

Results: a tie with the graph-free MLP, and trees ahead

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). Those numbers are indistinguishable from a multilayer perceptron without the graph and from the other graph networks, including a nearest-neighbour vote over the same neighbours. Message passing itself contributed no measurable accuracy.

Tree ensembles win. XGBoost, LightGBM and the random forest were 1.48 to 1.57 F1 points higher on CICIDS2017 and led on the area under the precision-recall curve on both datasets. The multiclass gap is larger: macro-F1 on CICIDS2017 reached 93.08% for the trees against 64.51% for the residual network.

A per-class diagnosis traces that gap to false alarms on small attack classes. Precision on Bot flows was 3.36% for the residual network against 55.49% for XGBoost, because large numbers of benign flows were assigned to small attack classes, which drags precision down and depresses macro-F1.

Ablations and stress tests: where graph models actually help

The paper varies everything it can: neighbourhood size, depth, the residual connection, the loss (unweighted cross-entropy and a focal loss with gamma 2), normalisation, whether the port feature is included, and transductive graph construction. No ablation changed F1 beyond the variation between seeds, so these design choices are not decisive under this protocol.

Two stress tests locate the value. Under Gaussian feature noise with a standard deviation of 0.5, the residual network kept an F1 of 96.16% while XGBoost fell to 0.67%. In a leave-one-family-out test, withholding an entire DoS family from training, the residual network recovered about half of it.

  • On clean data, trees are stronger
  • Under Gaussian noise, graph models hold up far better
  • On an unseen attack family, graph models recover roughly half

Where this method stops applying

The conclusions do not travel far. They cover two datasets, supervised learning, fixed hyperparameters and one network width; the noise is synthetic Gaussian, not adversarial perturbation or concept drift. Host graphs, self-supervised graph learning and other attack families were not measured under this protocol, so their behaviour remains out of scope.

The defensible claim is narrower: on these two de-duplicated, split-controlled flow benchmarks, message passing over nearest-neighbour flow graphs adds no measurable accuracy over a perceptron, tree ensembles remain the stronger detectors, and the graph advantage is limited to robustness under feature noise. Change the data, the graph construction or the supervision, and the result has to be re-established rather than assumed [1].

References

  1. Leakage-free evaluation of residual graph convolutional networks for network intrusion detection

Sign in to Padda

A code in your inbox. No password to remember.

Connecting to sign-in…