Adaptive Class-Balanced Distance-Weighted KNN for Multiclass IoT Mirai Botnet Classification

Mirai botnet traffic classification in Internet of Things (IoT) devices requires a model capable of distinguishing multiple attack types with similar traffic characteristics. This study designs and evaluates Adaptive Class-Balanced Distance-Weighted K-Nearest Neighbors (ACBDW-KNN), a variant of KNN integrating adaptive neighbor selection, distance-based neighbor weighting, and class weighting based on training data frequencies. The experiments employ a subset of N-BaIoT comprising 115 features and six classes: Benign, Mirai_ACK, Mirai_SYN, Mirai_Scan, Mirai_UDP, and Mirai_UDP_Plain. After removing duplicate records with identical features and no label conflicts, the dataset contains 692,495 records. For each random seed, 30,000 samples are selected through stratified sampling and divided into training, validation, and testing sets at a ratio of 60:20:20. Five random seeds are used to compare seven KNN configurations. ACBDW-KNN achieves a mean Macro F1-score of 0.990538 ± 0.000620 and Balanced Accuracy of 0.991151 ± 0.001284. Adaptive Distance-Weighted KNN achieves a slightly higher Macro F1-score of 0.990715 ± 0.000955. Conversely, ACBDW-KNN achieves higher Balanced Accuracy across all five seeds. The paired Wilcoxon signed-rank test reveals no statistically significant differences in Macro F1 (p = 0.4375) or Balanced Accuracy (p = 0.0625). These findings demonstrate the potential of ACBDW-KNN to improve recall balance across classes within the evaluated device subset; however, cross-device generalizability remains unverified.

Authors

Publication Details

Journal
International Journal Multidisciplinary Science
Published
2026-12-01
DOI
https://doi.org/10.56127/ijml.v5i1.3187
Primary Topic
Network Security and Intrusion Detection
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Adaptive Class-Balanced Distance-Weighted KNN for Multiclass IoT Mirai Botnet Classification

Ary Bima Kurniawan, Cecep Suprayogi, Mochammad Akbar Marwan
International Journal Multidisciplinary Science
Network Security and Intrusion Detection
article

Adaptive Class-Balanced Distance-Weighted KNN for Multiclass IoT Mirai Botnet Classification

Ary Bima Kurniawan, Cecep Suprayogi, Mochammad Akbar Marwan
article en

Abstract

Mirai botnet traffic classification in Internet of Things (IoT) devices requires a model capable of distinguishing multiple attack types with similar traffic characteristics. This study designs and evaluates Adaptive Class-Balanced Distance-Weighted K-Nearest Neighbors (ACBDW-KNN), a variant of KNN integrating adaptive neighbor selection, distance-based neighbor weighting, and class weighting based on training data frequencies. The experiments employ a subset of N-BaIoT comprising 115 features and six classes: Benign, Mirai_ACK, Mirai_SYN, Mirai_Scan, Mirai_UDP, and Mirai_UDP_Plain. After removing duplicate records with identical features and no label conflicts, the dataset contains 692,495 records. For each random seed, 30,000 samples are selected through stratified sampling and divided into training, validation, and testing sets at a ratio of 60:20:20. Five random seeds are used to compare seven KNN configurations. ACBDW-KNN achieves a mean Macro F1-score of 0.990538 ± 0.000620 and Balanced Accuracy of 0.991151 ± 0.001284. Adaptive Distance-Weighted KNN achieves a slightly higher Macro F1-score of 0.990715 ± 0.000955. Conversely, ACBDW-KNN achieves higher Balanced Accuracy across all five seeds. The paired Wilcoxon signed-rank test reveals no statistically significant differences in Macro F1 (p = 0.4375) or Balanced Accuracy (p = 0.0625). These findings demonstrate the potential of ACBDW-KNN to improve recall balance across classes within the evaluated device subset; however, cross-device generalizability remains unverified.

International Journal Multidisciplinary ScienceVol. 5(1)
Network Security and Intrusion Detection
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon