# StatAvg: Mitigating Data Heterogeneity in Federated Learning for Intrusion
Detection Systems

Pavlos S. Bouzinis2, Panagiotis Radoglou-Grammatikis34, Ioannis Makris2,
Thomas Lagkas5, Vasileios Argyriou6, Georgios Th. Papadopoulos7, Panagiotis
Sarigiannidis3 and George K. Karagiannidis89 1This project has received
funding from the European Union’s Horizon Europe research and innovation
programme under grant agreement No 101070450 (AI4CYBER). Disclaimer: Funded by
the European Union. Views and opinions expressed are, however, those of the
author(s) only and do not necessarily reflect those of the European Union or
European Commission. Neither the European Union nor the European Commission
can be held responsible for them.2P. S. Bouzinis and I. Makris are with
MetaMind Innovation P.C., Kila Kozani, 50100, Kozani, Greece - E-Mail:
<EMAIL_ADDRESS><EMAIL_ADDRESS>Radoglou-Grammatikis and P.
Sarigiannidis are with the Department of Electrical and Computer Engineering,
University of Western Macedonia, Campus ZEP Kozani, 50100, Kozani, Greece -
E-Mail<EMAIL_ADDRESS><EMAIL_ADDRESS>Radoglou-Grammatikis is
also with K3Y Ltd, William Gladstone 31, 1000, Sofia, Bulgaria - E-Mail:
<EMAIL_ADDRESS>Lagkas is with the Department of Computer Science,
Democritus University of Thrace, Kavala Campus, 65404, Kavala, Greece -
E-Mail<EMAIL_ADDRESS>Argyriou is with the Department of Networks and
Digital Media, Kingston University London, Penrhyn Road, Kingston upon Thames,
Surrey KT1 2EE, London, UK - E-Mail<EMAIL_ADDRESS>Th.
Papadopoulos is with the Department of Informatics and Telematics, Harokopio
University of Athens, Omirou 9, Tavros, GR17778, Athens, Greece - E-Mail:
<EMAIL_ADDRESS>K. Karagiannidis is with the Department of
Electrical and Computer Engineering, Aristotle University of Thessaloniki,
54124, Thessaloniki, Greece - E-Mails<EMAIL_ADDRESS>K. Karagiannidis is
also with the Artificial Intelligence & Cyber Systems Research Center,
Lebanese American University (LAU), 1102 2801 Beirut, Lebanon

###### Abstract

Federated learning (FL) is a decentralised learning technique that enables
participating devices to collaboratively build a shared Machine Learning (ML)
or Deep Learning (DL) model without revealing their raw data to a third party.
Due to its privacy-preserving nature, FL has sparked widespread attention for
building Intrusion Detection Systems (IDS) within the realm of cybersecurity.
However, the data heterogeneity across participating domains and entities
presents significant challenges for the reliable implementation of an FL-based
IDS. In this paper, we propose an effective method called Statistical
Averaging (StatAvg) to alleviate non-independently and identically (non-iid)
distributed features across local clients’ data in FL. In particular, StatAvg
allows the FL clients to share their individual data statistics with the
server, which then aggregates this information to produce global statistics.
The latter are shared with the clients and used for universal data
normalisation. It is worth mentioning that StatAvg can seamlessly integrate
with any FL aggregation strategy, as it occurs before the actual FL training
process. The proposed method is evaluated against baseline approaches using
datasets for network and host Artificial Intelligence (AI)-powered IDS. The
experimental results demonstrate the efficiency of StatAvg in mitigating non-
iid feature distributions across the FL clients compared to the baseline
methods.

###### Index Terms:

Artificial Intelligence, Cybersecurity, Data Heterogeneity, Federated
Learning, Intrusion Detection, non-iid, Statistical Averaging

##  I Introduction

In the dynamic era of smart technologies, including the Internet of Things
(IoT) [1], Artificial Intelligence (AI) [2] and 6G ultra-dense wireless
networks [3, 4], the attack surface increases significantly. In particular,
from single-step attacks, the attackers now have the ability to design and
execute multi-step attack scenarios, targeting multiple systems and domains in
a coordinated and synchronised manner. Some characteristic attack campaigns,
according to MITRE ATT&CK, are (a) C0034 - 2022 Ukraine Electric Power Attack
and (b) C0022 - Operation Dream Job. Moreover, the rapid evolution of AI
allows cyberattackers to create sophisticated cyberattacks that can adjust to
mitigation activities and relevant countermeasures. Generative AI agents are
able to automatically exploit one-day vulnerabilities. Finally, despite the
fact that AI can play a significant role in defensive mechanisms, adversarial
attacks [5] can mislead AI-enabled decision-making processes. Therefore, it is
evident that the presence of reliable and efficient intrusion detection
mechanisms is more necessary than ever.

Traditionally, Intrusion Detection Systems (IDS) rely on signature-based
methods, where predefined attack rules or patterns, referred to as signatures,
are identified and compared with the monitoring data, thus alerting a
potential threat if a match is found. For instance, Snort and Suricata are
popular IDS in this category. On the other hand, in recent years, both Machine
Learning (ML) and Deep Learning (DL) models have already demonstrated
significant promise as a means to detect cyberattacks [6]. However, it is
worth mentioning that these models need the presence of appropriate security
datasets that are often not publicly available, especially for critical
domains [6]. In addition, appropriate adjustments are required to re-train and
integrate these models. Finally, conventional ML/DL methods are conducted in a
centralised fashion, where a central entity collects all the necessary data
from endpoints to construct training datasets and afterwards generates the
ML/DL models. Although this approach successfully enables the detection of
intrusions, it raises privacy concerns since endpoints’ private data are
shared with third parties.

To alleviate privacy issues and mitigate communication overhead, Federated
Learning (FL) has been proposed as an inherently privacy-preserving
decentralised learning solution [7, 8]. According to the FL principles, the
participating clients are building an ML/DL model collaboratively with the aid
of a central entity (e.g., a central server). The salient feature of FL is
that clients transmit locally trained models to the server rather than raw
data. Afterwards, the server aggregates the received parameters, updates the
global model, and subsequently broadcasts it to the clients. As depicted in
Fig. 1, this workflow is repeated until convergence is achieved. Consequently,
the server has no access to clients’ raw datasets. However, despite the
benefits of FL, a notable challenge in the design of an FL-based IDS is the
existence of non-independently and identically distributed (iid) data among
clients, commonly referred to as data heterogeneity. In particular, if the
data (including both benign and attack patterns) is not representative across
the clients, the global model may become biased, thus working efficiently on
some cases but inaccurately on others. Next, the presence of non-iid data can
affect the federated training procedure in terms of delaying convergence.
Finally, communication issues may also arise, given that more communication
rounds might be required to ensure adequate model updates across the FL
clients.

In light of the aforementioned remarks, in this paper, we introduce the
Statistical Averaging (StatAvg) method to circumvent the challenges of non-iid
features of clients in FL. Due to different feature distributions across
clients, the local data normalisation process may differ from client to
client. This inconsistency may slow down or even prevent the convergence of
the federated global model since each local model is trained on a different
input distribution. To this end, StatAvg aims at producing global data
statistics that can serve as a universal normalisation for the local data of
each client. To achieve this, the server is responsible for collecting the
local statistics of the clients and afterwards aggregating them properly to
produce global data statistics. In this manner, clients normalise their local
data by sharing a common normalisation scaling, reflected by the global
statistics, aimed at mitigating the effects of non-iid features present in
their local datasets.

Therefore, the structure of this paper is organised as follows. Section II
discusses similar works in this field, thus drawing the motivation behind our
work and highlighting our contributions. Section III provides preliminary
information regarding FL. Next, section IV presents and analyzes StatAvg.
Finally, section V focuses on the evaluation analysis of StatAvg, while
section VI concludes this paper.

Figure 1: Federated Learning workflow.

##  II Related Work, Motivation and Contributions

###  II-A Related Work

Several works investigate the role and impact of FL in cybersecurity and, more
precisely, in the scope of intrusion detection. Some survey papers in this
field are listed in [9, 10, 11, 12, 13]. In [9], S. Agrawal et al. present a
comprehensive survey regarding the impact of FL within the scope of intrusion
detection, highlighting challenges and future directions. In [10], E. Campos
et al. provide a detailed comparison regarding (a) centralised, (b)
distributed and (c) FL-driven intrusion detection mechanisms for IoT
environments. Similarly, the authors in [11] discuss advances of FL within
cybersecurity applications in IoT ecosystems. In [12], S. Arisdakessian et al.
provide a comprehensive study regarding FL-driven intrusion detection, game
theory, social psychology and explainable AI. Finally, in [13], the authors
focus their attention on security and privacy issues regarding FL
applications. Next, we further discuss recent works that deliver FL-driven
IDS, taking into account data heterogeneity.

In [14], the authors introduce DeepFed, an FL-driven IDS for cyber-physical
systems. The architectural design of DeepFed relies on three main elements:
(a) Trust Authority, (b) Cloud Server and (c) $k$ Industrial Agents. The role
of the Trust Authority is to produce the encryption keys for the proposed
Pailier public-key cryptosystem utilised for the communication between the
Cloud Server and the Industrial Agents. Next, the Cloud Server is responsible
for the aggregation process, while the industrial agents focus on the local
training procedure. Four attacks are taken into consideration by the proposed
FL-driven IDS, namely (a) Reconnaissance Attacks, (b) Response Injection
Attacks, (c) Command Injection Attacks and (d) Denial of Service (DoS)
attacks. Moreover, two attacks targeting the FL process are considered: (a)
Eavesdropping of Data Resources and (b) Eavesdropping of Model Parameters. The
workflow of DeepFed follows five phases: (a) System Initialisation, (b) Local
Model Training by Industrial Agents, (c) Model Parameters Encryption by
Industrial Agents, (d) Model Parameters Aggregation by the Cloud Server and
(e) Local Model Updating by Industrial Agents. For the detection process, the
authors leverage a combined Convolutional Neural Network (CNN) - Gated
Recurrent Unit (GRU), while special attention is paid to the proposed Pailier-
based secure communication protocol for the communication between the Cloud
Server and the Industrial Agents. Finally, three evaluation metrics are
considered, namely Accuracy, Precision, Recall and F-Score, demonstrating the
detection efficiency of DeepFed.

In [15], D. C. Attota et al. describe MV-FLID, a multi-view FL-based IDS which
focuses on the detection of attacks against Message Queuing Telemetry
Transport (MQTT) communications within IoT environments. In particular, MV-
FLID adopts a multi-view approach, combining (a) bi-directional flow features
(Bi-Flow View), (b) un-directional flow features (Uniflow View) and (c) packet
features (Packet View). An FL model is generated for each of the previous
viewpoints. Regarding the feature selection process, the authors leverage the
Grey Wolf Optimizer (GWO) introduced by S. Mirjalili et al. in [16]. Next, the
federated training procedure follows, as depicted in Fig. 1. Finally, an
ensemble-based technique is used to combine the outcomes of the FL models in
order to provide a unified prediction outcome. Regarding the evaluation
process, the authors use four metrics: (a) Accuracy, (b) F1 Score, (c)
Precision and (d) Recall, thus demonstrating the overall detection
effectiveness of MV-FLID.

In [17], R. Zhao et al. provide a semisupervised FL scheme for intrusion
detection within IoT environments. The proposed scheme relies on CNN models,
while four phases are followed in an iterative manner within the FL fashion:
(a) client training, (b) knowledge distillation, (c) discrimination between
familiar and unfamiliar traffic packets and (d) hard-labelling and voting.
During the first phase, the clients train their CNNs with private local data.
In the second phase, knowledge distillation follows a teacher-student
approach, where a teacher model guides the training of a student model,
providing soft targets or logits. In this case, the FL server serves as the
teacher, aggregating the logits of each class from all clients and
broadcasting them to each client. Then, the clients use the global logits as
soft targets in order to train their local models, leveraging the distillation
loss between the predicted logits and the global logits. Next, a
discrimination network is used from the FL server to evaluate further the
predicted labels of each client’s CNN and provide feedback regarding the
quality of the labels. Finally, hard labelling and voting mechanisms take
place in order to consider only the labels from the majority of the FL clients
and proceed with the aggregation process.

In [18], the authors propose the FL-based Attention-Gated Recurrent Unit
(FedAGRU) to address, among others, the issue of different label distribution
across clients’ data, thus demonstrating performance gains over conventional
FL aggregation strategies. Moreover, in [19], H. Wang et al. propose a peer-
to-peer algorithm, namely P2PK-SMOTE, to train FL-driven anomaly detection
models in non-iid scenarios. The latter refers to inter and intra-imbalanced
classes across the FL clients. Additionally, S. Popoola et al. in [20] use the
Fed+ method [21] for FL-driven intrusion detection in heterogeneous networks.
The clients own datasets from various types of networks, such as industrial
IoT, wireless networks and wireless vehicular networks, while Fed+ facilitates
the generation of personalised local models with enhanced attack
classification performance. In [22], the authors take Fed+ a step further by
incorporating differential privacy techniques. Next, in [23], B. Weinger et
al. investigate data augmentation techniques to address class imbalance and
non-iid settings. The evaluation results indicate a performance improvement
compared with baselines that do not rely on data augmentation strategies.
Finally, in [24], H. Weixiang propose a clustering-enabled FL meta-learning
framework to tackle class imbalance and non-iid data.

###  II-B Motivation

Undoubtedly, the previous works offer valuable insights and methodologies.
However, in the majority of them, the assumption of iid across the clients is
not valid within realistic FL conditions. Conventional FL strategies like
FedAvg are not designed for handling non-iid data and may experience notable
performance degradation or even divergence when applied in such situations
[25]. Although the works [18, 19] and [23, 24, 17] successfully examine and
design FL-based IDS considering non-iid data, emphasis was mainly given to the
following cases: (a) class imbalance across clients datasets and/or different
label distributions and (b) different number of samples per client. On the
contrary, the authors in [20] study a broader aspect of non-iid settings by
considering heterogeneous datasets across the clients. However, personalised
FL methods such as Fed+ are employed, generating multiple personalised local
models instead of a unified global one.

A particular example of non-iid data among clients is the case of non-iid
features, which has generally received less attention in the FL-related
literature. Methods addressing this issue mainly rely on layer normalisation
[26] and batch normalisation [27] techniques. Specifically, [27] proposes
FedBN, a method that incorporates batch normalisation layers on local clients’
model, which are not included in the aggregation step at the server side.
Although FedBN has shown potential in mitigating non-iid features, it assumes
that clients possess batch normalisation layers and have been actively
involved in the FL training. Consequently, non-participating clients that may
want to access the global model are excluded, as the method cannot generate a
universally applicable global model. This fact implies limitations in
distributing the global model to additional entities. Finally, as per [28]
experimental study, none of the existing state-of-the-art FL methods and
aggregation strategies for non-iid data outperform the other ones in all
cases. Therefore, exploring novel techniques to address the impact of data
heterogeneity in terms of non-iid features, particularly within FL-based IDS,
which is still immature in the context of the mentioned challenge, is an
interesting and promising topic. To the best of our knowledge, the issue of
non-iid features among clients in FL-based IDS has received limited attention.

###  II-C Contribution

Based on the aforementioned remarks, in this paper, we introduce the StatAvg
method to circumvent the challenges of non-iid features in the scope of FL-
driven intrusion detection. The contributions of our work are summarised as
follows:

  * •

The StatAvg method is proposed to alleviate the effects of non-iid feature
distributions in FL. According to StatAvg, the FL clients calculate their
local data statistics, specifically the mean and variance, and transmit them
to the server. The server aggregates the clients’ local statistics to generate
global statistics. We prove mathematically that the aggregated global
statistics represent the true mean and variance of the combined datasets
across all clients. Afterwards, the server broadcasts the global statistics to
all clients, normalising their input features based on these global
statistics.

  * •

The global statistics produced by StatAvg can be interpreted as a universal
normalisation process that can be applied along with the global model. It is
important to emphasise that typically, a trained model should be accompanied
by the corresponding normalisation technique on the input data. Otherwise, the
model will be ineffective during inference. However, this aspect is often
overlooked in the existing literature. Therefore, StatAvg serves as a means to
offer a global normalisation technique that can be applied to the global model
by external entities that are not necessarily involved in the training
procedure.

  * •

The performance of StatAvg is evaluated through experiments on open datasets
for intrusion detection. Various FL aggregation strategies are used as
baseline methods for comparison. The demonstrated results showcase the
prevalence of StatAvg over the baselines in terms of evaluation metrics such
as the detection accuracy and the F1 score. Finally, some illustrative
insights are provided that justify the presence of clients’ non-iid features
on the examined intrusion detection datasets.

##  III Preliminaries of Federated Learning

We consider an FL environment consisting of $N$ clients, indexed as
$i\in\mathcal{N}=\\{1,2,...,N\\}$ and a server. Each client owns a dataset
$\mathcal{D}_{i}=\\{(\boldsymbol{x}^{j}_{i},y^{j}_{i})\in\mathbb{R}^{S}\times\mathbb{C}\\}^{D_{i}}_{j=1}$,
where $\boldsymbol{x}^{j}_{i}$ is the $j$-th input sample,
$D_{i}=|\mathcal{D}_{i}|$ is the number of samples and $S$ denotes the number
of features. Additionally, we denote $\mathbb{C}$ as the set to which the
label $y^{j}_{i}$ belongs, e.g., it could be a subset of the real numbers, a
set of categorical values for classification tasks, etc. In this paper,
$\mathbb{C}$ contains the labels of cyberattacks and will be described below
in this work, along with the description of the datasets used in the
evaluation experiments.

The overall dataset across all clients is denoted as
$\mathcal{D}=\underset{i\in\mathcal{N}}{\cup}\mathcal{D}_{i}$ and the size of
all training data is $D=\sum_{n=i}^{N}D_{i}$. The loss function of client $i$,
is defined as:

$F_{i}(\boldsymbol{w})\triangleq\frac{1}{D_{i}}\sum_{j=1}^{D_{i}}\phi\left(\boldsymbol{w},\boldsymbol{x}^{j}_{i},y^{j}_{i}\right),\quad\forall
i\in\mathcal{N},$ (1)

where $\phi(\boldsymbol{w},\boldsymbol{x}^{j}_{i},y^{j}_{i})$ captures the
error of model parameter $\boldsymbol{w}$ for the input-output pair
$(\boldsymbol{x}^{j}_{i},y^{j}_{i})$. The ultimate goal of the FL process is
to obtain the global parameter $\boldsymbol{w}$, which minimises the loss
function on the whole dataset.

$F(\boldsymbol{w})=\sum_{n=1}^{N}n_{i}F_{i}(\boldsymbol{w}),$ (2)

where $n_{i}=\frac{D_{i}}{D}$ is the proportion of data samples owned by
client $i$ relative to the entire dataset.

In a nutshell, the FL process is executed for a specified number of
communication rounds. At the $t$-th round, the server firstly broadcasts the
global model $\boldsymbol{w}^{(t)}$ to all clients. Each client $i$ updates
its local model $\boldsymbol{w}^{(t)}_{i}$ via a gradient-based method on the
loss function $F_{i}$ and uploads it to the server. Finally, the server
generates the global model $\boldsymbol{w}^{(t+1)}$ by using an aggregation
strategy of its preference. The aforementioned process is repeated for the
selected number of rounds until the convergence of the global model is
achieved.

Aligning with the definitions of [25] and [27], the occurrence of non-iid
features between clients is related to the following concepts:

  * •

Feature distribution skew (covariate shift): The marginal distributions
$P_{i}(\boldsymbol{x})$ varies across clients, even if
$P_{i}(y|\boldsymbol{x})$ is the same for all clients.

  * •

Same label, different features (concept drift): The conditional distributions
$P_{i}(\boldsymbol{x}|y)$ may vary across clients even if $P_{i}(y)$ is
common. As such, the same label $y$ can have different features
$\boldsymbol{x}$ for different clients.

Non-iid features may diminish the performance of FL, leading to unstable
training or even divergence of the global model. This occurs because each
local model is trained on a different input distribution, imposing challenges
during the server’s aggregation step.

##  IV StatAvg - Statistical Averaging

Traditionally, individual FL clients normalise their local data based on their
own local statistics, with the most prominent normalisation technique being
the z-score normalisation, i.e., clients subtract the mean from each data
sample of a given feature and then divide it with the standard deviation. This
is equivalent to shifting the input feature distribution to have a zero mean
and unit variance. Accordingly, in the testing phase, the testing dataset is
scaled based on the aforementioned normalisation, individually per client. In
the presence of non-iid features between clients, the local normalisation
process may significantly differ from client to client. As a result, this
variability may affect the convergence of the global FL model since each local
model is trained on a different input data distribution. To tackle the issue
of non-iid features across clients, our objective is to discover global
statistics that clients can share without requiring access to their raw data.
Typical statistical metrics include the mean and variance of the features,
whereas this study investigates the impact of these particular metrics.

In the light of the previous discussion, we proceed to compute the mean and
variance for each client’s features. The mean value across all samples of a
feature $s\in\mathcal{S}$ of client $i$, where $\mathcal{S}$ is the entire
feature set, is given as:

$\mu_{i,s}=\frac{1}{D_{i}}\sum^{D_{i}}_{j=1}x^{j}_{i,s}$ (3)

and $\boldsymbol{\mu}_{i}=(\mu_{i,1},\mu_{i,2},...,\mu_{i,S})$ is the vector
with all the means of each feature. Its is worth noting that $x^{j}_{i,s}$ is
the $s$-th entry of $\boldsymbol{x}^{j}_{i}$. Accordingly, the corresponding
variance is calculated as:

$\sigma^{2}_{i,s}=\frac{1}{D_{i}}\sum^{D_{i}}_{j=1}\left(x^{j}_{i,s}-\mu_{i,s}\right)^{2}$
(4)

and
$\boldsymbol{\sigma}^{2}_{i}=(\sigma^{2}_{i,1},\sigma^{2}_{i,2},...,\sigma^{2}_{i,S})$.
Hereinafter, with the term local statistics of client $i$, we refer to the
tuple $\\{\boldsymbol{\mu}_{i},\boldsymbol{\sigma}^{2}_{i}\\}$. The StatAvg
strategy aims at obtaining the global statistics
$\\{\boldsymbol{\mu}_{\mathrm{G}},\boldsymbol{\sigma}^{2}_{\mathrm{G}}\\}$ of
the overall dataset $\mathcal{D}$ by aggregating the local statistics
$\\{\boldsymbol{\mu}_{i},\boldsymbol{\sigma}^{2}_{i}\\}_{i\in\mathcal{N}}$. In
this manner, all clients can normalise their data based on global statistics,
which guarantees a common normalisation/scaling of the input data. The
detailed process of StatAvg is described in Algorithm 1.

Algorithm 1 StatAvg

1:if $t=0$ then

2: for each client $i\in\mathcal{N}$ do

3: calculate $\boldsymbol{\mu}_{i},\boldsymbol{\sigma}^{2}_{i}$ according to
(3), (4)

4: send $\boldsymbol{\mu}_{i},\boldsymbol{\sigma}^{2}_{i}$ to the server

5: server calculates the global statistics as:
$\boldsymbol{\mu}_{\mathrm{G}}=\sum_{i\in\mathcal{N}}n_{i}\boldsymbol{\mu}_{i},$
$\boldsymbol{\sigma}^{2}_{\mathrm{G}}=\sum_{i\in\mathcal{N}}n_{i}\left(\boldsymbol{\sigma}^{2}_{i}+(\boldsymbol{\mu}_{i}-\boldsymbol{\mu}_{\mathrm{G}})^{2}\right)$

6: server sends
$\boldsymbol{\mu}_{\mathrm{G}},\boldsymbol{\sigma}^{2}_{\mathrm{G}}$ to all
clients

7: for each client $i\in\mathcal{N}$ do

8: normalise input features as:
$\tilde{\boldsymbol{x}}^{j}_{i,s}=\frac{\boldsymbol{x}^{j}_{i,s}-\mu_{\mathrm{G},s}}{\sigma_{\mathrm{G},s}},\quad\forall
j\in\\{1,...,D_{i}\\},\,\,\forall s\in\mathcal{S}$

9:else execute conventional FL process

As can be seen, the StatAvg strategy occurs solely during the first round
($t=0$), prior to the actual FL training. Firstly, in steps 2 - 4, each client
calculates its local statistics and sends them to the server. Following that,
in steps 5 - 6, the server calculates the global statistics based on the
received local statistics and broadcasts them back to the clients. It is worth
mentioning that the operations in step 5 are carried out element-wise. The
rationale behind the aggregation technique used to obtain
$\boldsymbol{\mu}_{\mathrm{G}}$ and $\boldsymbol{\sigma}^{2}_{\mathrm{G}}$ is
explained later in this work. Afterwards, in steps 7 - 8, the clients
normalise their input features based on the global statistics by utilising
conventional z-score normalisation. It should be highlighted that the
communication overhead for exchanging the local and global statistics between
the clients and the server is negligible since it takes place solely during
the first round. Finally, at step 9, a conventional FL process follows, e.g.,
the FedAvg. The selection of the aggregation strategy at step 9 can vary
according to the particularities of the underlying FL task.

It should be again clarified that StatAvg focuses on the aggregation of
statistical metrics rather than local models $\boldsymbol{w}^{(t)}_{i}$,
facilitating its integration with any model aggregation strategy. Fig. 2
provides an illustration of StatAvg’s implementation. Finally, we stress that
through StatAvg, a universal input data normalisation technique is provided.
This is a crucial remark since a trained model should be paired with the
appropriate data normalisation technique to render it effective during
inference.

In the continue, we will show that $\boldsymbol{\mu}_{\mathrm{G}}$ and
$\boldsymbol{\sigma}^{2}_{\mathrm{G}}$ are the mean and variance of the
overall dataset $\mathcal{D}$. First, we assume that
$\mathcal{D}_{i}\cap\mathcal{D}_{k}=\emptyset,\,\forall
i,k\in\mathcal{N},\,i\neq k$. This implies that all local datasets are
pairwise disjoint. The assumption is reasonable, considering that each dataset
originates from a distinct client, thus making it highly unlikely - if not
impossible - for identical samples to appear across different local datasets.
To this end, we proceed to formulate the following proposition.

###### Proposition 1

Let $\boldsymbol{x}_{i,s}\in\mathbb{R}^{D_{i}}$ be the vector containing the
$s$-th feature across all samples of $\mathcal{D}_{i}$. Also, let
$\boldsymbol{z}_{s}=(\boldsymbol{x}_{1,s},...,\boldsymbol{x}_{N,s})$ be the
concatenation of all clients vectors, with
$\boldsymbol{z}_{s}\in\mathbb{R}^{D}$. The mean and variance of
$\boldsymbol{z}_{s}$ are given as

$\begin{split}\mu_{\mathrm{G},s}&=\sum_{i\in\mathcal{N}}n_{i}\mu_{i,s}\\\
\sigma^{2}_{\mathrm{G},s}&=\sum_{i\in\mathcal{N}}n_{i}\left(\sigma^{2}_{i,s}+(\mu_{i,s}-\mu_{\mathrm{G},s})^{2}\right).\end{split}$
(5)

###### Proof:

First, the notation of $s$ is dropped for the simplicity of presentation. It
is straightforward to compute the mean of $\boldsymbol{z}$ as:

$\begin{split}\mu_{\mathrm{G}}&=\frac{1}{D}\sum_{l=1}^{D}z_{l}=\frac{1}{D}\sum_{i=1}^{N}\sum_{j=1}^{D_{i}}x^{j}_{i}=\frac{1}{D}\sum_{i=1}^{N}D_{i}\sum_{j=1}^{D_{i}}\frac{x^{j}_{i}}{D_{i}}\\\
&=\sum_{i=1}^{N}n_{i}\mu_{i}.\end{split}$ (6)

Before examining $\sigma^{2}_{\mathrm{G}}$, first, it is noted that for the
local variances, it holds:

$\sigma^{2}_{i}n_{i}=\sum_{j=1}^{D_{i}}(x^{j}_{i}-\mu_{i})^{2},\quad\forall
i\in\mathcal{N}.$ (7)

Similarly, for $\boldsymbol{z}$ we get

$\begin{split}\sigma^{2}_{\mathrm{G}}D&=\sum_{l=1}^{D}(z_{l}-\mu_{\mathrm{G}})^{2}=\sum_{i=1}^{N}\sum_{j=1}^{D_{i}}(x^{j}_{i}-\mu_{\mathrm{G}})^{2}\\\
&=\sum_{i=1}^{N}\sum_{j=1}^{D_{i}}\left((x^{j}_{i})^{2}-2x^{j}_{i}\mu_{\mathrm{G}}+\mu^{2}_{\mathrm{G}}\right).\end{split}$
(8)

The inner sum in the last term of (8) can be expanded by adding and
subtracting $\mu^{2}_{i}$, as:

$\begin{split}&\sum_{j=1}^{D_{i}}\left((x^{j}_{i})^{2}-2x^{j}_{i}\mu_{\mathrm{G}}+\mu^{2}_{\mathrm{G}}+\mu^{2}_{i}-\mu^{2}_{i}\right)\\\
&=\sum_{j=1}^{D_{i}}\left((x^{j}_{i}-\mu_{i})^{2}+2x^{j}_{i}(\mu_{i}-\mu_{\mathrm{G}})+\mu^{2}_{\mathrm{G}}-\mu^{2}_{i}\right)\\\
&=\sum_{j=1}^{D_{i}}(x^{j}_{i}-\mu_{i})^{2}+2D_{i}\mu_{i}(\mu_{i}-\mu_{\mathrm{G}})+D_{i}\mu^{2}_{\mathrm{G}}-D_{i}\mu^{2}_{i}\\\
&=D_{i}\sigma^{2}_{i}+D_{i}\mu^{2}_{\mathrm{G}}-2D_{i}\mu_{i}\mu_{\mathrm{G}}+D_{i}\mu^{2}_{i}\\\
&=D_{i}\sigma^{2}_{i}+D_{i}(\mu_{i}-\mu_{\mathrm{G}})^{2}.\end{split}$ (9)

By combining (9) with (8) we conclude to

$\sigma^{2}_{\mathrm{G}}=\sum_{i\in\mathcal{N}}n_{i}\left(\sigma^{2}_{i}+(\mu_{i}-\mu_{\mathrm{G}})^{2}\right),$
(10)

which completes the proof. ∎

Proposition 1 provides a way to obtain the global mean and variance across the
whole dataset $\mathcal{D}$ for a given feature $s$. The proof can be easily
generalised $\forall s\in\mathcal{S}$, which gives rise to the vector
representation of the global mean and variance for each feature, i.e.,
$\boldsymbol{\mu}_{\mathrm{G}}$ and $\boldsymbol{\sigma}^{2}_{\mathrm{G}}$,
respectively. This result is used in step 5 of Algorithm 1 to derive the
global mean and variance.

Figure 2: Visual representation of StatAvg design and implementation.

##  V Evaluation Analysis

TABLE I: List of notations Parameter |  Description |  Parameter |  Description
---|---|---|---
$\mathcal{N}$ |  Set of clients |  $P(\cdot)$ |  Probability density function
$i$ |  Indexing of clients |  $\boldsymbol{\mu}_{i}$ |  The mean values vector of the features for the $i$-th client
$\mathcal{D}_{i}$ |  Dataset of client $i$ |  $\boldsymbol{\sigma}^{2}_{i}$ |  The variances vector of the features for the $i$-th client
$D_{i}$ |  Dataset size of client $i$ |  $\boldsymbol{\mu}_{\mathrm{G}}$ |  Global mean values vector
$\boldsymbol{x}^{j}_{i}$ |  $j$-th input sample of client $i$ |  $\boldsymbol{\sigma}^{2}_{\mathrm{G}}$ |  Global variances vector
$S$ |  Number of features |  $\boldsymbol{z}$ |  Concatenated vector
$s$ |  Index of features |  $z_{l}$ |  The $l$-th element of the vector $\boldsymbol{z}$
$y^{j}_{i}$ |  $j$-th label of client $i$ |  $t$ |  FL round index
$\mathcal{D}$ |  Overall dataset of all clients |  $n_{i}$ |  Proportion of data samples owned by client $i$
$D$ |  Size of the overall dataset |  $\boldsymbol{w}^{(t)}$ |  Global model at round $t$
$N$ |  Total number of clients |  $\boldsymbol{w}^{(t)}_{i}$ |  Local model of $i$-th client at round $t$

This section presents experiments conducted on different datasets to detect
intrusions in a federated setting. The effectiveness of the proposed strategy
StatAvg is evaluated by comparing it with various baseline methods.

###  V-A Evaluation Datasets

The experiments were conducted on the following well-known public datasets.

TON-IoT Dataset: Among others, the TON-IoT Dataset [29] includes operating
system data of Ubuntu versions 14 and 18, which is adopted in our work. More
specifically, it includes audit traces documenting memory activities within
the operating system. The dataset is suitable for training and designing host-
based IDS. Also, the dataset is composed of data stemming from various
physical or virtual devices belonging to the edge and cloud layers. The
description of the selected features is provided in Table II. Furthermore, the
attacks on the host system that serve as the labels of the dataset are “dDoS”,
“DoS”, “Injection”, “Password”, “Mitm”, while also a class named “Normal” is
included, indicating the normal behaviour of the host system. More details
regarding the dataset can be found in [29] and [30].

CIC-IoT-2023 Dataset: The CIC-IoT-2023 Dataset [31] is a realistic IoT attack
dataset, using an extensive topology composed of multiple IoT devices
designated as either attackers or targets. The dataset entails 48 features
that are characterised by metrics such as packet flow statistics, employed
application layer protocols, TCP flags, etc. As we do not explicitly describe
all features for brevity, additional information can be found in [31].
Furthermore, the dataset categorises attacks into eight classes, namely “Brute
force”, “dDoS”, “DoS”, “Mirai”, “Recon”, “Spoofing”, “Web-based”, and
“Normal”.

TABLE II: TON-IoT Dataset: Feature Description Feature name |  Description
---|---
MINFLT |  The number of page faults issued by this process that have been solved by reclaiming the requested memory page from the free list of pages
MAJFLT |  The number of page faults issued by this process that have been solved by creating/loading the requested memory page
VSTEXT |  The virtual memory size used by the shared text of this process
VSIZE |  The total virtual memory usage consumed by this process
RSIZE |  The total resident memory usage consumed by this process
VGROW |  The amount of virtual memory that the process has grown during the last interval
RGROW |  The amount of resident memory that the process has grown during the last interval
MEM |  Memory occupation percentage

###  V-B Baseline Aggregation Methods

To evaluate the performance of StatAvg, we use the following baseline
aggregation strategies:

FedAvg: It is the de facto approach for FL [32]. Clients perform local model
updates and the server executes the aggregation of the local models to
generate the global model.

FedLN: The layer normalisation is included in the local models for mitigating
the effects of non-iid features [26]. FedLN performs local updates and
averages local models similarly to FedAvg.

FedBN: Employs local batch normalisation (BN) to the local models prior to
averaging them towards alleviating feature shift. Nonetheless, FedBN assumes
that local models have BN layers and omits their parameters from the
aggregation step at the side of the server [27].

It is worth noting that FedLN and FedBN are specially tailored to address the
issue of non-iid features, justifying their selection. As follows, in FedAvg,
FedLN and FedBN, the normalisation of the local training data is performed
based on the local client statistics, aligning with the conventional FL
approach. Also, the testing data undergo scaling in accordance with the
respective local normalisation for each client individually. Finally, it is
noted that the proposed technique StatAvg utilises FedAvg at step 9 of
Algorithm 1 as the default model aggregation strategy.

###  V-C Experimental Setup

The following settings apply to all experiments unless specified otherwise.
The number of clients has been set as $N=5$, and all clients are considered to
participate in every FL round. Also, the number of FL rounds is set to 50.
Each client receives an equal proportion $n_{i}=\frac{1}{N}$ of the original
dataset $\mathcal{D}$. Moreover, the division is conducted through
stratification based on the labels of the original dataset, aiming to
approximate a common $P_{i}(y)$ across all clients. This implies that clients
share a common label distribution. Following that, each client splits its
local dataset into training and testing subsets, with a ratio of 4 to 1. Due
to the significant class imbalance in the datasets, each client generates
synthetic instances from the minority classes in the training set by using
SMOTE [33].

The local model of each client is a neural network consisting of 3 Fully
Connected (FC) hidden layers with 128 neurons and ReLU activation, denoted as
(FC(128), ReLU), followed by a softmax activation on the output layer. In the
case of the baselines FedLN and FedBN, layer normalisation (LN) and batch
normalisation (BN) layers are incorporated into the local models, resulting in
each layer being structured as (FC(128), ReLU, LN) and (FC(128), BN, ReLU),
respectively. For the local training updates, the Adam optimiser is adopted
[34]. Finally, additional settings are summarised in Table III.

TABLE III: Experimental Settings Datasets |  TON-IoT |  CIC-IoT-2023
---|---|---
training samples per client |  19616 |  64050
training samples per client (SMOTE upsampling) |  84000 |  373176
local training epochs |  2 |  1
batch size |  512 |  1024
learning rate |  0.002 |  0.01

###  V-D Evaluation Results

Regarding the performance evaluation, we use common evaluation metrics such as
the confusion matrix, accuracy, and F1 score. Given a specific attack/class,
the confusion matrix includes the following standard metrics: the True
Positive (TP) represents instances where the model correctly identifies a
sample as belonging to a specific attack type. True Negative (TN) counts
instances where the model accurately identifies a sample as not belonging to a
specific attack type when it truly does not. False Positive (FP) denotes
instances where the sample is predicted as of a certain attack, but actually,
the sample does not belong to that attack type. False Negative (FN) is the
number of instances for which the model fails to predict a sample as a
specific attack type, even though the sample actually belongs to that attack.
Next, the accuracy and F1 score are defined as:

$\mathrm{ACC}=\frac{\mathrm{TP}+\mathrm{TN}}{\mathrm{TP}+\mathrm{TN}+\mathrm{FP}+\mathrm{FN}}$
(11)

and

$\mathrm{F1}=\frac{2\mathrm{TP}}{2\mathrm{TP}+\mathrm{FP}+\mathrm{FN}},$ (12)

respectively.

The evaluation metrics showcased in the results have been averaged across all
classes due to the multi-class nature of the problems we are addressing.
Finally, it is noted the evaluation was performed using clients’ testing sets,
and the demonstrated results were also averaged across all clients.

First, the evolution of testing accuracy throughout the FL rounds is
evaluated. In Fig. 3 and Fig. 4, the StatAvg strategy is compared with the
selected baselines on the TON-IoT and CIC-IoT-2023 datasets, respectively. It
is evident that StatAvg significantly outperforms the baseline strategies
across both datasets in terms of accuracy. Moreover, the convergence curve of
StatAvg is more stable compared to that of the baseline methods, which display
higher variance. The exhibited performance gain lies in the fact that StatAvg
utilises global statistics to normalise the clients’ features. Although FedLN
and FedBN have been designed to minimise the effects of non-IID features
between clients, it is discernible that they struggle to address this issue in
certain datasets. The variations in local client statistics, and consequently,
the diverse local normalisation utilised, appear to degrade the performance of
FL.

Moreover, in Table IV and Table V, some evaluation metrics for the case of
TON-IoT and CIC-IoT-2023 datasets are demonstrated, respectively. The
considered metrics showcase the performance of the best models encountered
during the FL training for each strategy. It can be observed that StatAvg has
superior performance against the baseline strategies. Specifically, in the
case of the TON-IoT dataset, StatAvg demonstrates a notable improvement of
over 19% and 21% in accuracy and F1 score, respectively, compared to the
second-best strategy FedLN. Also, when considering the CIC-IoT-2023 dataset,
the corresponding increase is over 4% and 2% for accuracy and F1 score. The
detailed confusion matrices of the StatAvg method are presented in Fig. 5 and
Fig. 6, for the TON-IoT and CIC-IoT-2023 datasets, respectively.

Figure 3: Testing accuracy on TON-IoT dataset. Figure 4: Testing accuracy on CIC-IoT-2023 dataset. TABLE IV: Evaluation Metrics on TON-IoT Dataset Strategy |  ACC |  TPR |  FPR |  F1
---|---|---|---|---
StatAvg |  83.93% |  69.26% |  3.13% |  62.36%
FedAvg |  63.68% |  48.7% |  8.22% |  38.30%
FedLN |  64.29% |  48.9% |  7.69% |  40.73%
FedBN |  62.60% |  46.85% |  8.66% |  36.99%
TABLE V: Evaluation Metrics on CIC-IoT-2023 Dataset Strategy |  ACC |  TPR |  FPR |  F1
---|---|---|---|---
StatAvg |  97.64% |  76.01% |  0.33% |  75.63%
FedAvg |  89.71% |  70.16% |  3.34% |  69.82%
FedLN |  93.42% |  73.41% |  1.58% |  73.59%
FedBN |  78.34% |  69.33% |  4.10% |  66.32%
Figure 5: Confusion matrix of StatAvg on TON-IoT dataset. Figure 6: Confusion
matrix of StatAvg on CIC-IoT-2023 dataset.

To shed light on the concept of non-iid features, we present some illustrative
examples derived from the examined datasets. First, we take a deeper look into
the training samples of the CIC-IoT-2023 dataset, focusing specifically on
those labelled with the attack category $y=\text{``Web-based''}$. Fig. 7
illustrates the distribution of the feature “Flow Duration” for the clients
$i=\\{1,2\\}$, formally written as $P_{i}(x_{i,s}|y=\text{``Web-based''})$
where $s=\text{``Flow Duration''}$. It can be observed from Fig. 7 (a) that
the distributions of the clients differ. Nevertheless, it remains uncertain
whether this disparity in distributions is inherent or if it is related to the
limited number of samples within the selected class. It is worth noting that
the ”Web-based” class is indeed a minority class. From Fig. 7 (b), it is
evident that the difference in distributions persists after upsampling the
dataset via SMOTE. This example shows that even if $P_{i}(y)$ is approximately
the same for all clients, as previously explained in the experimental setup,
the conditional distributions $P_{i}(\boldsymbol{x}|y)$ can still differ. This
phenomenon is related to the concept of Same label, different features,
discussed in Section II. Another example that highlights the differences in
the distributions of features is presented in Table VI. Here, statistical
metrics for selected features from the TON-IoT dataset have been calculated.
It can be observed that the feature “VSIZE” demonstrates consistent mean and
variance across clients, while the feature “MINFLT” displays high variations
in the statistical metrics. This example highlights the statistical
differences that some features may exhibit among clients, which in turn
influences the local normalisation of the features and potentially hinders the
FL stability and convergence.

(a) Unprocessed dataset. (b) Upsampled (SMOTE) dataset.

Figure 7: Distribution of the feature “Flow Duration”, given the attack label “Web-based”, on CIC-IoT-2023 dataset. TABLE VI: Statistical Metrics of Clients’ Features on TON-IoT Dataset Feature name | MINFLT | VSIZE
---|---|---
| Mean | Variance | Mean | Variance
Client 1 | $694.1$ | $5.8\cdot 10^{6}$ | $8621.3$ | $1.32\cdot 10^{8}$
Client 2 | $694.8$ | $3.5\cdot 10^{6}$ | $8663.3$ | $1.33\cdot 10^{8}$
Client 3 | $735.7$ | $5.8\cdot 10^{7}$ | $8364.9$ | $1.26\cdot 10^{8}$
Client 4 | $691.3$ | $3.9\cdot 10^{6}$ | $8521.9$ | $1.31\cdot 10^{8}$
Client 5 | $769.8$ | $1.8\cdot 10^{8}$ | $8519.1$ | $1.3\cdot 10^{8}$

##  VI Conclusions

This paper proposes the StatAvg technique for mitigating the impact of non-iid
features among clients in FL settings. The key aspect of StatAvg is to produce
global data statistics based on the local data statistics of FL clients. The
generation of global statistics, which is carried out by the server, gives
rise to a universal data normalisation technique that is performed by all
clients. Particular attention is given to FL-based IDS, which is the focus of
the experiments that were conducted. The results corroborate the effectiveness
of StatAvg in providing robust FL convergence and classifying cyber-attacks
compared to various baseline FL schemes. Moreover, valuable insights are
offered within the scope of non-iid features among clients for the selected
intrusion detection datasets. Finally, as StatAvg precedes the actual FL
procedure, it can be combined with any FL aggregation strategy, a topic which
is left for future investigation. Moreover, the applicability of StatAvg is
not limited solely to FL-based IDS, as its efficacy may encompass any FL
application associated with non-iid features among clients.

## References

  * [1] X. Deng, B. Chen, X. Chen, X. Pei, S. Wan, and S. K. Goudos, “Trusted edge computing system based on intelligent risk detection for smart iot,” _IEEE Transactions on Industrial Informatics_ , 2023.
  * [2] M. Taddeo, T. McCutcheon, and L. Floridi, “Trusting artificial intelligence in cybersecurity is a double-edged sword,” _Nature Machine Intelligence_ , vol. 1, no. 12, pp. 557–560, 2019.
  * [3] X. Deng, L. Wang, J. Gui, P. Jiang, X. Chen, F. Zeng, and S. Wan, “A review of 6g autonomous intelligent transportation systems: Mechanisms, applications and challenges,” _Journal of Systems Architecture_ , p. 102929, 2023.
  * [4] P. Radoglou-Grammatikis, P. Sarigiannidis, P. Diamantoulakis, T. Lagkas, T. Saoulidis, E. Fountoukidis, and G. Karagiannidis, “Strategic honeypot deployment in ultra-dense beyond 5g networks: A reinforcement learning approach,” _IEEE Transactions on Emerging Topics in Computing_ , 2022.
  * [5] D. C. Asimopoulos, P. Radoglou-Grammatikis, I. Makris, V. Mladenov, K. E. Psannis, S. Goudos, and P. Sarigiannidis, “Breaching the defense: Investigating fgsm and ctgan adversarial attacks on iec 60870-5-104 ai-enabled intrusion detection systems,” in _Proceedings of the 18th International Conference on Availability, Reliability and Security_. Benevento, Italy: Association for Computing Machinery, 2023, pp. 1–8.
  * [6] P. Radoglou-Grammatikis, P. Sarigiannidis, G. Efstathopoulos, T. Lagkas, G. Fragulis, and A. Sarigiannidis, “A self-learning approach for detecting intrusions in healthcare systems,” in _ICC 2021-IEEE International Conference on Communications_. IEEE, 2021, pp. 1–6.
  * [7] B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas, “Communication-efficient learning of deep networks from decentralized data,” in _Artificial intelligence and statistics_. PMLR, 2017, pp. 1273–1282.
  * [8] Y. Lin, Z. Gao, H. Du, J. Kang, D. Niyato, Q. Wang, J. Ruan, and S. Wan, “Drl-based adaptive sharding for blockchain-based federated learning,” _IEEE Transactions on Communications_ , 2023.
  * [9] S. Agrawal, S. Sarkar, O. Aouedi, G. Yenduri, K. Piamrat, M. Alazab, S. Bhattacharya, P. K. R. Maddikunta, and T. R. Gadekallu, “Federated learning for intrusion detection system: Concepts, challenges and future directions,” _Computer Communications_ , vol. 195, pp. 346–361, 2022.
  * [10] E. M. Campos, P. F. Saura, A. González-Vidal, J. L. Hernández-Ramos, J. B. Bernabe, G. Baldini, and A. Skarmeta, “Evaluating federated learning for intrusion detection in internet of things: Review and challenges,” _Computer Networks_ , vol. 203, p. 108661, 2022.
  * [11] B. Ghimire and D. B. Rawat, “Recent advances on federated learning for cybersecurity and cybersecurity for federated learning for internet of things,” _IEEE Internet of Things Journal_ , vol. 9, no. 11, pp. 8229–8249, 2022.
  * [12] S. Arisdakessian, O. A. Wahab, A. Mourad, H. Otrok, and M. Guizani, “A survey on iot intrusion detection: Federated learning, game theory, social psychology, and explainable ai as future directions,” _IEEE Internet of Things Journal_ , vol. 10, no. 5, pp. 4059–4092, 2022.
  * [13] V. Mothukuri, R. M. Parizi, S. Pouriyeh, Y. Huang, A. Dehghantanha, and G. Srivastava, “A survey on security and privacy of federated learning,” _Future Generation Computer Systems_ , vol. 115, pp. 619–640, 2021.
  * [14] B. Li, Y. Wu, J. Song, R. Lu, T. Li, and L. Zhao, “Deepfed: Federated deep learning for intrusion detection in industrial cyber–physical systems,” _IEEE Transactions on Industrial Informatics_ , vol. 17, no. 8, pp. 5615–5624, 2020.
  * [15] D. C. Attota, V. Mothukuri, R. M. Parizi, and S. Pouriyeh, “An ensemble multi-view federated learning intrusion detection for iot,” _IEEE Access_ , vol. 9, pp. 117 734–117 745, 2021.
  * [16] S. Mirjalili, S. M. Mirjalili, and A. Lewis, “Grey wolf optimizer,” _Advances in engineering software_ , vol. 69, pp. 46–61, 2014.
  * [17] R. Zhao, Y. Wang, Z. Xue, T. Ohtsuki, B. Adebisi, and G. Gui, “Semi-supervised federated learning based intrusion detection method for internet of things,” _IEEE Internet of Things Journal_ , 2022.
  * [18] Z. Chen, N. Lv, P. Liu, Y. Fang, K. Chen, and W. Pan, “Intrusion detection for wireless edge networks based on federated learning,” _IEEE Access_ , vol. 8, pp. 217 463–217 472, 2020.
  * [19] H. Wang, L. Muñoz-González, D. Eklund, and S. Raza, “Non-iid data re-balancing at iot edge with peer-to-peer federated learning for anomaly detection,” in _Proceedings of the 14th ACM Conference on Security and Privacy in Wireless and Mobile Networks_ , 2021, pp. 153–163.
  * [20] S. I. Popoola, G. Gui, B. Adebisi, M. Hammoudeh, and H. Gacanin, “Federated deep learning for collaborative intrusion detection in heterogeneous networks,” in _2021 IEEE 94th Vehicular Technology Conference (VTC2021-Fall)_. IEEE, 2021, pp. 1–6.
  * [21] A. Kundu, P. Yu, L. Wynter, and S. H. Lim, “Robustness and personalization in federated learning: A unified approach via regularization,” in _2022 IEEE International Conference on Edge Computing and Communications (EDGE)_. IEEE, 2022, pp. 1–11.
  * [22] P. Ruzafa-Alcázar, P. Fernández-Saura, E. Mármol-Campos, A. González-Vidal, J. L. Hernández-Ramos, J. Bernal-Bernabe, and A. F. Skarmeta, “Intrusion detection based on privacy-preserving federated learning for the industrial iot,” _IEEE Transactions on Industrial Informatics_ , vol. 19, no. 2, pp. 1145–1154, 2021.
  * [23] B. Weinger, J. Kim, A. Sim, M. Nakashima, N. Moustafa, and K. J. Wu, “Enhancing iot anomaly detection performance for federated learning,” _Digital Communications and Networks_ , vol. 8, no. 3, pp. 314–323, 2022\.
  * [24] W. Han, J. Peng, J. Yu, J. Kang, J. Lu, and D. Niyato, “Heterogeneous data-aware federated learning for intrusion detection systems via meta-sampling in artificial intelligence of things,” _IEEE Internet of Things Journal_ , 2023.
  * [25] P. Kairouz, H. B. McMahan, B. Avent, A. Bellet, M. Bennis, A. N. Bhagoji, K. Bonawitz, Z. Charles, G. Cormode, R. Cummings _et al._ , “Advances and open problems in federated learning,” _Foundations and Trends® in Machine Learning_ , vol. 14, no. 1–2, pp. 1–210, 2021\.
  * [26] Z. Du, J. Sun, A. Li, P.-Y. Chen, J. Zhang, H. H. Li, and Y. Chen, “Rethinking normalization methods in federated learning,” in _Proceedings of the 3rd International Workshop on Distributed Machine Learning_. Rome, Italy: Association for Computing Machinery, 2022, pp. 16–22.
  * [27] X. Li, M. Jiang, X. Zhang, M. Kamp, and Q. Dou, “Fedbn: Federated learning on non-iid features via local batch normalization,” _arXiv preprint arXiv:2102.07623_ , 2021.
  * [28] Q. Li, Y. Diao, Q. Chen, and B. He, “Federated learning on non-iid data silos: An experimental study,” in _2022 IEEE 38th International Conference on Data Engineering (ICDE)_. IEEE, 2022, pp. 965–978.
  * [29] A. Alsaedi, N. Moustafa, Z. Tari, A. Mahmood, and A. Anwar, “Ton_iot telemetry dataset: A new generation dataset of iot and iiot for data-driven intrusion detection systems,” _IEEE Access_ , vol. 8, pp. 165 130–165 150, 2020.
  * [30] N. Moustafa, M. Ahmed, and S. Ahmed, “Data analytics-enabled intrusion detection: Evaluations of ton_iot linux datasets,” in _2020 IEEE 19th International Conference on Trust, Security and Privacy in Computing and Communications (TrustCom)_. Guangzhou, China: IEEE, 2020, pp. 727–735.
  * [31] E. C. P. Neto, S. Dadkhah, R. Ferreira, A. Zohourian, R. Lu, and A. A. Ghorbani, “Ciciot2023: A real-time dataset and benchmark for large-scale attacks in iot environment,” _Sensors_ , vol. 23, no. 13, 2023.
  * [32] B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas, “Communication-efficient learning of deep networks from decentralized data,” in _Artificial intelligence and statistics_. PMLR, 2017, pp. 1273–1282.
  * [33] N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P. Kegelmeyer, “Smote: synthetic minority over-sampling technique,” _Journal of artificial intelligence research_ , vol. 16, pp. 321–357, 2002.
  * [34] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” _arXiv preprint arXiv:1412.6980_ , 2014.