Volume 10 • Issue 2 • PP: 43–50 • 2026
WS-STACK: A Weighted Stacking Ensemble with Multi-Criteria Feature Selection for Multi-Class Traffic Classification and Anomaly Detection in Heterogeneous Wireless Sensor Networks
Open Access & Copyright
© 2026 The Author(s). Published by ASPG. This article is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
Abstract
Heterogeneous Internet-of-Things deployments expose wireless sensor networks to a diverse and continuously evolving threat landscape encompassing distributed denial-of-service flooding, network reconnaissance scanning, and brute-force credential attacks. Existing intrusion detection approaches predominantly adopt single-classifier architectures and binary labelling, which are ill-suited to the multi-class, class-imbalanced traffic characteristic of real-world IoT sensor deployments. This paper proposes WS-STACK, a Weighted Stacking ensemble that combines five heterogeneous base learners—Random Forest, XGBoost, Support Vector Machine, K-Nearest Neighbours, and Gradient Boosting—under an ℓ2-regularised Logistic Regression meta-learner trained on cross validationgenerated probability features. A three-stage feature engineering pipeline comprising mutual information filtering, variance inflation factor pruning, and correlation-based elimination reduces the 83 dimensional RT-IoT2022 feature space to 20 informative features, and the Synthetic Minority Over-Sampling Technique corrects the six-fold class imbalance prior to training. Evaluated on 83,000 labelled network flow records from the publicly available RTIoT2022 benchmark spanning four benign traffic patterns and seven attack categories, WS-STACK achieves 99.61% classification accuracy, a weighted F1-score of 0.9960, and an AUC-ROC of 0.9978, outperforming every individual base classifier and five recently published state-of-the-art baselines. The false positive rate is reduced to 0.0006, and ten-fold cross-validation confirms μacc = 0.9959 (σ = 0.0004). Ablation experiments identify SMOTE as the single most critical preprocessing component, and noise robustness tests confirm 98.81% accuracy under 20% Gaussian feature perturbation. The framework is grounded through a formal variance-reduction proof and a channel-energy anomaly model that establishes the physical motivation for packet-rate features as the dominant intrusion detection signal in constrained wireless sensor networks.
Keywords
References
[1] A. S. Balobaid, S. B. Ahamed, S. Shamsudheen, and S. Balamurugan, “Neural network clustering and swarm intelligence-based routing protocol for wireless sensor networks,” Wireless Communications and Mobile Computing, vol. 2023, p. 4758852, 2023, doi: 10.1155/2023/4758852.
[2] O. A. Khashan, N. M. Khafajah, W. Alomoush, and M. Alshinwan, “Innovative energy-efficient proxy reencryption for secure data exchange in wireless sensor networks,” IEEE Access, vol. 12, pp. 23 290–23 304, 2024, doi: 10.1109/ACCESS.2024.3360488.
[3] B. S. Sharmila and R. Nagapadma, “Quantized autoencoder (QAE) intrusion detection system for anomaly detection in resource-constrained IoT devices using RTIoT2022 dataset,” Cybersecurity, vol. 6, no. 1, p. 41, 2023, doi: 10.1186/s42400-023-00178-5.
[4] T. M. Nguyen, H. H.-P. Vo, and M. Yoo, “Enhancing intrusion detection in wireless sensor networks using a GSWO-CatBoost approach,” Sensors, vol. 24, no. 11, p. 3339, 2024, doi: 10.3390/s24113339.
[5] V. K. Pandey, S. Prakash, T. K. Gupta, P. Sinha, T. Yang, R. S. Rathore, L. Wang, S. Tahir, and S. T. Bakhsh, “Enhancing intrusion detection in wireless sensor networks using a Tabu search based optimized random forest,” Scientific Reports, vol. 15, pp. 1–19, 2025, doi: 10.1038/s41598-025-03498-3.
[6] J. B. Awotunde, F. E. Ayo, R. Panigrahi, A. Garg, A. K. Bhoi, and P. Barsocchi, “A multi-level random forest model-based intrusion detection using fuzzy inference system for Internet of Things networks,” International Journal of Computational Intelligence Systems, vol. 16, no. 1, p. 31, 2023, doi: 10.1007/s44196-023-00205-w.
[7] G. Liu, Z. Zhang, B. Jing, M. Zhang, and H. Li, “An enhanced intrusion detection model based on improved kNN in wireless sensor networks,” Sensors, vol. 22, no. 4, p. 1407, 2022, doi: 10.3390/s22041407.
[8] B. S. Sharmila and R. Nagapadma, “RT-IoT2022,” 2023, doi: 10.24432/C5QW3H.
[9] X. Zhong, Y. Liang, and Y. Li, “Energy-efficient and robust QoS control for wireless sensor networks using the extended Gur game,” Sensors, vol. 25, no. 3, p. 730, 2025, doi: 10.3390/s25030730.
[10] N. S. Albalawi, Y. Alzahrani, N. Alsalmi, Y. Patidar, and M. Tolani, “Energy-efficient priority encoding strategies using machine learning based hybrid MAC protocol for wireless sensor networks,” Scientific Reports, vol. 15, p. 45054, 2025, doi: 10.1038/s41598-025-31752-1.
[11] D. Godfrey, B. Suh, B. H. Lim, K. C. Lee, and K.-I. Kim, “An energy-efficient routing protocol with reinforcement learning in software-defined wireless sensor networks,” Sensors, vol. 23, no. 20, p. 8435, 2023, doi: 10.3390/s23208435.
[12] U. Srilakshmi, S. A. Alghamdi, V. A. Vuyyuru, N. Veeraiah, and Y. Alotaibi, “A secure optimization routing algorithm for mobile ad hoc networks,” IEEE Access, vol. 10, pp. 14 260–14 269, 2022, doi: 10.1109/ACCESS. 2022.3144679.
[13] M. Aljawarneh, R. Hamdaoui, A. Zouinkhi, S. Alangari, and M. N. Abdelkrim, “Energy optimization for wireless sensor network using minimum redundancy maximum relevance feature selection and classification techniques,” PeerJ Computer Science, vol. 10, p. e1997, 2024, doi: 10.7717/peerj-cs.1997.
[14] K. Rashid, Y. Saeed, A. Ali, F. Jamil, R. Alkanhel, and A. Muthanna, “An adaptive real-time malicious node detection framework using machine learning in vehicular ad-hoc networks (VANETs),” Sensors, vol. 23, no. 5, p. 2594, 2023, doi: 10.3390/s23052594.
[15] N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P. Kegelmeyer, “SMOTE: Synthetic minority oversampling technique,” in Journal of Artificial Intelligence Research, vol. 16, 2002, pp. 321–357, doi: 10.1613/jair.953.
[16] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R.Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay, “Scikit-learn: Machine learning in Python,” Journal of Machine Learning Research, vol. 12, pp. 2825–2830, 2011.
Cite This Article
Choose your preferred format
Publisher's Note
The statements, opinions, and data presented in this article are solely those of the author(s) and do not necessarily represent those of ASPG, the journal, or its editors. ASPG and the editors disclaim responsibility for any harm arising from the use of any ideas, methods, instructions, or products described in this article, to the fullest extent permitted by applicable law.