International Journal of Electrical and Computer Engineering (IJECE) Vol. 15, No. 2, April 2025, pp. 2479~2490 ISSN: 2088-8708, DOI: 10.11591/ijece.v15i2.pp2479-2490 2479 Journal homepage: http://ijece.iaescore.com Tackling the anomaly detection challenge in large-scale wireless sensor networks Tamara Zhukabayeva 1,2,3 , Aigul Adamova 1,3 , Lyazzat Zholshiyeva 1 , Yerik Mardenov 1,4 , Nurdaulet Karabayev 1,2 , Dilaram Baumuratova 1,4 1 Institute of Information Technology and Security, International Science Complex ASTANA, Astana, Kazakhstan 2 Faculty of Information Technology, L.N. Gumilyov Eurasian National University, Astana, Kazakhstan 3 Department of Computer Engineering, Astana IT University, Astana, Kazakhstan 4 School of Information Technology and Engineering, Astana International University, Astana, Kazakhstan Article Info ABSTRACT Article history: Received Jul 5, 2024 Revised Nov 4, 2024 Accepted Nov 20, 2024 One of the areas of ensuring the security of a wireless sensor network (WSN) is anomaly detection, which identifies deviations from normal behavior. In our paper, we investigate the optimal anomaly detection algorithms in a WSN. We highlight the problems in anomaly detection, and we also propose a new methodology using machine learning. The effectiveness of the k-nearest neighbors (KNN) and Z score methods are evaluated on the data obtained from WSN devices in real time. According to the experimental study, the Z score methodology showed a 98.9% level of accuracy, which was much superior to the KNN 43.7% method. In order to ensure accurate anomaly detection, it is crucial to have access to high-quality data when conducting a study. Our research enhances the field of WSN security by offering a novel approach for detecting anomalies. We compare the performance of two methods and provide evidence of the superior effectiveness of the Z score method. Our future research will focus on exploring and comparing several approaches to identify the most effective anomaly detection method, with the ultimate goal of enhancing the security of WSN. Keywords: Anomaly detection K-nearest neighbor Machine learning Wireless sensor networks Z score This is an open access article under the CC BY-SA license. Corresponding Author: Aigul Adamova Department of Computer Engineering, Astana IT University 55/11 Mangilik El, Astana IT University, 010000 Astana, Kazakhstan Email: aigul.adamova@astanait.edu.kz 1. INTRODUCTION Wireless sensor networks (WSN) represent modern solutions for interactions with the environment [1], [2]. Currently, as a result of the widespread use of WSN in a wide range of applications covering everyday life and industrial settings, the issues of ensuring the security of the information space are becoming increasingly complex. The report global wireless sensor networks marketby research and markets highlights the impact of WSN on the development of various industries that rely on automation and data-driven decision making [3]. A WSN uses sensors to monitor and control various processes, predict equipment failures and optimize resource utilization [4], [5]. Ensuring the security of WSN is an urgent task. There are many vulnerabilities in WSN, at the same time they are vulnerable to various types of attacks, such as denial-of-service attacks, physical attacks, node replication attacks, and traffic analysis attacks. Since data transmission is carried out via wireless technologies, the attack can be carried out from various remote locations at any time [6], [7]. The task of developing and implementing reliable security measures, such as anomaly detection, plays an important role in maintaining trust in WSN [8][10]. Anomaly detection is a