AutoGraphAD: A novel approach using Variational Graph Autoencoders for anomalous network flow detection

Georgios Anyfantis, Pere Barlet-Ros · DOI

Abstract

Network Intrusion Detection Systems (NIDS) often struggle with the high cost of data labeling and the computational overhead of multi-stage anomaly detection pipelines. This paper introduces AutoGraphAD, an unsupervised framework utilizing Heterogeneous Variational Graph Autoencoders (VGAEs). By deriving anomaly scores directly from internal reconstruction errors—specifically structural loss, feature loss, and KL divergence—AutoGraphAD eliminates the need for external downstream classifiers. Experimental results on the UNSW-NB15 dataset show that AutoGraphAD achieves over 97% accuracy while delivering training and inference speeds more than 10 times faster than existing state-of-the-art methods.

Introduction

The rapid evolution of cyber threats necessitates robust Network Intrusion Detection Systems. However, supervised models are hindered by the scarcity of accurately labeled datasets and the emergence of "zero-day" exploits. While unsupervised methods like the Anomal-E framework address labeling issues, they often rely on a two-step process: generating high-dimensional embeddings and then applying a separate anomaly detector (e.g., PCA or HBOS). This architecture is computationally expensive and difficult to scale for real-time traffic.

AutoGraphAD addresses these bottlenecks by treating network traffic as a heterogeneous graph and performing anomaly detection natively within the neural network. This approach significantly reduces latency and improves robustness against concept drift.

Methodology: Heterogeneous VGAE and Direct Scoring

AutoGraphAD represents network traffic using two node types: IP nodes and Connection nodes. This heterogeneity allows the model to capture the structural intent of network interactions more effectively than traditional homogeneous graphs.

The framework employs a GraphSAGE Encoder to generate embeddings, chosen for its ability to generalize to unseen nodes in real-time environments. To ensure the model learns deep relational patterns rather than simple data memorization, self-supervised techniques such as "masking" and "edge dropping" are applied during training.

The AutoGraphAD architecture, highlighting the heterogeneous encoding and the three-part loss function used for direct anomaly scoring.

The core innovation of AutoGraphAD is Direct Anomaly Scoring. Instead of passing embeddings to an external classifier, the model calculates an anomaly score based on a weighted combination of three internal metrics:

  1. Structural Loss: Accuracy of graph shape reconstruction.
  2. Feature Loss: Accuracy of node attribute reconstruction.
  3. KL Divergence: The degree to which the latent space conforms to a Gaussian distribution.

By keeping the scoring process within the PyTorch framework, the entire pipeline remains GPU-native, avoiding the CPU-transfer bottlenecks typical of traditional statistical estimators.

Experimental Setup

The model was evaluated using the UNSW-NB15 benchmark dataset. Raw PCAP files were converted into flows using NFStream, resulting in features consistent with NetFlow V9. To test real-world robustness, the researchers introduced varying levels of "contamination" (undetected attacks) into the training data: 0%, 3.36%, and 5.76%.

Key Results and Insights

AutoGraphAD demonstrates that computational efficiency does not require a sacrifice in detection performance.

Efficiency and Speed

One of the most striking results is the reduction in embedding size. AutoGraphAD utilizes embeddings of size 32—an 8x reduction compared to Anomal-E’s 256—without losing accuracy. This efficiency translates directly into speed.

Comparison of training and inference timings, demonstrating AutoGraphAD's significant speed advantage over traditional downstream classifiers.

As shown in the timing analysis, AutoGraphAD achieved training speeds 1.18 orders of magnitude faster and inference speeds 1.03 orders of magnitude faster than the baseline. This makes the system uniquely suited for high-speed, real-time monitoring.

Accuracy and Robustness

In terms of detection, AutoGraphAD reached 97.69% accuracy at 0% contamination. Crucially, the model proved highly resilient to "dirty" training data; even at 5.76% contamination, accuracy remained stable at approximately 97.6%. This stability suggests that the internal reconstruction loss is a high-fidelity signal for anomalies, even when the "normal" baseline is imperfect.

Conclusion

AutoGraphAD represents a significant step forward in unsupervised NIDS. By eliminating the "middleman" of downstream classifiers and leveraging the inherent diagnostic power of Variational Autoencoders, it provides a fast, tunable, and accurate solution for modern network security. Future research will focus on testing the model's generalization across more diverse network architectures and evaluating its performance in live operational deployments.

Summary updated

BibTeX
@inproceedings{anyfantis2026autographad,
  author = {Georgios Anyfantis and Pere Barlet-Ros},
  title = {{AutoGraphAD: A novel approach using Variational Graph Autoencoders for anomalous network flow detection}},
  booktitle = {NetSoft},
  year = {2026},
  doi = {10.1109/netsoft70012.2026.11603414},
}
Figure