Algerian Journal of Sciences
Volume 2, Numéro 1, Pages 25-36
2025-09-30

Fedknn Aggregator For Fast Convergence And Low Overhead In Robust Fl-based Ids To Secure Smart Farming

Authors : Saadouni Rafika . Khacha Amina . Gherbi Chirihane . Harbi Yasmine . Aliouat Zibouda .

Abstract

The increasing reliance on IoT devices in smart farming systems has heightened the need for robust cybersecurity measures to protect against cyber threats. This paper presents an innovative Intrusion Detection System (IDS) framework designed to enhance the security of smart farming devices through Federated Learning (FL). This approach preserves privacy and enables distributed training across clients without sharing data. Our approach reduces communication overhead by achieving model convergence with only a few rounds. To accomplish this goal, we propose a novel aggregator algorithm called Federated K-Nearest Neighbors (Fed- KNN), which leverages the K-Nearest Neighbors (KNN) machine learning model. Additionally, we use a hybrid CNN-GRU model to construct our IDS, and we use a metaheuristic Genetic Algorithm (GA) to improve it. The framework optimizes nine key hyperparameters server-side and distributes them to clients for local training. Experimental results on the Edge-IIoT dataset demonstrate the effectiveness of the proposed method, achieving an accuracy of 99.97%, an F1-score of 99.90%, and a low false pos- itive rate (FPR) 2, 84×10−5% on multi-attack detection with just 4 rounds.

Keywords

Aggregation ; Smart Farming ; IDS ; GA ; KNN ; CNN ; GRU ; Edge-IIoT ; Federated Learning (FL)