RF-FedAvg: Federated learning-based random forest model for intrusion detection in wireless sensor networks
摘要
Wireless Sensor Networks (WSNs) play a pivotal role in modern applications, ranging from smart cities to environmental monitoring. However, their inherent vulnerability to security threats, such as denial-of-service attacks and unauthorized access, necessitates the implementation of robust intrusion detection systems (IDS). Traditional IDS frameworks are predominantly centralized, raising significant concerns about data privacy, leakage, and scalability. In this paper, we propose a novel federated learning-based Random Forest architecture (RF-FedAvg) for intrusion detection in WSNs that addresses these limitations. Our method enables decentralized model training across multiple clients without sharing raw data, thereby enhancing privacy and mitigating data leakage. Random Forest models are trained locally on each client and aggregated using a weighted FedAvg strategy at the central server. To reflect real-world deployment scenarios, we evaluate the model under varying client configurations (2 to 5 nodes) and incorporate data balancing techniques such as Random Under Sampling (RUS) and SMOTE to address class imbalance issues common in WSN datasets. Extensive experiments on WSN-DS and UNSW-NB15 datasets demonstrate that the RF-FedAvg model maintains high performance even with fewer clients and imbalanced data. The highest accuracy achieved was 99.67% on WSN-DS with SMOTE and 98.45% on UNSW-NB15, showcasing strong robustness and scalability. These results confirm the effectiveness of our federated learning-based IDS in providing a scalable, privacy-preserving, and reliable solution for intrusion detection in resource-constrained WSNs environments.