UIA-IOT-IDS dataset: Comprehensive IoT network intrusion detection and sensor-anomaly

Published: 7 October 2026| Version 2 | DOI: 10.17632/h23z8f9h3y.2
Contributors:
,
,

Description

This record contains two complementary, fully labelled datasets for machine-learning-based IoT security, together with the complete acquisition and analysis code. All data were collected from a single physical smart-home testbed at the University of Agder (Grimstad, Norway), built around a resource-constrained Raspberry Pi 3 gateway, five ESP8266 + DHT22 temperature/humidity nodes in distinct rooms, a PySense board, a Flask IoT server with InfluxDB storage, and three Kali Linux attacker VMs. Network flows were computed on-device in real time by a custom tcpdump-based extractor, so no raw PCAP is stored. The deposit is organised into two datasets that serve two tasks: (1) IDS_Dataset - network-flow INTRUSION DETECTION. The "Original" folder holds the raw, as-collected flows: 3,637,408 labelled bidirectional records across 54 classes, each described by 75 columns (6 identifier/metadata fields + 69 statistical features) plus a label. Of the 69 features, 46 are schema-compatible with CIC-IoT-2023 and 23 are additional bidirectional descriptors (per-direction packet counts, packet-length and inter-arrival-time statistics, and flow rates). The "Balanced" folder holds a cleaned, SMOTE-balanced version: 1,415,074 records, one CSV per class, with identifier and zero-variance columns removed (64 features + label). The taxonomy spans 51 attack sub-types in nine categories - Reconnaissance, DoS, DDoS, Brute Force, Web-based, Mirai, Spoofing, False Data Injection and Backdoor/C2 - plus three benign traffic types (sensor, SSH, Grafana). It reproduces the eight CIC-IoT-2023 categories and adds families absent from common benchmarks: False Data Injection (direct injection and man-in-the-middle sensor replay) and Backdoor/command-and-control beaconing. (2) AD_Dataset - sensor ANOMALY DETECTION. The "Benign" folder holds timestamped temperature and humidity readings from the five DHT22 nodes (one CSV per node); the "Abnormal" folder holds readings from three anomaly sources: a heat-biased PySense board (hardware fault), direct false-data injection, and ARP-spoofing replay. 4,253,024 readings fall within the 1 March - 13 April 2026 window analysed in the article; earlier readings are also included. Each reading is stored as one row carrying either a temperature or a humidity value (InfluxDB export format). All tabular data are UTF-8 CSV files with a header row; every network-flow record carries an explicit label. The deposit also includes the full code: the real-time flow extractor, the Flask server with intentionally vulnerable endpoints, the attack and injection scripts, the SMOTE preprocessing, and the model code (XGBoost benchmark, LSTM-autoencoder, MAML, Prototypical Networks). A disjoint base/novel class split supports supervised, unsupervised and few-shot detection research.

Files

Steps to reproduce

The full testbed, capture-mode configurations and per-class analyses are reported in the accompanying Data in Brief article; the collection and processing pipeline is summarised below. 1. Testbed. A Raspberry Pi 3 (Raspbian 11) runs a Flask IoT server that stores sensor readings in InfluxDB and visualises them in Grafana. Five ESP8266 + DHT22 nodes post temperature/humidity from five rooms; a PySense board provides a hardware-biased sensor. Three Kali Linux VMs act as attackers. 2. Benign collection. With only legitimate traffic running, sensor readings are logged to InfluxDB and exported as the AD_Dataset "Benign" CSVs, while the flow extractor (network_extractor.py, normal mode) records benign network flows. 3. Attack and anomaly generation. Each attack sub-type is run in its own session with the extractor set to the matching capture mode (normal / dos / ddos / recon / backdoor / mitm), which fixes the packet-grouping key for that family. Reconnaissance uses Nmap, Masscan, Nikto and fping; flooding uses hping3; Brute Force uses Hydra; Web attacks use SQLmap and curl against the vulnerable endpoints; Backdoor/C2 traffic is produced by backdoor.py on the Pi. Sensor anomalies are produced by the PySense board, by direct false-data injection, and by Scapy/arpspoof replay, giving the AD_Dataset "Abnormal" CSVs. 4. Labelling. Each captured CSV is tagged with its attack sub-type or benign class, and the per-sub-type files are concatenated to form IDS_Dataset/Original. 5. Cleaning and balancing. smote_balance.py removes duplicate and all-zero rows, drops identifier and zero-variance columns, and applies a tiered SMOTE over-sampling / random under-sampling scheme (benign capped; attack classes raised or lowered to 10k/20k/30k targets). The result is IDS_Dataset/Balanced. 6. Technical validation (optional). benchmark_models.py reproduces the XGBoost flow-classification baselines (10-category and 54-class); lstm_anomaly_iot.py trains one LSTM-autoencoder per benign sensor and flags anomalies at the 95th-percentile reconstruction-error threshold; protonet_iot.py and maml_iot.py reproduce the few-shot detectors. Software: Python 3, tcpdump, Flask, InfluxDB, scikit-learn, imbalanced-learn, XGBoost, PyTorch. The file paths and device IPs defined at the top of each script must be set to the local environment before running.

Institutions

Categories

Cybersecurity, Intrusion Detection, Cyber Attack, IoT Sensor, IoT Application

Licence