Om 3
Om 3
a r t i c l e i n f o a b s t r a c t
Keywords: The adoption of the Internet of Things (IoT) in our technology-driven society is hindered by security and data
Deep learning privacy challenges. To address these issues, Artificial Intelligence (AI) techniques such as Machine Learning
Federated learning (ML) and Deep Learning (DL) can be applied to build Intrusion Detection Systems (IDS) that help securing IoT
Intrusion detection system
networks. Federated Learning (FL) is a decentralized approach that can enhance performance and privacy of the
Internet of things
data by training IDS on individual connected devices. This study proposes the use of unsupervised and supervised
Machine learning
DL models trained via FL to develop IDS for IoT devices. The performance of FL-trained models is compared to
models trained via non-FL using the N-BaIoT dataset of nine IoT devices. To improve the accuracy of DL models, a
randomized search hyperparameter optimization is performed. Various performance metrics are used to evaluate
the prediction results. The results indicate that the unsupervised AutoEncoder (AE) model trained via FL is the
best overall in terms of all metrics, based on testing both FL and non-FL trained models on all nine IoT devices.
1. Introduction mented in many applications. On the other hand, IoT networks them-
selves are not without challenges. A most frequent issue is the chal-
The Internet of Things (IoT) networks face significant security and lenge of resource-constrained; in terms of computing capability and
data privacy challenges due to their inherent characteristics such as het- power capacity, which can hinder the full deployment of sophisticated
erogeneity, scalability, and resource constraints. These challenges are intrusion detection system (IDS) on IoT devices. Furthermore, with the
exacerbated by the fact that IoT devices often collect and transmit sen- growing number of IoT devices connected to the internet, hackers are
sitive data, making them attractive targets for cyber-attacks. Despite the constantly devising new ways of attack. Therefore, there is a need to
security and privacy challenges hindering the total adoption of the IoT develop a more accurate IDS for the IoT using robust techniques like
in our technology-driven society, the benefits of interconnecting devices DL models. DL models, with their ability to learn complex patterns
and sensors to exchange information over the Internet without human and make predictions, are well-suited for detecting sophisticated cyber-
intervention outweigh these challenges. To better secure these systems attacks that may not be easily identifiable using traditional rule-based
and networks from potential security breaches, efforts are continually systems. Researchers proposed a Federated Learning (FL) intrusion de-
being made. Artificial Intelligence (AI) techniques, including Machine tection scheme that decentralizes the training of the IDS model imple-
Learning (ML) and Deep Learning (DL), have gained widespread adop- mented on the individual connected devices, allowing the possibility of
tion and are being used to ensure better security for IoT networks. These the learning and inference to be done locally on the devices [2]. FL al-
AI techniques are particularly suitable for IoT applications because of lows for decentralized learning across multiple devices while keeping
the massive amount of data generated by IoT devices connected to the the data on the original device. This enhances data privacy as sensitive
internet, and the ability of AI methods to analyze and process these big data does not need to be transferred to a central server for model train-
datasets. ing. By combining FL and DL, we achieve the best of both worlds. FL
In recent literature, using DL as an example has helped improve ensures privacy-preserving model training, while DL provides accurate
response latency in IoT device applications, enhanced energy con- and robust intrusion detection capabilities. This synergy addresses the
sumption, and provided more sophisticated protection to these systems unique challenges posed by IoT networks. FL has been used in different
[1]. The Convolutional Neural Networks (CNN) and the Long Short- fields to provide a more efficient system architecture, such as in cloud
Term Memory (LSTM) algorithms are well-established DL models imple- computing [3].
https://doi.org/10.1016/j.csa.2024.100068
Received 9 October 2023; Received in revised form 31 March 2024; Accepted 2 August 2024
Available online 3 August 2024
2772-9184/© 2024 The Authors. Publishing Services by Elsevier B.V. on behalf of KeAi Communications Co., Ltd. This is an open access article under the CC
BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
B. Olanrewaju-George and B. Pranggono Cyber Security and Applications 3 (2025) 100068
Several studies have considered the deep autoencoder (AE) model Zhang et al. built a platform based on FL for IoT that has a module
as an unsupervised learning model in FL-based IDS for IoT devices [4]. for device anomaly data detection and another module for realistic eval-
Also, other researchers have considered a supervised Deep Neural Net- uation of FL on IoT devices [8]. The overall design comprises a dataset,
work (DNN) model for FL-based IDS for IoT devices [5]. However, to model, algorithm, and system design. The software architecture con-
the best of our knowledge, no single study brings both the unsupervised sists of the application layer, the algorithm layer, and the infrastructure
and the supervised DL models together under one study over a recent IoT layer supporting the implementation of FL on AI-enabled IoT edge de-
device dataset for a clearer understanding of their performance in IoT vices such as Raspberry Pi. Two recent datasets (N-BaIoT and LANDER)
applications. The combination of unsupervised and supervised learning are combined in this work with a Deep AE model for anomaly detec-
models is significant in the context of IDS for IoT due to the following tion. Results obtained using accuracy, precision and false positive rate
reasons: as metrics demonstrate the efficacy of FL in detecting a large range of
attack types.
• Unsupervised learning models like AEs can learn the normal behav-
Rahman et al. proposed a FL-based scheme for IoT intrusion detec-
ior of IoT devices by reconstructing the input data. They can detect
tion to decentralize the training of the IDS model to be done on the in-
anomalies by identifying data instances that deviate significantly
dividual connected devices, allowing the possibility of the learning and
from the normal behavior.
inference to be done locally on the devices [2]. These help to maintain
• Supervised learning models can then classify these anomalies into
the privacy of the data exchanged across connected devices and can en-
specific types of attacks based on labeled attack data. This combina-
hance accuracy by exchanging updates from neighboring devices in the
tion allows for effective detection and classification of both known
network using a remote server. Results obtained suggest that in terms
and unknown cyber-attacks.
of model accuracy in detecting anomalies, the centralized system was
In the context of IDS for IoT, combining unsupervised AEs (for fea- best. On the other hand, the FL approach could reach similar accuracy
ture learning) with supervised DL models (for classification) within the with better data privacy compared to the centralized approach.
FL framework ensures robustness, privacy, and accurate intrusion de- Khan et al. proposed an IDS based on DL methods to address the
tection. susceptibility of the MQTT protocol during communication within IoT
In this study, we build and evaluate unsupervised and supervised DL devices in a network [5]. Two datasets are combined in this study to
models for detecting anomalous events in network traffic through the evaluate and compare the developed system’s performance. Compari-
IoT devices, such as webcams, doorbells, baby monitors, thermostats, son is done with conventional ML models such as the DT, RF, NB, and
and security cameras. Using a publicly available and very detailed KNN. Other DL models such as the LSTM, and GRU, are also compared.
dataset that captures recent attack features for IoT intrusion detection Results obtained suggests the proposed Deep Neural Network (DNN)
studies, the DL models are trained to evaluate the results in the con- model attains the highest accuracy of 97.13 % compared to the LSTM
fusion matrix, accuracy, precision, F1-Score, True Positive Rate (TPR), and GRU models in one of the compared datasets.
and False Positive Rate (FPR) for detecting anomalous events. This de- Attota et al. combined multiple IoT data with FL methods to train
tection will be achieved by combining the efficiency of DL models in an IDS system that detects, classifies and defends against various at-
handling complex tasks with a FL approach that decentralizes the train- tacks [9]. Results obtained suggest the approach has higher accuracy
ing process of the intrusion detection models. We hope that this combi- when compared to conventional non-FL methods. To test the IoT de-
nation of DL methods with FL will improve both efficiency and robust- vices using FL methods, an experiment is performed using the PySyft
ness of IoT devices anomaly detection compared to the non-FL model. DL framework with ten vital IoT devices. The dataset used in this study
Hence, we propose a FL based IDS for IoT using unsupervised and su- is the lightweight MQTT protocol dataset.
pervised DL models. The unsupervised DL model proposed is the deep Shahid et al. [10] proposed a similar FL IDS for IoT devices similar
AE model. An autoencoder is a neural network that learns to repre- to [9]. However, the ML models used are the Logistic Regression (LR)
sent its input data in a lower-dimensional space. This is done by first and the Multi-label classification (MLC) model. The NSL-KDD dataset
compressing the input data, and then reconstructing it from the com- is selected for the study. The FL experiment is performed using Python
pressed representation. The compression process ensures that the au- Libraries and PySyft to create virtual instances of FL clients.
toencoder learns the most important features of the input data, and Hezam et al. [11] studied the use of deep learning approaches to de-
the reconstruction process ensures that the autoencoder learns the re- tect Botnet attacks in IoT environment. The study implemented three
lationships between these features. The supervised DL models proposed DL algorithms: recurrent neural network (RNN), convolutional neu-
is the DNN model with three layers. For comparison, the FL model re- ral network, and long short-term memory (LSTM)-RNN to counter dis-
sults will be compared to non-FL model results using several recent IoT tributed denial of service (DDoS) attacks targeting IoT networks. N-
devices. BaIoT dataset is used. Results obtained suggests the RNN achieved ac-
The remainder of this paper is arranged as follows. Section 2 presents curacy of 89.75 %.
related work on IDS for IoT network. Section 3 describes the meth- Alkahtani and Aldhyani [12] used CNN-LSTM model to botnet attack
ods used in the study: the dataset, data pre-processing process, and DL in IoT applications. The N-BaIoTdataset was used and the experiment
and FL models are discussed. Section 4 explains our experiment setup. results shows that CNN-LSTM shows best performance with accuracies
The experiment results are discussed and analyzed in Section 5. Finally, of 90.88 %.
Section 6 draws the conclusion. Campos et al. [13] proposed an FL-enabled IDS approach based on a
multi-class classifier considering different data distributions for the de-
2. Related work tection of different attacks in IoT scenarios. This study is implemented
using the recent ToN-IoT dataset. An aggregation function known as the
Meidan et al. proposed an anomaly detection model using deep AE. Fed+ is proposed against the conventional FedAvg algorithm. Its advan-
The study used N-BaIoT dataset. The study showed that the deep AE tage is that it mitigates the limitation of the FedAvg algorithm caused
model performed better than other models (local outlier factor (LOF), by convergence issues in scenarios with non-iid and highly skewed data.
one-class SVM, and Isolation Forest) [6]. To deploy the FL framework on real IoT devices, a simulated and dis-
Intelligent detection of IoT botnet using ML and DL is proposed by tributed testbed called the IBMFL is adopted. Evaluation of results ob-
Kim et al. [7]. The study used N-BaIoT dataset to evaluate the perfor- tained suggests that the Fed+ aggregator performed better than the Fe-
mance of the proposed method. The study implemented several DNN dAvg algorithm based on the evaluation with the mixed scenario dataset.
models: CNN, RNN, and LSTM. The simulation results showed that CNN Om Kumar et al. [14] studied the use of recurrent kernel convolu-
performed better than other models. tional neural network in IDS for IoT. The study is implemented using
2
B. Olanrewaju-George and B. Pranggono Cyber Security and Applications 3 (2025) 100068
N-BaIoT dataset. The study shows that the RCNN model obtains preci- 1. The training label is created by setting the normal training set to rep-
sion of 92.27 % and F1-score of 94.40 %. resent it. Then a random sample of the abnormal data is created and
concatenated with the normal testing set created earlier. They are shuf-
3. Methodologies fled, and mixed data between the normal testing set and the abnormal
data is created. Then a label is created for the mixed data. Subsequently,
This section introduces the dataset used and data pre-processing the normal training set, the normal threshold set, and the mixed data
steps of all the devices data. are scaled using a scaler function that returns the data between 0 and
1. The aim is to use the scaled normal threshold set for the computation
of a threshold that determines the normal and abnormal observations.
3.1. Dataset
The scaled mixed data will be used for the evaluation of the model. Fur-
thermore, the scaled normal threshold set, the mixed data, the mixed
The publicly available dataset that captures recent attack features for
data label, and the training label are converted to tensors to fit the data
IoT intrusion detection studies called the N-BaIoT dataset [6] is used.
modeling requirements in Python. The data is thereafter loaded onto
The dataset was developed due to the lack of public botnet datasets
the device as part of its data modeling process in Python’s PyTorch li-
for anomaly detection applications. To create this dataset, nine actual
brary. A similar data pre-processing module is built to test IoT devices
traffic data are obtained from commercial IoT devices infected with the
for Federated modeling.
two most common IoT-based botnets – Mirai and BASHLITE. The dataset
The high-level methodologies diagram of the study is shown in Fig. 2.
characteristics are multivariate and sequential. It is most suited for clas-
sification and clustering tasks. There are 7,062,606 instances with 115
3.4. Models development
distinct features. The malicious or abnormal data is divided into 10 at-
tacks, carried out by the two powerful botnets that have shown their
In our FL framework, the unsupervised AE and other supervised mod-
harmful capabilities in several applications. Therefore, the data com-
els function as follows:
prises ten classes of attacks and one normal or benign class. The N-BaIoT
dataset was selected due to its relevance to real-world IoT environments • Each IoT device trains an AE locally on its data to learn the nor-
and its comprehensive coverage of various IoT device types and network mal behavior. The AE model parameters are then sent to the central
activities. This dataset contains network traffic data collected from nine server.
different IoT devices, including smart home appliances and wearable de- • The server aggregates these parameters to create a global AE model,
vices, under both normal and attack conditions. Therefore, it provides a which is sent back to the devices for further local training. This pro-
diverse and representative sample of the network traffic patterns typi- cess is repeated until the global AE model converges.
cally encountered in IoT deployments, making it suitable for evaluating • The anomalies detected by the AE are then classified into specific
the effectiveness of IDS solutions in practical scenarios. Under the attack types of attacks using supervised models trained in a similar feder-
condition, the nine IoT devices has been infected by Mirai and BASH- ated manner.
LITE malware.
We used the Random Search hyperparameters optimization tech-
nique [15] to find the best parameters for compiling and building an
3.2. Data analysis efficient DL model. Following that, the best hyperparameters were ob-
tained and utilized to train DL models on the training data. Randomized
Fig. 1 show the percentage distribution of all nine IoT devices data search for hyperparameter optimization is chosen for its ability to effi-
in terms of the malicious and normal data features. ciently explore a wide range of hyperparameter configurations without
exhaustive grid search. This approach involves randomly selecting hy-
3.3. Data pre-processing perparameter values from predefined ranges and evaluating their perfor-
mance, thus providing a more comprehensive exploration of the hyper-
The data is pre-processed by first separating normal data and abnor- parameter space. By leveraging randomness, randomized search avoids
mal data into their respective columns on the data table. Normal data is being trapped in local optima and can uncover hyperparameter settings
represented with 0, while abnormal (attacks) data is represented with that yield superior performance. This method improves the accuracy of
3
B. Olanrewaju-George and B. Pranggono Cyber Security and Applications 3 (2025) 100068
DL models by fine-tuning hyperparameters to better suit the character- cess unlabeled data and train a model on edge devices. To address this
istics of the dataset and the complexity of the model, ultimately leading challenge, we have developed an unsupervised deep learning approach
to improved generalization and predictive performance. that uses autoencoders to learn from unlabeled data.
Several variants exist to handle different data patterns and perform
4. Experimental setup specific functions. Its structure consists of the encoding and decoding
parts. The former compresses the input data into an encoded representa-
This section describes the methods used to build the unsupervised tion, while the latter decompresses the knowledge representations and
and supervised DL models. It details the steps used to build the FL al- then reconstructs the data back to the original form [6]. Just like the
gorithm, the hyperparameter optimization performed, training the FL CNN and the RNN algorithms, the DNN algorithm is a special type of
and non-FL DL models, evaluating and testing the trained FL and non-FL NN algorithm that is very efficient in extracting non-linear features from
models using the nine client IoT devices data, with the Accuracy, Recall, data [19]. It has become very popular in several AI applications, which
F1-score, True Positive Rate, and False Positive Rate metrics. The exper- include image classification tasks, speech recognition, computer vision,
imental setup involved training and evaluating DL models both within etc. [20].
the Federated Learning (FL) framework and using traditional non-FL In operation, the DNN architecture receives its data via the input
methods. For FL-trained models, each IoT device acted as a client, locally layer. The linear layer is then applied to perform a linear transforma-
training its model on its data while periodically synchronizing updates tion operation on the input data received from the input layer. Other
with a centralized coordinator. Performance evaluation criteria included parameters in this layer are the size of the input sample and the size
various metrics such as accuracy, precision, recall, and F1-score. These of each output sample. The linear layer learns using additive bias. Af-
metrics were used to assess the models’ abilities to accurately detect and ter this operation, a non-linear activation function layer is applied to
classify intrusions while considering factors such as false positives and the weighted sum of the linear network output values from the previ-
false negatives. ous step, to reduce the linearity and convert it to a non-linear function.
Next, at this point to avoid overfitting the model, a batch normaliza-
4.1. Deep learning model tion operation can be added. To further reduce overfitting, a dropout
regularizer can also be added. The dropout layer works by discarding
One unsupervised and one supervised DL model are selected and some of the function nodes and reducing dependencies between them
built to evaluate the performance of anomaly detection and FL. The DL [19]. Specifically, the dropout layer randomly zeros some of the input
models built include the AE and the DNN. Several studies have applied tensor elements during training with the probability it obtains from a
the DNN, CNN, LSTM, and AE models in developing IDS for IoT anomaly Bernoulli distribution. Several linear layers with activation functions,
detection applications [5,16–18]. dropout layers, and batch normalization layers can be stacked to learn
However, very few studies have considered both unsupervised and more complex features.
supervised DL models for IDS in IoT applications using FL methods and In this study, the proposed network structure is a deep AE with an
recent IoT device datasets. AE models are designed and trained to recre- encoder layer, a hidden layer, and a decoder layer. Fig. 3 shows the
ate the input vector, contrary to other DL models that predict class la- deep AE architecture built in this study. Here, the encoder and the de-
bels. Its training is unsupervised, and the purpose of the network is to coder parts are seen. In operation, the encoder begins by receiving the
encode data in both low and high dimensionality spaces and achieve normal training set, which in our case is the IoT device’s data to train
feature extraction. Deep autoencoders can identify and extract the im- the algorithm. Also, in this study, only the normal features were used
portant features from complex data, which can be used for a variety of to train the detection model. In this study, 115 features are the input to
tasks, such as classification, clustering, and dimensionality reduction. this encoder linear layer. Similar to Medan et al. [6], only 75 % of the
When data from IoT devices is collected and stored in a central server input features are allowed at the first linear layer. This is followed by a
for model training, there is a risk that this data could be stolen or com- hyperbolic tangent activation function to add non-linearity to the input
promised in a data breach. This could expose sensitive information such data. A second linear layer is added with 50 % of the input features and
as the IP addresses, MAC addresses, and open ports of individual IoT a hyperbolic tangent function. In the third linear layer, only 33.3 % of
devices. This information could then be used by attackers to hack into the input features are allowed with the hyperbolic tangent function. In
these devices or to launch denial-of-service attacks. In this study, FL in- the fourth layer, a linear layer with only 25 % of the input features and
trusion detection scheme that decentralizes the training of the IDS model a hyperbolic tangent function are added. The encoder is contained in a
implemented on the individual connected devices, allowing the possi- sequential layer and performs the function of compressing the input at
bility of the learning and inference to be done locally on the devices. each of the linear layers into an encoded representation. Once done, the
When data is not collected and stored in one place, it is difficult to pro- output is transmitted to the decoder part.
4
B. Olanrewaju-George and B. Pranggono Cyber Security and Applications 3 (2025) 100068
5
B. Olanrewaju-George and B. Pranggono Cyber Security and Applications 3 (2025) 100068
Table 1 Table 2
Performance metrics. Optimal Parameters Used to Build the AE DL model.
Performance Metric Definition IoT Initial Learning Batch Max. Training Optimizer
𝑇 𝑃 +𝑇 𝑁 Device rate size Epoch Algorithm
Accuracy (𝑇 𝑃 +𝑇 𝑁+𝐹 𝑃 +𝐹 𝑁 )
𝑇𝑃 1 0.01 256 40 SGD
Precision (𝑇 𝑃 +𝐹 𝑃 ) 2 0.01 64 20 Adam
𝑇𝑃
Recall (𝑇 𝑃 +𝐹 𝑁 ) 3 0.001 64 40 SGD
2 𝑥 𝑃 𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 𝑥 𝑅𝑒𝑐𝑎𝑙𝑙 4 0.0001 256 40 Adam
F1-Score (𝑃 𝑟𝑒𝑐 𝑖𝑠𝑖𝑜𝑛+𝑅𝑒𝑐 𝑎𝑙𝑙)
5 0.0001 128 20 SGD
6 0.001 128 10 Adam
7 0.0001 256 40 SGD
supervision. This is part of what the study investigates, to see how both 8 0.001 64 40 SGD
models are well suited for FL-based IDS in IoT device applications. 9 0.001 64 10 Adam
Table 3
4.2. Federated learning model
Optimal Parameters Used to Build the DNN DL model.
In this study, the Federated Averaging Algorithm with Momentum IoT Initial Learning Batch Max. Training Optimizer
(FedAvgM) was selected as inspired by [21]. The researchers reported Device rate size Epoch Algorithm
better performance of the algorithm compared to the Federated Aver- 1 0.001 128 40 Adam
aging Algorithm (FedAvg). The latter’s optimization process is similar 2 0.01 128 40 SGD
to that of the Stochastic Gradient Descent (SGD) algorithm. The former 3 0.01 128 10 SGD
4 0.01 64 20 SGD
leverages the SGD optimization process with momentum vector addition 5 0.001 128 40 SGD
while updating its weights. This is expected to enhance its accuracy in 6 0.001 128 20 SGD
performance. In operation, the FedAvgM aggregates the model’s weights 7 0.0001 128 40 SGD
received from every client and update the global model with updated 8 0.0001 128 20 SGD
9 0.0001 64 10 Adam
weights.
6
B. Olanrewaju-George and B. Pranggono Cyber Security and Applications 3 (2025) 100068
in terms of comparing the FL and the non-FL training scheme. Here, it Fig. 7 shows some details. Here, we see that both the unsupervised
is observed that both schemes compete at par based on all metrics ex- and the supervised DL models compete at par in terms of all metrics,
cept the FPR metric. However, it is showed, based on this metric, that except in terms of the FPR. Hence, using this metric, it is evident that
training the DNN model via the FL training scheme is best. the unsupervised AE DL trained via the FL training scheme is best. The
In addition, to have a broader view of how all models performed AE trained via the non-FL training scheme is second and even better
under all training schemes, than the DNN trained via the FL scheme. These show the capability of
7
B. Olanrewaju-George and B. Pranggono Cyber Security and Applications 3 (2025) 100068
the unsupervised AE model over the supervised DNN model for anomaly Practical considerations for implementing the proposed Intrusion De-
detection applications in IoT devices. One possible reason why FL can tection System (IDS) approach in real-world IoT environments involve
improve FPR metric in anomaly detection is that it can learn from di- several key aspects. Firstly, ensuring compatibility and interoperabil-
verse and heterogeneous data sources without compromising their qual- ity with existing IoT devices and network infrastructure is essential for
ity or security [23]. This can help the model capture the variability and seamless integration. Secondly, addressing resource constraints on IoT
complexity of normal and abnormal data patterns more accurately and devices, such as limited computational power and memory, requires op-
robustly. Anomaly patterns can vary across different devices or servers timization of DL models and FL algorithms for efficiency. Additionally,
due to unique characteristics of each local environment. FL allows mod- establishing robust communication protocols and security mechanisms
els to be trained on local data, enabling them to capture these local- for data transmission between devices and the centralized coordinator
ized anomaly patterns. By incorporating device-specific knowledge, the is crucial to safeguarding data privacy and integrity. Finally, ongoing
model can better distinguish between normal and anomalous instances, monitoring and maintenance are necessary to adapt the IDS to evolving
potentially leading to fewer false positives. In dynamic environments, threats and changes in the IoT environment over time.
new types of anomalies may emerge over time. FL’s ability to continu- In addition, to have a broader view of how all models performed
ally learn from local data means that models can adapt to these changes under all training schemes,
more effectively. This adaptability can result in better anomaly detec- Fig. 7 shows some details. Here, we see that both the unsupervised
tion and a lower FPR, as the model becomes more accurate over time. and the supervised DL models compete at par in terms of all metrics,
except in terms of the FPR. Hence, using this metric, it is evident that
6. Discussion the unsupervised AE DL trained via the FL training scheme is best. The
AE trained via the non-FL training scheme is second and even better
The comparison between FL-trained and non-FL models provides than the DNN trained via the FL scheme. These show the capability of
valuable insights into the efficacy of FL in the context of IDS for IoT. the unsupervised AE model over the supervised DNN model for anomaly
Specifically, the results indicate that FL-trained models not only achieve detection applications in IoT devices. One possible reason why FL can
comparable or better performance than non-FL models but also offer the improve FPR metric in anomaly detection is that it can learn from di-
advantage of preserving data privacy by training models locally on indi- verse and heterogeneous data sources without compromising their qual-
vidual IoT devices. This highlights the potential of FL as a decentralized ity or security [23]. This can help the model capture the variability and
approach to enhancing the security and privacy of IoT networks while complexity of normal and abnormal data patterns more accurately and
maintaining high detection accuracy. robustly. Anomaly patterns can vary across different devices or servers
The findings of this study have broader implications for the field of due to unique characteristics of each local environment. FL allows mod-
IoT security, suggesting that the proposed approach of using FL with els to be trained on local data, enabling them to capture these local-
DL models can effectively address security and privacy challenges in ized anomaly patterns. By incorporating device-specific knowledge, the
IoT environments. By leveraging FL, IDS for IoT devices can achieve model can better distinguish between normal and anomalous instances,
robust threat detection capabilities while mitigating concerns related potentially leading to fewer false positives. In dynamic environments,
to centralized data storage and processing. Furthermore, the proposed new types of anomalies may emerge over time. FL’s ability to continu-
approach can be adapted to other network environments beyond IoT, ally learn from local data means that models can adapt to these changes
such as industrial control systems or smart city infrastructures, where more effectively. This adaptability can result in better anomaly detec-
similar security and privacy concerns exist. tion and a lower FPR, as the model becomes more accurate over time.
8
B. Olanrewaju-George and B. Pranggono Cyber Security and Applications 3 (2025) 100068
Table 4
Performance comparison of the proposed FL- DNN methods.
Performance Metrics Auto-Encoder [6] CNN [7] RNN [7] LSTM [7] FL [8] LSTM-RNN [11] CNN-LSTM [12] RCNN (Om [14]) Proposed FL-DNN
Table 5
Accuracy comparison of the proposed FL- DNN methods with other ML models.
Performance Metrics Logistic Regression Random Forest SVM Naïve Bayes Proposed FL-DNN
The performance comparison of our proposed FL-DNN with other CRediT authorship contribution statement
studies that used N-BaIoT dataset is shown in Table 4. The performance
comparison with reference ML models is shown in Table 5. Babatunde Olanrewaju-George: Writing – review & editing, Writ-
The limitations of the study include scalability issues related to FL, ing – original draft, Visualization, Validation, Software, Methodology,
particularly in large-scale IoT deployments with a large number of de- Investigation. Bernardi Pranggono: Writing – review & editing, Val-
vices. Additionally, the adaptability of the proposed approach to dif- idation, Supervision, Resources, Project administration, Methodology,
ferent types of IoT devices and network configurations may pose chal- Funding acquisition, Conceptualization.
lenges and require further investigation. Furthermore, the practical de-
ployment of the FL framework in real-world IoT environments may en- Funding
counter obstacles such as network connectivity constraints or device het-
erogeneity, which need to be addressed for successful implementation. The work was supported in part by Sheffield Hallam University.
Future research directions could explore the integration of other DL
models or advanced FL techniques to further enhance the effectiveness
Data Availability Statement
of IDS for IoT security. For example, incorporating recurrent neural net-
works (RNNs) or graph neural networks (GNNs) may improve the detec-
The N-BaIoT dataset is available at http://archive.ics.uci.edu/ml/
tion of temporal or structural patterns in IoT network traffic. The use of
datasets/detection_of_IoT_botnet_attacks_N_BaIoT.
ensemble methods for improved performance. Additionally, enhancing
the FL framework with techniques such as differential privacy or secure References
aggregation could strengthen the privacy guarantees of FL-trained mod-
els in distributed IoT environments. [1] N.N. Alajlan, D.M. Ibrahim, TinyML: enabling of inference deep learning mod-
els on ultra-low-power IoT edge devices for AI applications, Micromachines.
7. Conclusion (Basel)Micromachines. (Basel) 13 (2022) 851, doi:10.3390/mi13060851.
[2] S.A. Rahman, H. Tout, C. Talhi, A. Mourad, Internet of things intrusion detec-
tion: centralized, on-device, or federated learning? IEEE Netw. 34 (2020) 310–317,
In this study, the FL-based IDS for IoT using unsupervised and su- doi:10.1109/MNET.011.2000286.
pervised DL models is evaluated. The proposed method compares the [3] C.L. Stergiou, K.E. Psannis, B.B. Gupta, InFeMo: flexible big data management
through a federated cloud system, ACM Trans. Internet Technol. 22 (46) (2021)
performance of unsupervised and supervised DL models in securing the
1–46 22, doi:10.1145/3426972.
IoT network. To enhance security and also handle the data privacy chal- [4] K. Yadav, B.B. Gupta, C.-H. Hsu, K.T. Chui, Unsupervised federated learning
lenges of the previous methods of developing the anomaly detection based IoT intrusion detection, in: 2021 IEEE 10th Global Conference on Consumer
system, the FL training scheme is proposed, which is further compared Electronics (GCCE). Presented at the 2021 IEEE 10th Global Conference on Con-
sumer Electronics (GCCE), 2021, pp. 298–301, doi:10.1109/GCCE53005.2021.
to the non-FL training scheme. To achieve this, one unsupervised AE 9621784.
model and one supervised DNN model are built and trained using the [5] Muhammad Almas Khan, Muazzam A. Khan, S.U. Jan, J. Ahmad, S.S. Jamal,
publicly available and very recent IoT dataset for nine devices. To fur- A.A. Shah, N. Pitropakis, W.J. Buchanan, A deep learning-based intrusion detection
system for MQTT enabled IoT, Sensors 21 (2021) 7016, doi:10.3390/s21217016.
ther make the model robust, and contrary to previous studies, a hy- [6] Y. Meidan, M. Bohadana, Y. Mathov, Y. Mirsky, A. Shabtai, D. Breit-
perparameter tuning of the DL model parameters is performed before enbacher, Y. Elovici, N-BaIoT—network-based detection of iot botnet at-
building the models. To further make the model more robust, the FL tacks using deep autoencoders, IEEE Pervasive Comput. 17 (2018) 12–22,
doi:10.1109/MPRV.2018.03367731.
algorithm called the FedAvgM is adopted in this study. Both FL and [7] J. Kim, M. Shim, S. Hong, Y. Shin, E. Choi, Intelligent detection of iot bot-
non-FL training is performed using all nine IoT devices and their data. nets using machine learning and deep learning, Appl. Sci. 10 (2020) 7009,
The results of the study highlight the performance of the unsupervised doi:10.3390/app10197009.
[8] T. Zhang, C. He, T. Ma, L. Gao, M. Ma, S. Avestimehr, Federated learning for internet
AutoEncoder (AE) model and other DL models trained both within the of things, in: Proceedings of the 19th ACM Conference on Embedded Networked
Federated Learning (FL) framework and using non-FL methods. Specif- Sensor Systems, SenSys ’21, Association for Computing Machinery, New York, NY,
ically, the unsupervised AE model demonstrated superior performance USA, 2021, pp. 413–419, doi:10.1145/3485730.3493444.
[9] D.C. Attota, V. Mothukuri, R.M. Parizi, S. Pouriyeh, An ensemble multi-view fed-
across various evaluation metrics when tested on all nine IoT devices.
erated learning intrusion detection for IoT, IEEE Access. 9 (2021) 117734–117745,
Furthermore, the comparison between FL-trained and non-FL models re- doi:10.1109/ACCESS.2021.3107337.
vealed the effectiveness of FL in enhancing the performance and privacy [10] O. Shahid, V. Mothukuri, S. Pouriyeh, R.M. Parizi, H. Shahriar, Detecting net-
of IDS for IoT devices. work attacks using federated learning for IoT devices, in: 2021 IEEE 29th In-
ternational Conference on Network Protocols (ICNP). Presented at the 2021
IEEE 29th International Conference on Network Protocols (ICNP), 2021, pp. 1–6,
Declaration of competing interest doi:10.1109/ICNP52444.2021.9651915.
[11] A.A. Hezam, S.A. Mostafa, A.A. Ramli, H. Mahdin, B.A. Khalaf, Deep learn-
The authors declare that they have no known competing financial ing approach for detecting botnet attacks in IoT environment of multi-
ple and heterogeneous sensors, in: N. Abdullah, S. Manickam, M. Anbar
interests or personal relationships that could have appeared to influence (Eds.), Advances in Cyber Security, Springer, Singapore, 2021, pp. 317–328,
the work reported in this paper. doi:10.1007/978-981-16-8059-5_19.
9
B. Olanrewaju-George and B. Pranggono Cyber Security and Applications 3 (2025) 100068
[12] H. Alkahtani, T.H.H. Aldhyani, Botnet attack detection by using CNN-LSTM model [18] V. Rey, P.M. Sánchez Sánchez, A. Huertas Celdrán, G. Bovet, Federated learn-
for internet of things applications, Security Commun. Networks 2021 (2021) ing for malware detection in IoT devices, Comput. Netw. 204 (2022) 108693,
e3806459, doi:10.1155/2021/3806459. doi:10.1016/j.comnet.2021.108693.
[13] E.M. Campos, P.F. Saura, A. González-Vidal, J.L. Hernández-Ramos, J.B. Bernabé, [19] P. Madan, V. Singh, D.P. Singh, M. Diwakar, B. Pant, A. Kishor, A hybrid deep learn-
G. Baldini, A. Skarmeta, Evaluating federated learning for intrusion detection in ing approach for ECG-based arrhythmia classification, Bioengineering 9 (2022) 152,
internet of things: review and challenges, Comput. Networks 203 (2022) 108661, doi:10.3390/bioengineering9040152.
doi:10.1016/j.comnet.2021.108661. [20] M.M. Forootan, I. Larki, R. Zahedi, A. Ahmadi, Machine learning and
[14] C.U. Om Kumar, S. Marappan, B. Murugeshan, P.M.R. Beaulah, Intrusion detection deep learning in energy systems: a review, Sustainability. 14 (2022) 4832,
model for iot using recurrent kernel convolutional neural network, Wireless Pers doi:10.3390/su14084832.
Commun. 129 (2023) 783–812, doi:10.1007/s11277-022-10155-9. [21] Hsu, T.-M.H., Qi, H., Brown, M., 2019. Measuring the effects of
[15] J. Bergstra, Y. Bengio, Random search for hyper-parameter optimization, J. Mach. non-identical data distribution for federated visual classification.
Learn. Res. 13 (2012) 281–305. https://doi.org/10.48550/arXiv.1909.06335.
[16] Y. Fan, Y. Li, M. Zhan, H. Cui, Y. Zhang, IoT defender: a federated transfer learning [22] P. Mishra, V. Varadharajan, U. Tupakula, E.S. Pilli, A detailed investigation and
intrusion detection framework for 5G IoT, in: 2020 IEEE 14th International Confer- analysis of using machine learning techniques for intrusion detection, IEEE Commun.
ence on Big Data Science and Engineering (BigDataSE). Presented at the 2020 IEEE Surv. Tutorials 21 (2019) 686–728, doi:10.1109/COMST.2018.2847722.
14th International Conference on Big Data Science and Engineering (BigDataSE), [23] F. Cavallin, R. Mayer, Anomaly detection from distributed data sources via feder-
2020, pp. 88–95, doi:10.1109/BigDataSE50710.2020.00020. ated learning, in: L. Barolli, F. Hussain, T. Enokido (Eds.), Advanced Information Net-
[17] V. Mothukuri, P. Khare, R.M. Parizi, S. Pouriyeh, A. Dehghantanha, G. Srivastava, working and Applications, Lecture Notes in Networks and Systems, Springer Interna-
Federated-learning-based anomaly detection for iot security attacks, IEEE Internet tional Publishing, Cham, 2022, pp. 317–328, doi:10.1007/978-3-030-99587-4_27.
Things J. 9 (2022) 2545–2554, doi:10.1109/JIOT.2021.3077803.
10