lacg030175 commited on
Commit
0d5c277
·
verified ·
1 Parent(s): 5208839

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: cc-by-4.0
5
+ size_categories:
6
+ - 1M<n<10M
7
+ task_categories:
8
+ - tabular-classification
9
+ tags:
10
+ - network-intrusion-detection
11
+ - cybersecurity
12
+ - CICIDS2017
13
+ - IDS
14
+ - binary-classification
15
+ pretty_name: CICIDS2017 Network Intrusion Detection
16
+ configs:
17
+ - config_name: temporal
18
+ data_files:
19
+ - split: train
20
+ path: temporal/train-*
21
+ - split: test
22
+ path: temporal/test-*
23
+ default: true
24
+ - config_name: standard
25
+ data_files:
26
+ - split: train
27
+ path: temporal/train-*
28
+ - split: test
29
+ path: temporal/test-*
30
+ - config_name: random
31
+ data_files:
32
+ - split: train
33
+ path: random/train-*
34
+ - split: test
35
+ path: random/test-*
36
+ ---
37
+
38
+ # CICIDS2017 Network Intrusion Detection Dataset
39
+
40
+ The [CICIDS2017](https://www.unb.ca/cic/datasets/ids-2017.html) dataset from the Canadian Institute for Cybersecurity, provided with **temporal and random splits** for fair evaluation.
41
+
42
+ ## Configurations
43
+
44
+ ### `temporal` (default) — Day-Based Temporal Split
45
+
46
+ > **Note:** `standard` is an alias for `temporal` — both load the same data.
47
+
48
+ Train on Monday-Thursday, test on Friday. The model must generalize to unseen attack types (DDoS, Botnet, PortScan).
49
+
50
+ ```python
51
+ from datasets import load_dataset
52
+ ds = load_dataset("lacg030175/CICIDS2017", "temporal") # or "standard"
53
+ # ds["train"]: 2,125,158 rows (Mon-Thu)
54
+ # ds["test"]: 702,718 rows (Friday)
55
+ ```
56
+
57
+ **Train attacks:** 267,771 / 2,125,158 (12.6%)
58
+ **Test attacks:** 288,785 / 702,718 (41.1%)
59
+
60
+ ### `random` — Stratified Random Split
61
+
62
+ 80/20 stratified random split from all days combined.
63
+
64
+ ```python
65
+ ds = load_dataset("lacg030175/CICIDS2017", "random")
66
+ # ds["train"]: 2,262,300 rows
67
+ # ds["test"]: 565,576 rows
68
+ ```
69
+
70
+ ## Top-20 RF Features
71
+
72
+ 1. Bwd Packet Length Std
73
+ 2. Destination Port
74
+ 3. Packet Length Std
75
+ 4. Bwd Packet Length Max
76
+ 5. Avg Bwd Segment Size
77
+ 6. Bwd Packet Length Mean
78
+ 7. Fwd IAT Std
79
+ 8. Average Packet Size
80
+ 9. Packet Length Variance
81
+ 10. Flow IAT Max
82
+ 11. Packet Length Mean
83
+ 12. Init_Win_bytes_forward
84
+ 13. Idle Min
85
+ 14. Idle Mean
86
+ 15. Fwd IAT Max
87
+ 16. Flow IAT Std
88
+ 17. Flow Packets/s
89
+ 18. Flow IAT Mean
90
+ 19. Fwd Header Length
91
+ 20. Bwd Header Length
92
+
93
+ ## Attack Types
94
+
95
+ | Day | Attack Types |
96
+ |---|---|
97
+ | Monday | Benign only |
98
+ | Tuesday | FTP-Patator, SSH-Patator |
99
+ | Wednesday | DoS Hulk, DoS GoldenEye, DoS Slowhttptest, DoS slowloris, Heartbleed |
100
+ | Thursday | Web Attack (Brute Force, XSS, SQL Injection), Infiltration |
101
+ | **Friday (test)** | **Bot, DDoS, PortScan** |
102
+
103
+ ## Labels
104
+
105
+ - **Binary** (`label`): 0 = BENIGN, 1 = Attack
106
+ - **Multi-class** (`Label`): 15 categories (BENIGN + 14 attack types)
107
+
108
+ ## Features
109
+
110
+ 78 numeric flow-level features extracted by CICFlowMeter.
111
+
112
+ ## Preprocessing
113
+
114
+ - Removed rows with NaN/infinity values
115
+ - Stripped whitespace from column names and labels
116
+ - All features converted to numeric (float64)
117
+ - Added binary `label` column (0=BENIGN, 1=Attack)
118
+
119
+ ## Citation
120
+
121
+ ```bibtex
122
+ @inproceedings{sharafaldin2018toward,
123
+ title={Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization},
124
+ author={Sharafaldin, Iman and Lashkari, Arash Habibi and Ghorbani, Ali A},
125
+ booktitle={International Conference on Information Systems Security and Privacy},
126
+ year={2018}
127
+ }
128
+ ```
129
+
130
+ ## License
131
+
132
+ CC BY 4.0 — original dataset by the Canadian Institute for Cybersecurity, University of New Brunswick.
feature_importance.json ADDED
@@ -0,0 +1,338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "top20": [
3
+ "Bwd Packet Length Std",
4
+ "Destination Port",
5
+ "Packet Length Std",
6
+ "Bwd Packet Length Max",
7
+ "Avg Bwd Segment Size",
8
+ "Bwd Packet Length Mean",
9
+ "Fwd IAT Std",
10
+ "Average Packet Size",
11
+ "Packet Length Variance",
12
+ "Flow IAT Max",
13
+ "Packet Length Mean",
14
+ "Init_Win_bytes_forward",
15
+ "Idle Min",
16
+ "Idle Mean",
17
+ "Fwd IAT Max",
18
+ "Flow IAT Std",
19
+ "Flow Packets/s",
20
+ "Flow IAT Mean",
21
+ "Fwd Header Length",
22
+ "Bwd Header Length"
23
+ ],
24
+ "all_ranked": [
25
+ [
26
+ "Bwd Packet Length Std",
27
+ 0.0837563378633182
28
+ ],
29
+ [
30
+ "Destination Port",
31
+ 0.06879629526647663
32
+ ],
33
+ [
34
+ "Packet Length Std",
35
+ 0.06032804711082539
36
+ ],
37
+ [
38
+ "Bwd Packet Length Max",
39
+ 0.058932110766919565
40
+ ],
41
+ [
42
+ "Avg Bwd Segment Size",
43
+ 0.0437471388275155
44
+ ],
45
+ [
46
+ "Bwd Packet Length Mean",
47
+ 0.04121379424371662
48
+ ],
49
+ [
50
+ "Fwd IAT Std",
51
+ 0.04101142720004286
52
+ ],
53
+ [
54
+ "Average Packet Size",
55
+ 0.035521541337101746
56
+ ],
57
+ [
58
+ "Packet Length Variance",
59
+ 0.031909920793574076
60
+ ],
61
+ [
62
+ "Flow IAT Max",
63
+ 0.03157229045031628
64
+ ],
65
+ [
66
+ "Packet Length Mean",
67
+ 0.030819402445615894
68
+ ],
69
+ [
70
+ "Init_Win_bytes_forward",
71
+ 0.02595738079132567
72
+ ],
73
+ [
74
+ "Idle Min",
75
+ 0.02401246296659628
76
+ ],
77
+ [
78
+ "Idle Mean",
79
+ 0.02386971574502858
80
+ ],
81
+ [
82
+ "Fwd IAT Max",
83
+ 0.023634597075319737
84
+ ],
85
+ [
86
+ "Flow IAT Std",
87
+ 0.022673249317080382
88
+ ],
89
+ [
90
+ "Flow Packets/s",
91
+ 0.02133648266484933
92
+ ],
93
+ [
94
+ "Flow IAT Mean",
95
+ 0.01801800209677785
96
+ ],
97
+ [
98
+ "Fwd Header Length",
99
+ 0.017559964627608872
100
+ ],
101
+ [
102
+ "Bwd Header Length",
103
+ 0.017397805145422333
104
+ ],
105
+ [
106
+ "Init_Win_bytes_backward",
107
+ 0.017168146844842094
108
+ ],
109
+ [
110
+ "Max Packet Length",
111
+ 0.016098926990328485
112
+ ],
113
+ [
114
+ "Subflow Bwd Packets",
115
+ 0.015395475992105374
116
+ ],
117
+ [
118
+ "Subflow Bwd Bytes",
119
+ 0.014412839949641529
120
+ ],
121
+ [
122
+ "Fwd Packet Length Mean",
123
+ 0.013766173721520255
124
+ ],
125
+ [
126
+ "Total Length of Bwd Packets",
127
+ 0.012447634501268139
128
+ ],
129
+ [
130
+ "Flow Bytes/s",
131
+ 0.012102463084973467
132
+ ],
133
+ [
134
+ "Fwd Header Length.1",
135
+ 0.011954928496896493
136
+ ],
137
+ [
138
+ "Bwd Packets/s",
139
+ 0.011152436980891476
140
+ ],
141
+ [
142
+ "Total Backward Packets",
143
+ 0.01112703742802788
144
+ ],
145
+ [
146
+ "Flow Duration",
147
+ 0.011029897503692852
148
+ ],
149
+ [
150
+ "Subflow Fwd Bytes",
151
+ 0.010684539824655566
152
+ ],
153
+ [
154
+ "Fwd Packets/s",
155
+ 0.00958826591972835
156
+ ],
157
+ [
158
+ "Fwd IAT Mean",
159
+ 0.009323617138154614
160
+ ],
161
+ [
162
+ "Fwd Packet Length Max",
163
+ 0.00911402020101561
164
+ ],
165
+ [
166
+ "Fwd IAT Total",
167
+ 0.008577577608562108
168
+ ],
169
+ [
170
+ "Total Length of Fwd Packets",
171
+ 0.00812531827273633
172
+ ],
173
+ [
174
+ "Avg Fwd Segment Size",
175
+ 0.00789561161094297
176
+ ],
177
+ [
178
+ "Flow IAT Min",
179
+ 0.006841831063666978
180
+ ],
181
+ [
182
+ "Subflow Fwd Packets",
183
+ 0.0067868729991015205
184
+ ],
185
+ [
186
+ "Fwd IAT Min",
187
+ 0.006775727587578379
188
+ ],
189
+ [
190
+ "min_seg_size_forward",
191
+ 0.0067192219239098705
192
+ ],
193
+ [
194
+ "Total Fwd Packets",
195
+ 0.004836529356818308
196
+ ],
197
+ [
198
+ "FIN Flag Count",
199
+ 0.004591599879995746
200
+ ],
201
+ [
202
+ "Active Max",
203
+ 0.0035549862551803135
204
+ ],
205
+ [
206
+ "Min Packet Length",
207
+ 0.0031687815796311598
208
+ ],
209
+ [
210
+ "Bwd Packet Length Min",
211
+ 0.002785378787170623
212
+ ],
213
+ [
214
+ "Fwd Packet Length Std",
215
+ 0.0024062055654547445
216
+ ],
217
+ [
218
+ "Idle Max",
219
+ 0.002012727162006491
220
+ ],
221
+ [
222
+ "act_data_pkt_fwd",
223
+ 0.0017644254762753029
224
+ ],
225
+ [
226
+ "Bwd IAT Std",
227
+ 0.0017322127073896032
228
+ ],
229
+ [
230
+ "ACK Flag Count",
231
+ 0.0015676090607401746
232
+ ],
233
+ [
234
+ "Bwd IAT Max",
235
+ 0.0013586461202798378
236
+ ],
237
+ [
238
+ "Fwd Packet Length Min",
239
+ 0.0013296732999971317
240
+ ],
241
+ [
242
+ "Bwd IAT Min",
243
+ 0.0011715694469785925
244
+ ],
245
+ [
246
+ "Bwd IAT Mean",
247
+ 0.0011455506482546248
248
+ ],
249
+ [
250
+ "Bwd IAT Total",
251
+ 0.000983200218468732
252
+ ],
253
+ [
254
+ "Active Min",
255
+ 0.0009824087544876572
256
+ ],
257
+ [
258
+ "Active Std",
259
+ 0.0009262149343992738
260
+ ],
261
+ [
262
+ "SYN Flag Count",
263
+ 0.0008310890034093027
264
+ ],
265
+ [
266
+ "URG Flag Count",
267
+ 0.0007049471092881057
268
+ ],
269
+ [
270
+ "Down/Up Ratio",
271
+ 0.0006538356335079626
272
+ ],
273
+ [
274
+ "Active Mean",
275
+ 0.0006346693896128583
276
+ ],
277
+ [
278
+ "PSH Flag Count",
279
+ 0.0005913842751979574
280
+ ],
281
+ [
282
+ "Idle Std",
283
+ 0.0005663576220807777
284
+ ],
285
+ [
286
+ "Fwd PSH Flags",
287
+ 0.0004786853479820916
288
+ ],
289
+ [
290
+ "Fwd URG Flags",
291
+ 4.345873517300932e-05
292
+ ],
293
+ [
294
+ "CWE Flag Count",
295
+ 2.132125054749009e-05
296
+ ],
297
+ [
298
+ "Bwd Avg Bulk Rate",
299
+ 0.0
300
+ ],
301
+ [
302
+ "Bwd Avg Bytes/Bulk",
303
+ 0.0
304
+ ],
305
+ [
306
+ "Bwd Avg Packets/Bulk",
307
+ 0.0
308
+ ],
309
+ [
310
+ "Bwd PSH Flags",
311
+ 0.0
312
+ ],
313
+ [
314
+ "Bwd URG Flags",
315
+ 0.0
316
+ ],
317
+ [
318
+ "ECE Flag Count",
319
+ 0.0
320
+ ],
321
+ [
322
+ "Fwd Avg Bulk Rate",
323
+ 0.0
324
+ ],
325
+ [
326
+ "Fwd Avg Bytes/Bulk",
327
+ 0.0
328
+ ],
329
+ [
330
+ "Fwd Avg Packets/Bulk",
331
+ 0.0
332
+ ],
333
+ [
334
+ "RST Flag Count",
335
+ 0.0
336
+ ]
337
+ ]
338
+ }
random/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b5f31bb5d1f41cd1ef61ed83ff24b47d91d7e9fb44a7f61de61bd2653007171
3
+ size 78379404
random/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93df29850dea6c167aa3224b18fdf07f740cd07ea4b54a7a182b374a14e66462
3
+ size 313668479
temporal/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95e34b6fb93b036ffc4cb92d607625f51628cf81047593f59dfa1cfdcfd70d51
3
+ size 72318531
temporal/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e488527febcdffdc6d22ac9e43eef0a33776b4487bc0d1e0a9a194292a8188b
3
+ size 265000784