Skip to main content
QUICK REVIEW

[Paper Review] Unsupervised Anomaly Detection in NSL-KDD Using $β$-VAE: A Latent Space and Reconstruction Error Approach

Dylan Baptiste, Ramla Saddem|arXiv (Cornell University)|Feb 23, 2026
Network Security and Intrusion DetectionComputer Science0 citations
TL;DR

The paper compares reconstruction-error and latent-space distance methods for unsupervised anomaly detection on NSL-KDD using β-VAE, highlighting when latent-space distances can match or exceed reconstruction-based detection.

ABSTRACT

As Operational Technology increasingly integrates with Information Technology, the need for Intrusion Detection Systems becomes more important. This paper explores an unsupervised approach to anomaly detection in network traffic using $β$-Variational Autoencoders on the NSL-KDD dataset. We investigate two methods: leveraging the latent space structure by measuring distances from test samples to the training data projections, and using the reconstruction error as a conventional anomaly detection metric. By comparing these approaches, we provide insights into their respective advantages and limitations in an unsupervised setting. Experimental results highlight the effectiveness of latent space exploitation for classification tasks.

Motivation & Objective

  • Motivate intrusion detection in OT/IT-integrated environments and evaluate unsupervised anomaly detection on NSL-KDD.
  • Investigate two detection signals—reconstruction error and latent-space distance (Z_k)—within a β-VAE framework.
  • Assess performance and trade-offs of the two signals across β and k values, and analyze interpretability and incremental learning potential.

Proposed method

  • Use a β-VAE to learn a latent representation of NSL-KDD data after preprocessing (one-hot encoding for categoricals, binary encoding for booleans, and standardization for continuous features).
  • Train with encoder qφ(z|x) and decoder pθ(x|z); objective is the β-ELBO: E_q[log pθ(x|z)] − β D_KL(qφ(z|x)||p(z)).
  • Define reconstruction loss L_rec as a weighted sum of categorical cross-entropy, binary cross-entropy, and MSE across feature types.
  • Evaluate two anomaly detection signals: (i) L_rec-classification using reconstruction error and a threshold; (ii) Z_k-classification using mean Euclidean distance to the k nearest latent-space neighbors from training normals.
  • Report AUROC and analyze β and k impacts, with a focus on latent-space exploitation for classification.

Experimental results

Research questions

  • RQ1Can a β-VAE latent space be exploited for unsupervised anomaly detection in NSL-KDD via latent-space distances?
  • RQ2How does latent-space distance performance compare to reconstruction-error-based detection across different β and k values?
  • RQ3Do reconstruction-based and latent-space signals offer complementary detection capabilities that could enable adaptive or hybrid threat scoring?
  • RQ4What are the practical implications for incremental learning and behavior-based intrusion analysis using latent embeddings?

Key findings

  • Latent-space distance (Z_k) can match or surpass reconstruction-based AUROC under certain β and k settings.
  • Best average AUROC for L_rec occurs at β=0, with AUROC around 0.962–0.968 and increasing with higher k for Z_k.
  • Best mean AUROC for Z_k is achieved at β=1e-5 and k=5000, outperforming L_rec in some configurations.
  • Increasing k generally improves AUROC for Z_k-classification across tested β values.
  • For β=0, the highest reported AUROC across all k is 97.70% (L_rec) and up to 97.90% for Z_k with certain settings; details per row are in Table II.
  • The two methods are complementary and can be combined via adaptive thresholding or fused scoring, enabling incremental learning and behavior-aware intrusion analysis.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.