Detecting Unknown Attacks in IoT Environments: An Open Set Classifier for Enhanced Network Intrusion Detection

Yasir Ali Farrukh, Syed Wali, Irfan Khan, Nathaniel D. Bastian

Abstract

Traditional Network Intrusion Detection Systems (NIDS) often struggle with "zero-day" attacks because they are designed for closed-world environments. This paper presents a novel open-set intrusion detection framework tailored for IoT networks. By converting network packets into RGB images and employing a stacked ensemble of deep learners trained on sub-clusters of benign traffic, the proposed system effectively identifies previously unseen threats. Experimental results on the CIC-IDS2017 dataset demonstrate an 88% detection rate for unknown attacks, significantly outperforming existing state-of-the-art methods in balancing sensitivity and specificity.

1. Introduction

The rapid expansion of the Internet of Things (IoT) has introduced billions of connected devices, creating a vast and evolving attack surface. Most existing NIDS rely on supervised learning, which assumes that all possible attack classes are known during training—a "closed-world" assumption. However, in real-world IoT environments, new vulnerabilities and "zero-day" exploits emerge constantly. When these systems encounter an unknown attack, they typically misclassify it as benign traffic.

To address this, the authors propose an Open Set Recognition (OSR) framework. The goal is to build a classifier capable of distinguishing not only between known categories but also identifying "unknown" traffic that does not align with established benign or malicious patterns.

2. Methodology

The proposed framework utilizes a multi-layered approach combining computer vision techniques with ensemble machine learning.

2.1 Image-Based Packet Representation

Unlike traditional flow-based NIDS that use statistical summaries of network connections, this framework operates at the packet level. Raw packet payloads are extracted and converted into serialized RGB images using a tool called Payload-Byte. This transformation allows the model to leverage Convolutional Neural Networks (CNNs) to capture complex spatial and temporal patterns within the actual message content of the network traffic.

2.2 Benign Sub-Clustering

A key innovation of this research is the granular modeling of "normal" behavior. Recognizing that benign traffic is highly diverse, the authors use K-means clustering to segment benign data into seven distinct sub-clusters. The optimal number of clusters was determined using the Elbow and Silhouette methods. This approach allows the system to learn the specific nuances of different types of healthy network activity, creating a high-fidelity "profile of health."

2.3 Stacked Ensemble Architecture

The detection engine consists of a two-tier stacked ensemble:

  1. Base Learners: Seven deep CNNs are trained, each corresponding to one of the benign sub-clusters. Each CNN learns to differentiate its specific benign cluster from all other benign data.
  2. Meta-Learners: The probability outputs from the base learners are fed into a second layer of classifiers, including Random Forest, Logistic Regression, XGBoost, and LightLGBM. These meta-learners are trained on both benign data and a subset of known attacks.
  3. Voting Mechanism: A final majority vote across the meta-learners determines whether the incoming traffic is "Benign" or an "Unknown Attack."

3. Experimental Setup

The framework was evaluated using the CIC-IDS2017 dataset, a standard benchmark for modern network traffic. To simulate an open-world scenario, the researchers held out five specific attack classes—including DoS Hulk, SQL Injection, and Bot traffic—entirely during the training phase. These classes were treated as "unknown" during the evaluation phase to test the system's ability to detect novel threats.

4. Results and Discussion

The framework achieved an 88% detection rate for previously unseen attacks. When compared to state-of-the-art (SOTA) novelty and out-of-distribution detection methods, the system showed a superior balance of performance:

  • Vs. ECOD: While matching the sensitivity of the ECOD algorithm, the proposed framework improved specificity by 37%, drastically reducing the rate of false alarms.
  • Vs. PReNet: The framework achieved comparable specificity to PReNet but led by 17% in sensitivity, catching significantly more actual attacks.

These results indicate that by focusing on the structure of benign traffic, the model can effectively flag any significant deviation as a potential anomaly without overwhelming the system with false positives—a common pitfall in anomaly detection.

5. Conclusion and Future Work

This research provides a robust foundation for open-set recognition in IoT security. By moving beyond flow-based statistics to packet-level image analysis and utilizing a stacked ensemble approach, the system demonstrates high efficacy in identifying zero-day threats. Future research will focus on testing the framework across varying "openness levels" and exploring the computational efficiency required for real-time deployment in high-speed IoT environments.

Summary updated

BibTeX
@inproceedings{farrukh2023detecting,
  author = {Yasir Ali Farrukh and Syed Wali and Irfan Khan and Nathaniel D. Bastian},
  title = {{Detecting Unknown Attacks in IoT Environments: An Open Set Classifier for Enhanced Network Intrusion Detection}},
  booktitle = {MILCOM},
  year = {2023},
  doi = {10.1109/milcom58377.2023.10356319},
}
Figure