File size: 6,332 Bytes
058c744
 
 
 
 
 
 
878e91d
058c744
 
 
 
 
ea7ec2e
878e91d
058c744
878e91d
 
 
 
 
058c744
878e91d
058c744
67839aa
ad689f9
67839aa
 
878e91d
67839aa
 
 
 
 
 
878e91d
 
 
67839aa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
878e91d
 
67839aa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
878e91d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
058c744
878e91d
058c744
878e91d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
058c744
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
---
license: mit
language:
- en
tags:
- intrusion-detection
- network-logs
- cybersecurity
pretty_name: Network Traffic Dataset
---

# Network Traffic Detection Dataset

A curated dataset for **network traffic anomaly detection**, derived from the **[BCCC-CSE-CIC-IDS2018](https://www.yorku.ca/research/bccc/ucs-technical/cybersecurity-datasets-cds/large-scale-intrusion-detection-dataset-bccc-cse-cic-ids2018/)** intrusion detection dataset, which itself is an enhanced version of [CSE-CIC-IDS2018](https://www.unb.ca/cic/datasets/ids-2018.html)  
This dataset is restructured for modern machine learning and deep learning research on **network security** and **intrusion detection**.

> [!IMPORTANT]  
> The raw dataset (~90GB) was fragmented across 34 `.csv` files. To optimize for ML workflows, the data was merged and compressed into `.parquet` chunks using the `polars` Python library.  
> During the merge, 18 columns exhibited data-type mismatches (e.g., containing both `float64` values and strings like *"not a complete handshake"*). To resolve this, these specific columns were type-cast to `Utf8`.  
> - [View Schema Comparison Output](https://huggingface.co/datasets/init5iv3/network-traffic-detection/raw/main/schema_comparison_output.txt)  
> - [View Merge Script](https://huggingface.co/datasets/init5iv3/network-traffic-detection/raw/main/merge-upload.py)

## Usage

> [!IMPORTANT]
> This dataset is large (~90GB uncompressed). \
> Attempting to load the entire dataset into memory at once (e.g., via `pd.read_parquet()` or `dataset.to_pandas()`) will cause Out-of-Memory (OOM) crashes on some machines. \
> To safely use this dataset, separate the download step from the ingestion step, and process the data using lazy evaluation or batching.

### Accessing & Downloading the Data
Choose the method that best fits your system's constraints: \
_Hugging Face docs on [downloading datasets](https://huggingface.co/docs/hub/datasets-downloading)_

[datasets](https://huggingface.co/docs/hub/datasets-usage) \
_downloads the dataset using Apache Arrow_
```python
from datasets import load_dataset

dataset = load_dataset("init5iv3/network-traffic-detection", split="train")
```

[streaming with datasets](https://huggingface.co/docs/datasets/v4.8.4/en/stream) \
_Iterate through the data over the network without downloading the entire dataset to disk_
```python
from datasets import load_dataset

dataset = load_dataset("init5iv3/network-traffic-detection", split="train", streaming=True)
```

local download via [CLI](https://huggingface.co/docs/hub/datasets-downloading#using-the-hugging-face-client-library) \
_download `.parquet` files to a local directory_
```bash
hf download --quiet init5iv3/network-traffic-detection --repo-type dataset --local-dir /path/to/dir
```

local download via [snapshot_download](https://huggingface.co/docs/huggingface_hub/en/guides/download#download-an-entire-repository) \
_download `.parquet` files to a local directory_
```python
from huggingface_hub import snapshot_download

snapshot_download(
  repo_id="init5iv3/network-traffic-detection",
  repo_type="dataset",
  local_dir="/path/to/dir",
  allow_patterns="*.parquet",
  resume_download=True
)
```

virtual mounting with [hf-mount](https://github.com/huggingface/hf-mount)
```bash
hf-mount start repo init5iv3/network-traffic-detection /path/to/local/mount
```

### Ingesting/Processing

[polars](https://huggingface.co/docs/datasets/use_with_polars) \
_if the dataset was downloaded locally, `polars` can lazily scan the fragmented `.parquet` files in chunks_
```python
import polars as pl

df_lazy = pl.scan_parquet("/path/to/dir/**/*.parquet")

label_counts = df_lazy.select("label").value_counts().collect()
```

batch-processing with `datasets` library
```python
from datasets import load_dataset

dataset = load_dataset("init5iv3/network-traffic-detection", split="train")

for batch in dataset.iter(batch_size=10000):
  # process features here.
  pass
```


## Overview

Raw intrusion detection datasets like BCCC-CSE-CIC-IDS2018 are large, fragmented across multiple files, and often difficult to use directly for ML experiments. \
This dataset was created to provide an ML-ready format to the raw data, containing over 300 network flow features extracted via [NTLFlowLyzer](https://github.com/ahlashkari/NTLFlowLyzer). \
It is suitable for binary and multi-class classification.

## Labels

### Binary Classification
1. **Benign**
2. **Non-benign:** Aggregated from all specific attack classes below 

### Multi‑Class Classification
- Benign  
- DoS-Hulk
- DoS-Slowhttptest
- DoS-GoldenEye
- DoS-Slowloris
- DDoS-LOIC
- DDoS-HOIC
- Brute-Force-XSS
- Brute-Force-Web
- Brute-Force-FTP
- Brute-Force-SSH
- SQL-Injection
- Botnet
- Infiltration

## Citation

If you use this dataset, please cite both this repository and the original source:

### This dataset

```bibtex
@misc{init5iv32026networktraffic,
  title={Network Traffic Dataset},
  author={init5iv3},
  year={2026},
  publisher={Hugging Face},
  url={https://huggingface.co/datasets/init5iv3/network-traffic-detection}
}
```

### Original dataset (BCCC-CSE-CIC-IDS2018) and paper

```bibtex
@misc{bccc_cse_cic_ids2018_dataset,
  title={BCCC-CSE-CIC-IDS2018: Large-Scale Intrusion Detection Dataset},
  author={Shafi, MohammadMoein and Lashkari, Arash Habibi and Roudsari, Arousha Haghighian},
  year={2025},
  publisher={Behaviour-Centric Cybersecurity Center - York University},
  url={https://www.yorku.ca/research/bccc/ucs-technical/cybersecurity-datasets-cds/large-scale-intrusion-detection-dataset-bccc-cse-cic-ids2018/}
}

@article{shafi2025toward,
  title={Toward Generating a Large Scale Intrusion Detection Dataset and Intruders Behavioral Profiling Using Network and Transportation Layers Traffic Flow Analyzer (NTLFlowLyzer)},
  author={Shafi, MohammadMoein and Lashkari, Arash Habibi and Roudsari, Arousha Haghighian},
  journal={Journal of Network and Systems Management},
  volume={33},
  number={44},
  year={2025},
  publisher={Springer}
}
```

## License

This dataset is released under the **MIT License**.  
The original **BCCC-CSE-CIC-IDS2018** dataset is subject to its own licensing terms.

## Contributions

Feedback is welcome via the [community page](https://huggingface.co/datasets/init5iv3/network-traffic-detection/discussions)