AutoIDS: Auto-encoder Based Method for Intrusion Detection System

Mohammed Gharib, Bahram Mohammadi, Shadi Hejareh Dastgerdi, Mohammad SabokrouarXiv 2019

Introduction

Modern network security relies heavily on Intrusion Detection Systems (IDS) to safeguard infrastructure against evolving threats. Traditional approaches typically fall into two categories: signature-based systems, which are ineffective against "zero-day" attacks, and supervised machine learning models, which require exhaustive, perfectly labeled datasets. The latter often struggle to generalize when faced with novel intrusion patterns not present in their training data.

To address these challenges, AutoIDS proposes a semi-supervised approach. By training exclusively on normal network traffic, the system learns to identify anomalies as deviations from established patterns. However, semi-supervised deep learning models often face a trade-off between detection accuracy and the high-speed processing requirements of modern network gateways. AutoIDS resolves this by introducing a cascaded architecture that separates simple traffic flows from complex ones, optimizing both speed and precision.

Methodology: The Cascaded Detector

The core innovation of AutoIDS is its two-stage cascaded detector system, comprising a sparsity-based detector ($D_1$) and a reconstruction-based detector ($D_2$). This hierarchy allows the system to filter "easy" samples with a lightweight model before passing ambiguous cases to a more computationally intensive stage.

Stage 1: Sparsity-Based Detector ($D_1$)

The first stage utilizes a Sparse Auto-encoder (SAE). Unlike standard auto-encoders, an SAE is designed to be "over-complete," featuring a hidden layer larger than the input layer, but constrained to keep most neurons inactive (sparse). The underlying logic is that normal traffic patterns can be efficiently represented by a small subset of active neurons.

The AutoIDS cascaded detection framework, illustrating the flow from incoming traffic through the sparsity-based filter to the reconstruction-based detector.

As shown in the framework above, an incoming flow is evaluated based on its sparsity value $\mathcal{S}(\mathbb{Z})$:

  • Anomaly: If $\mathcal{S}(\mathbb{Z}) > \mathcal{T}_{max}$, the flow activates too many neurons and is immediately flagged.
  • Normal: If $\mathcal{S}(\mathbb{Z}) < \mathcal{T}_{min}$, the flow is highly sparse and marked as safe.
  • Unknown: Flows falling between these thresholds are deemed "difficult" and passed to the second stage.

Stage 2: Reconstruction-Based Detector ($D_2$)

The second stage employs a standard Auto-encoder (AE) with a bottleneck layer. This model is trained to minimize reconstruction error for normal traffic. When a complex flow arrives from $D_1$, the AE attempts to reconstruct it. If the reconstruction error ($\mathcal{L}_{AE}$) exceeds a defined threshold ($thr_{AE}$), the flow is classified as an anomaly; otherwise, it is considered normal.

Experimental Setup and Datasets

The authors evaluated AutoIDS using the NSL-KDD dataset, a benchmark for cybersecurity research. The KDDTrain+ set was used for training (utilizing only normal samples) and validation. For final evaluation, the KDDTest+ set was employed, which contains 17 types of attacks not present in the training data, providing a rigorous test of the model's ability to generalize to unseen threats. Preprocessing involved converting categorical features into a 122-dimensional one-hot encoded vector.

Results and Performance Analysis

AutoIDS achieved a state-of-the-art 90.17% accuracy on the NSL-KDD dataset, significantly outperforming other deep learning architectures such as RNN-IDS (83.28%) and DCNN (85.00%).

F-Score performance comparison of AutoIDS against standard and de-noising auto-encoders across varying percentages of outliers.

Beyond accuracy, the cascaded approach demonstrated superior computational efficiency. By rejecting or accepting the majority of flows at the $D_1$ stage, the system achieved an average test time of 137 μs per flow, compared to 195 μs for a standalone reconstruction-based AE. Ablation studies confirmed that the combination of $D_1$ and $D_2$ yielded a higher F-score and a lower False Positive Rate (FPR) than either component used in isolation.

Discussion and Key Insights

The success of AutoIDS stems from two primary factors: the use of sparsity as a discriminator and the efficiency of the rejection-based cascade. Using t-SNE visualizations, the researchers found that the sparse AE's latent space makes normal and abnormal flows more linearly separable than the raw feature space. Furthermore, because the model is semi-supervised and never "sees" specific attacks during training, it avoids developing a bias toward known patterns, making it inherently more robust against zero-day exploits.

Limitations and Future Work

Despite its performance, the system requires careful tuning of three critical thresholds ($\tau_{min}$, $\tau_{max}$, and $thr_{AE}$), which may need frequent recalibration in dynamic network environments. Additionally, while the model is deep, it currently relies on pre-extracted features from the NSL-KDD dataset. Future research could explore applying this cascaded architecture directly to raw packet data or investigating its resilience against adversarial attacks designed to mimic normal sparsity patterns.

Summary updated

BibTeX
@misc{gharib2019autoids,
  author = {Mohammed Gharib and Bahram Mohammadi and Shadi Hejareh Dastgerdi and Mohammad Sabokrou},
  title = {{AutoIDS: Auto-encoder Based Method for Intrusion Detection System}},
  year = {2019},
  eprint = {1911.03306},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.03306},
}
Figure