11institutetext: Gabriele Ciaramella 22institutetext: Politecnico di Milano
22email<EMAIL_ADDRESS>33institutetext: Luca Mechelli
44institutetext: Universität Konstanz 44email<EMAIL_ADDRESS>
# On the effect of boundary conditions on the scalability of Schwarz methods

Gabriele Ciaramella and Luca Mechelli

##  1 Introduction

This work is concerned with convergence and weak scalability111Here, weak
scalability is understood in the sense that the contraction factor does not
deteriorate as the number $N$ of subdomains increases and, hence, the number
of iterations, needed to reach a given tolerance, is uniformly bounded in $N$;
see, e.g., Ciaramella_mini_10_CiaramellaGander4 . analysis of one-level
parallel Schwarz method (PSM) and optimized Schwarz method (OSM) for the
solution of the problem

$\begin{split}&-\Delta u=f\,\text{ in $\Omega$},\quad
u(a_{1},y)=u(b_{N},y)=0\>\text{ $y\in(0,1)$},\\\
&\mathcal{B}_{b}(u)(x)=\mathcal{B}_{t}(u)(x)=0\>\text{
$x\in(a_{1},b_{N}),$}\end{split}$ (1)

where $\Omega$ is the domain depicted in Fig. 1, and $\mathcal{B}_{b}$ and
$\mathcal{B}_{t}$ are either Dirichlet, or Neumann or Robin operators:

Dirichlet: $\displaystyle\mathcal{B}_{b}(u)(x)=u(0,x),$
$\displaystyle\mathcal{B}_{t}(u)(x)=u(1,x),$ Neumann:
$\displaystyle\mathcal{B}_{b}(u)(x)=\partial_{y}u(0,x),$
$\displaystyle\mathcal{B}_{t}(u)(x)=\partial_{y}u(1,x),$ Robin:
$\displaystyle\mathcal{B}_{b}(u)(x)=qu(0,x)-\partial_{y}u(0,x),$
$\displaystyle\mathcal{B}_{t}(u)(x)=qu(1,x)+\partial_{y}u(1,x).$

Here, $q>0$ and the subscripts ‘$b$’ and ‘$t$’ stand for ‘bottom’ and ‘top’.

$x$$b_{0}$$a_{1}$$a_{2}$$b_{1}$$\cdots$$\cdots$$a_{j}$$b_{j-1}$$a_{j+1}$$b_{j}$$\cdots$$\cdots$$a_{N}$$b_{N-1}$$b_{N}$$a_{N+1}$$1$$\Omega_{1}$$2\delta$$2\delta$$L-2\delta$$\cdots$$\cdots$$\Omega_{j}$$2\delta$$2\delta$$L-2\delta$$\cdots$$\cdots$$\Omega_{N}$$2\delta$$2\delta$$L-2\delta$
Figure 1: Two-dimensional chain of $N$ rectangular fixed-sized subdomains.

As shown in Fig. 1, the domain $\Omega$ is the union of subdomains
$\Omega_{j}$, $j=1,\dots,N$, defined as
$\Omega_{j}:=(a_{j},b_{j})\times(0,1)$, where $a_{1}=0$, $a_{j}=L+a_{j-1}$ for
$j=2,\dots,N+1$ and $b_{j}=a_{j+1}+2\delta$ for $j=0,\dots,N$. Hence, the
length of each subdomain is $L+2\delta$ and the length of the overlap is
$2\delta$ with $\delta\in(0,L/2)$.

It is well known that one-level Schwarz methods are not weakly scalable, if
the number of subdomains increases and the whole domain $\Omega$ is fixed.
However, the recent work Ciaramella_mini_10_Stamm3 , published in the field of
molecular dynamics, has drawn attention to the opposite case in which the
number of subdomains increases, but their size remains unchanged, and, as a
result, the size of the whole domain $\Omega$ increases. In this setting, weak
scalability of PSM and OSM for (1) with Dirichlet boundary conditions is
studied in Ciaramella_mini_10_CiaramellaGander ;
Ciaramella_mini_10_CiaramellaGander4 . Scalability results for the PSM in case
of more general geometries of the (sub)domains are presented in
Ciaramella_mini_10_CiaramellaGander2 ; Ciaramella_mini_10_CiaramellaGander3 ;
Ciaramella_mini_10_CHS2 . In these works, only external Dirichlet conditions
are discussed and, in such a case, weak scalability is shown. A short remark
about the non-scalability in case of external Neumann conditions is given in
Ciaramella_mini_10_CiaramellaGander4 . Similar results have been recently
presented in Ciaramella_mini_10_bootland2020  for time-harmonic problems. The
goal of this work is to study the effect of different (possibly mixed)
external boundary conditions on convergence and scalability of PSM and OSM. In
particular, we will show that only in the case of (both) external Neumann
conditions at the top and the bottom of $\Omega$, PSM and OSM are not
scalable. External Dirichlet conditions lead to the fastest convergence, while
external Robin conditions lead to a convergence that depends heavily on the
parameter $q$.

One-level PSM and OSM for the solution of (1) are

$\begin{split}&-\Delta u_{j}^{n}=f_{j}\,\text{ in $\Omega_{j}$},\\\
&\mathcal{B}_{b}(u_{j}^{n})(x)=\mathcal{B}_{t}(u_{j}^{n})(x)=0\>\text{
$x\in(a_{1},b_{N}),$}\\\
&\mathcal{T}_{\ell}(u_{j}^{n})(a_{j})=\mathcal{T}_{\ell}(u_{j-1}^{n-1})(a_{j}),\quad\mathcal{T}_{r}(u_{j}^{n})(b_{j})=\mathcal{T}_{r}(u_{j+1}^{n-1})(b_{j}),\end{split}$
(2)

for $j=2,\dots,N$, where $\mathcal{T}_{\ell}$ and $\mathcal{T}_{r}$ are
Dirichlet trace operators,

$\mathcal{T}_{\ell}(u_{j}^{n})(a_{j})=u(a_{j},y)\text{ and
}\mathcal{T}_{r}(u_{j}^{n})(b_{j})=u(b_{j},y),$ (3)

for the PSM, and Robin trace operators,

$\mathcal{T}_{\ell}(u_{j}^{n})(a_{j})=pu(a_{j},y)-\partial_{x}u(a_{j},y)\text{
and }\mathcal{T}_{r}(u_{j}^{n})(b_{j})=pu(b_{j},y)+\partial_{x}u(b_{j},y),$
(4)

with $p>0$ for the OSM. The subscript ‘$\ell$’ and ‘$r$’ stand for ‘left’ and
‘right’. For $j=1$ the condition at $a_{1}$ must be replaced by
$u_{1}^{n}(a_{1},y)=0$ and for $j=N$ the condition at $b_{N}$ must be replaced
by $u_{N}^{n}(b_{N},y)=0$. In this paper, ‘external conditions’ and
‘transmission conditions’ will always refer to the conditions obtained by the
pairs $(\mathcal{B}_{b},\mathcal{B}_{u})$ and
$(\mathcal{T}_{\ell},\mathcal{T}_{r})$, respectively. Note that the Robin
parameter $p$ of the OSM can be chosen independently of the Robin parameter
$q$ used for the operators $\mathcal{B}_{b}$ and $\mathcal{B}_{t}$. We analyze
convergence of PSM and OSM by a Fourier analysis in Section 3. For this
purpose, we use the solutions of eigenproblems of the 1D Laplace operators
with mixed boundary conditions. These are studied in Section 2. Finally,
results of numerical experiments are presented in Section 4.

##  2 Laplace eigenpairs for mixed external conditions

Consider the 1D eigenvalue problem

$\varphi^{\prime\prime}(y)=-\lambda\varphi(y),\text{ for $y\in(0,1)$,
$\quad\mathcal{B}_{b}(\varphi)(0)=\mathcal{B}_{t}(\varphi)(1)=0$},$ (5)

and six pairs of boundary operators $(\mathcal{B}_{b},\mathcal{B}_{t})$:

  * (DD)

$\mathcal{B}_{b}(\varphi)(0)=\varphi(0)$,
$\quad\qquad\qquad\mathcal{B}_{t}(\varphi)(1)=\varphi(1)$,

  * (DR)

$\mathcal{B}_{b}(\varphi)(0)=\varphi(0)$,
$\quad\qquad\qquad\mathcal{B}_{t}(\varphi)(1)=q\varphi(1)+\varphi^{\prime}(1)$,

  * (DN)

$\mathcal{B}_{b}(\varphi)(0)=\varphi(0)$,
$\quad\qquad\qquad\mathcal{B}_{t}(\varphi)(1)=\varphi^{\prime}(1)$,

  * (RR)

$\mathcal{B}_{b}(\varphi)(0)=q\varphi(0)-\varphi^{\prime}(0)$,
$\quad\mathcal{B}_{t}(\varphi)(1)=q\varphi(1)+\varphi^{\prime}(1)$,

  * (NR)

$\mathcal{B}_{b}(\varphi)(0)=\varphi^{\prime}(0)$,
$\quad\qquad\quad\;\;\,\mathcal{B}_{t}(\varphi)(1)=q\varphi(1)+\varphi^{\prime}(1)$,

  * (NN)

$\mathcal{B}_{b}(\varphi)(0)=\varphi^{\prime}(0)$,
$\quad\qquad\quad\;\;\,\mathcal{B}_{t}(\varphi)(1)=\varphi^{\prime}(1)$,

where $q>0$ and ‘D’, ‘R’ and ‘N’ stand for ‘Dirichlet’, ‘Robin’ and ‘Neumann’.
For all these six cases the eigenvalue problem (5) is solved by orthonormal
(in $L^{2}(0,1)$) Fourier basis functions.

######  Theorem 2.1 (Eigenpairs of the Laplace operator)

Let $q>0$. The eigenproblems (5) with the above external conditions are solved
by the non-trivial eigenpairs $(\varphi_{k},\lambda_{k})$ given by

  * (DD)

$\varphi_{k}(y)=\sqrt{2}\sin(\pi ky)$, $\lambda_{k}=\pi^{2}k^{2}$,
$k=1,2,\dots$

  * (DR)

$\varphi_{k}(y)=\sqrt{\frac{4\mu_{k}}{2\mu_{k}-\sin(2\mu_{k})}}\sin(\mu_{k}y)$,
$\lambda_{k}=\mu_{k}^{2}$, $k=1,2,\dots$, where $\mu_{k}\in(k\pi-\pi/2,k\pi)$,
$k=1,2,\dots$, are roots $\widehat{d}(x):=q\sin(x)+x\cos(x)$. Moreover,
$\lim_{q\rightarrow 0}\mu_{1}(q)=\pi/2$ and
$\lim_{q\rightarrow\infty}\mu_{1}(q)=\pi$.

  * (DN)

$\varphi_{k}(y)=\sqrt{2}\sin(\frac{2k+1}{2}\pi y)$,
$\lambda_{k}=\frac{(2k+1)^{2}}{4}\pi^{2}$, $k=0,1,2,\dots$

  * (RR)

$\varphi_{k}(y)=\sqrt{\frac{4\tau_{k}}{(\tau_{k}^{2}-q^{2})\sin(2\tau_{k})+4q\tau_{k}\sin(\tau_{k})^{2}+2\tau_{k}^{3}+2q^{2}\tau_{k}}}\bigl{(}q\sin(\tau_{k}y)+\tau_{k}\cos(\tau_{k}y)\bigr{)}$,
$\lambda_{k}=\tau_{k}^{2}$, $k=1,2,\dots$, where $\tau_{k}\in(0,\pi)$,
$k=1,2,\dots$, are roots of
$\widetilde{d}(x):=2qx\cos(x)+(q^{2}-x^{2})\sin(x)$. Moreover,
$\lim_{q\rightarrow 0}\tau_{1}(q)=0$ and
$\lim_{q\rightarrow\infty}\tau_{1}(q)=\pi$.

  * (NR)

$\varphi_{k}(y)=\sqrt{\frac{4\nu_{k}}{2\nu_{k}+\sin(2\nu_{k})}}\cos(\nu_{k}y)$,
$\lambda_{k}=\nu_{k}^{2}$, $k=1,2,\dots$, where
$\nu_{k}\in~{}((k-1)\pi,(k-\frac{1}{2})\pi)$, $k=1,2,\dots$, are roots of
$d(x):=x\sin(x)-q\cos(x)$. Moreover, $\lim_{q\rightarrow 0}\nu_{1}(q)=0$ and
$\lim_{q\rightarrow\infty}\nu_{1}(q)=\pi/2$.

  * (NN)

$\varphi_{k}(y)=\sqrt{2}\cos(\pi ky)$, $\lambda_{k}=\pi^{2}k^{2}$,
$k=0,1,2,\dots$

###### Proof

If we multiply (5) with $\varphi$, integrate over $[0,1]$, and integrate by
parts, we get
$\lambda\int_{0}^{1}|\varphi(y)|^{2}dy=\int_{0}^{1}|\varphi^{\prime}(y)|^{2}dy-\varphi^{\prime}(1)\varphi(1)+\varphi^{\prime}(0)\varphi(0)$.
Using any of the above external conditions (and that $q>0$, for the Robin
ones) one gets $\lambda\geq 0$. We refer to, e.g.,
(Ciaramella_mini_10_Olver2013, , Section 4.1) for similar discussions. Now,
all the cases can be proved by using the ansatz
$\varphi(y)=A\cos(\sqrt{\lambda}y)+B\sin(\sqrt{\lambda}y)$, which clearly
satisfies (5), and computing, e.g., $A$ and $\lambda$ in such a way that
$\varphi(y)$ satisfies the two external conditions and $B$ as a normalization
factor.

The coefficients $\nu_{1}$, $\mu_{1}$ and $\tau_{1}$ as functions of $q$ are
shown in Fig. 2 (left),

Figure 2: Left: Maps $q\mapsto\mu_{1}(q)$, $q\mapsto\nu_{1}(q)$ and
$q\mapsto\tau_{1}(q)$ . Right: $\rho_{\rm DR}$, $\rho_{{\rm NR}}$, $\rho_{\rm
DD}$ and $\rho_{\rm DN}$ as functions of $q$ and for $\delta=0.1$ and $L=1.0$.

where we can observe that $\nu_{1}(q)<\frac{\pi}{2}<\mu_{1}(q)<\pi$ and
$0<\tau_{1}(q)<\pi$, and that the maps $q\mapsto\nu_{1}(q)$,
$q\mapsto\mu_{1}(q)$ and $q\mapsto\tau_{1}(q)$ increase monotonically and
approach, respectively, $\frac{\pi}{2}$ and $\pi$ as $q\rightarrow\infty$.
Hence, by taking the limit $q\rightarrow 0$, one can pass from the conditions
(DR), (RR) and (NR) to (DN), (NN) and (NN), respectively. Similarly, by taking
the limit $q\rightarrow\infty$, the conditions (DR), (RR) and (NR) become
(DD), (DD) and (DN), respectively.

##  3 Convergence and scalability

Consider the Schwarz method (2) and any pair
$(\mathcal{B}_{b},\mathcal{B}_{t})$ of operators as in Section 2. The Fourier
expansions of $u_{j}^{n}(x,y)$, $j=1,\dots,N$, are

$u_{j}^{n}(x,y)=\sum_{k}\widehat{u}_{j}^{n}(x,\lambda_{k})\varphi_{k}(y),$ (6)

where the sum is over $k=1,2,\dots$ for (DD), (DR), (RR) and (NR), and over
$k=0,1,2,\dots$ for (DN) and (NN). The functions $\varphi_{k}$ depend on the
external boundary conditions and are the ones obtained in Theorem 2.1. The
Fourier coefficients $\widehat{u}_{j}^{n}(x,\lambda_{k})$ satisfy

$\begin{split}-\partial_{xx}\widehat{u}_{j}^{n}(x,\lambda_{k})+\lambda_{k}\widehat{u}_{j}^{n}(x,\lambda_{k})&=\widehat{f}_{j}(x,\lambda_{k})\,\text{
in $(a_{j},b_{j})$},\\\
\mathcal{T}_{\ell}(\widehat{u}_{j}^{n}(\cdot,\lambda_{k}))(a_{j})&=\mathcal{T}_{\ell}(\widehat{u}_{j-1}^{n-1}(\cdot,\lambda_{k}))(a_{j}),\\\
\mathcal{T}_{r}(\widehat{u}_{j}^{n}(\cdot,\lambda_{k}))(b_{j})&=\mathcal{T}_{r}(\widehat{u}_{j+1}^{n-1}(\cdot,\lambda_{k}))(b_{j}),\end{split}$
(7)

for $j=2,\dots,N$. For $j=1$, the condition at $a_{1}$ must be replaced by
$u_{1}^{n}(a_{1})=0$ and for $j=N$ the condition at $b_{N}$ must be replaced
by $u_{N}^{n}(b_{N})=0$. If the operators $\mathcal{T}_{\ell}$ and
$\mathcal{T}_{r}$ correspond to Dirichlet conditions (see (3)), then (7) is a
PSM. If they correspond to Robin conditions (see (4)), then (7) is an OSM. The
convergence of the iteration (7) is analyzed in Theorem 3.1.

######  Theorem 3.1 (Convergence of Schwarz methods in Fourier space)

The contraction factors of the Schwarz methods222The contraction factor for
(7) (corresponding to the $k$-th Fourier component) is the spectral radius of
the Schwarz iteration matrix; see Ciaramella_mini_10_CiaramellaGander ;
Ciaramella_mini_10_CiaramellaGander4 . (7) are bounded by

$\rho(\lambda_{k},\delta)=\frac{e^{2\lambda_{k}\delta}+e^{\lambda_{k}L}}{e^{2\lambda_{k}\delta+\lambda_{k}L}+1}.$
(8)

Moreover, it holds that $\rho(\lambda_{k},\delta)\in[0,1]$ with
$\rho(0,\delta)=1$ (independently of $N$), and that
$\lambda\mapsto\rho(\lambda,\delta)$ is strictly monotonically decreasing.

###### Proof

The Dirichlet case follows from (Ciaramella_mini_10_CiaramellaGander, , Lemma
2 and Theorem 3). See also (Ciaramella_mini_10_CiaramellaGander4, , Lemma 2
and Theorem 1). We focus here on the Robin case. From Theorem 3 in
Ciaramella_mini_10_CiaramellaGander4  and the corresponding proof we have that
the contraction factor of the OSM is bounded by
$\max\\{\varphi(\lambda,\delta,p),|\zeta(\lambda,\delta,p)|\\}$ where

$\begin{split}\varphi(\lambda,\delta,p)&:=\frac{(\lambda+p)^{2}e^{2\delta\lambda}-(\lambda-p)^{2}e^{-2\delta\lambda}+(\lambda+p)|\lambda-p|(e^{\lambda
L}-e^{-\lambda L})}{(\lambda+p)^{2}e^{\lambda
L+2\lambda\delta}-(\lambda-p)^{2}e^{-\lambda L-2\lambda\delta}}\geq 0,\\\
\zeta(\lambda,\delta,p)&:=\frac{(\lambda+p)e^{-\lambda
L}+(\lambda-p)e^{\lambda
L}}{(\lambda+p)e^{\lambda(L+2\delta)}+(\lambda-p)e^{-\lambda(L+2\delta)}},\end{split}$

with
$\varphi(\lambda,\delta,p)\leq\varphi(\lambda,\delta,0)=\lim_{\widetilde{p}\rightarrow\infty}\varphi(\lambda,\delta,\widetilde{p})=\frac{e^{2\delta\lambda}-e^{-2\delta\lambda}+e^{\lambda
L}-e^{-\lambda L}}{e^{\lambda L+2\delta\lambda}-e^{-\lambda
L-2\delta\lambda}}$ for all $\lambda\geq 0$ and $\delta>0$. If we compute the
derivative of $\lambda\mapsto\varphi(\lambda,\delta,0)$ we get

$\partial_{\lambda}\varphi(\lambda,\delta,0)=-\frac{L(e^{4\delta\lambda+L\lambda}-e^{L\lambda})+2\delta(e^{2\delta\lambda+2L\lambda}-e^{2\delta\lambda})}{(e^{2\delta\lambda+L\lambda}+1)^{2}},$

which is negative for any $\lambda\geq 0$ and $\delta>0$. Thus,
$\lambda\mapsto\varphi(\lambda,\delta,0)$ is strictly monotonically
decreasing. Let us now study the function $\zeta(\lambda,\delta,p)$. Direct
calculations reveal that $\partial_{p}\zeta(\lambda,\delta,p)=-\frac{2\lambda
e^{2\delta\lambda}(e^{4\lambda(\delta+L)}-1)}{((\lambda+p)e^{4\delta\lambda+2L\lambda}+\lambda-p)^{2}}$,
which is negative for any $\lambda\geq 0$ and $\delta>0$, and
$\zeta(\lambda,\delta,0)=\frac{(e^{2L\lambda}+1)e^{2\delta\lambda}}{e^{4\delta\lambda+2L\lambda}+1}>0$
and
$\lim_{p\rightarrow\infty}\zeta(\lambda,\delta,p)=-\frac{(e^{2L\lambda}-1)e^{2\delta\lambda}}{e^{4\delta\lambda+2L\lambda}-1}<0$
for any $\lambda\geq 0$ and $\delta>0$. These observations imply that
$p\mapsto\zeta(\lambda,\delta,p)$ is strictly monotonically decreasing and
attains its maximum at $p=0$. Finally, a direct comparison shows that
$\varphi(\lambda,\delta,0)\geq\zeta(\lambda,\delta,0)\geq\lim_{p\rightarrow\infty}\left|\zeta(\lambda,\delta,p)\right|$
and the result follows, because
$\varphi(\lambda,\delta,0)=\frac{e^{2\delta\lambda}-e^{-2\delta\lambda}+e^{\lambda
L}-e^{-\lambda L}}{e^{\lambda L+2\delta\lambda}-e^{-\lambda
L-2\delta\lambda}}=\frac{e^{2\lambda\delta}+e^{\lambda
L}}{e^{2\lambda\delta+\lambda L}+1}$.

Theorem 3.1 gives the same bound (8) for the convergence factors of PSM and
OSM. This fact is not surprising. First, it is well known that OSM converges
faster than PSM for $\delta>0$. Hence, a convergence bound for the PSM is a
valid bound also for the OSM. Second, in the above proof the convergence bound
for the OSM is obtained for $p\rightarrow\infty$, which corresponds to passing
from Robin transmission conditions to Dirichlet transmission conditions. The
bound (8) is based on the ones obtained in Ciaramella_mini_10_CiaramellaGander
; Ciaramella_mini_10_CiaramellaGander4 . These are quite sharp for large
values of $N$; see, e.g., (Ciaramella_mini_10_CiaramellaGander4, , Fig. 4 and
Fig. 5).

We can now prove our main convergence result, which allows us to study
convergence and scalability of PSM and OSM for all the external conditions
considered in Section 2.

######  Theorem 3.2 (Convergence of PSM and OSM)

The contraction factors (in the $L^{2}$ norm) of PSM and OSM for the solution
to (1) are bounded by

$\displaystyle{\rm(DD)}\;\rho_{\rm DD}(\delta):=\rho(\pi^{2},\delta),$
$\displaystyle{\rm(DR)}\;\rho_{\rm
DR}(\delta,q):=\rho(\mu_{1}(q)^{2},\delta),$
$\displaystyle{\rm(DN)}\;\rho_{\rm DN}(\delta):=\rho(\pi^{2}/4,\delta),$
$\displaystyle{\rm(RR)}\;\rho_{\rm
RR}(\delta,q):=\rho(\tau_{1}(q)^{2},\delta),$
$\displaystyle{\rm(NR)}\;\rho_{{\rm
NR}}(\delta,q):=\rho(\nu_{1}(q)^{2},\delta),$
$\displaystyle{\rm(NN)}\;\rho_{\rm NN}(\delta):=\rho(0,\delta)=1,$

where $q\in(0,\infty)$ and $\rho(\lambda,\delta)$ is defined in Theorem 3.1.
Moreover, for any $\delta>0$ we have that

$\begin{split}&\rho_{\rm DD}(\delta)<\rho_{\rm DR}(\delta,q)<\rho_{\rm
DN}(\delta)<\rho_{{\rm NR}}(\delta,q)<\rho_{\rm NN}(\delta)=1,\end{split}$ (9)

$\begin{split}&\rho_{\rm DD}(\delta)<\rho_{\rm RR}(\delta,q)<\rho_{\rm
NN}(\delta)=1.\end{split}$ (10)

###### Proof

According to Theorem 3.1, the bounds of the Fourier contraction factor
$\rho(\lambda,\delta)$ is monotonically decreasing in $\lambda$. Therefore, an
upper bound for the convergence factor of PSM and OSM (in the $L^{2}$ norm)
can be obtained by taking the maximum over the admissible Fourier frequencies
$\lambda_{k}$ and invoking Parseval’s identity (see, e.g.,
Ciaramella_mini_10_CiaramellaGander ). Recalling Theorem 2.1, these maxima are
attained at $\lambda_{1}=\pi^{2}$ for (DD), $\lambda_{1}=\mu_{1}^{2}$ for
(DR), $\lambda_{0}=\pi^{2}/4$ for (DN), $\lambda_{1}=\tau_{1}^{2}$ for (RR),
$\lambda_{1}=\nu_{1}^{2}$ for (NR), and $\lambda_{0}=0$ for (NN). The
inequalities (9) and (10) follow from the monotonicity
$\lambda\mapsto\rho(\lambda,\delta)$ and the fact that
$\nu_{1}(q)<\frac{\pi}{2}<\mu_{1}(q)<\pi$ and $\tau_{1}(q)\in(0,\pi)$.

The inequalities (9) and (10) imply that the contraction factor is bounded,
independently of $N$, by a constant strictly smaller than $1$ for all the
cases except (NN). In the case (NN), the first Fourier frequency is
$\lambda_{0}=0$. Hence, the coefficients $\widehat{u}_{j}^{n}(x,\lambda_{0})$
are generated by the 1D Schwarz method

$\begin{split}-\partial_{xx}\widehat{u}_{j}^{n}(x,\lambda_{0})&=\widehat{f}_{j}(x,\lambda_{0})\,\text{
in $(a_{j},b_{j})$},\\\
\mathcal{T}_{\ell}(\widehat{u}_{j}^{n}(\cdot,\lambda_{0}))(a_{j})&=\mathcal{T}_{\ell}(\widehat{u}_{j-1}^{n-1}(\cdot,\lambda_{0}))(a_{j}),\\\
\mathcal{T}_{r}(\widehat{u}_{j}^{n}(\cdot,\lambda_{0}))(b_{j})&=\mathcal{T}_{r}(\widehat{u}_{j+1}^{n-1}(\cdot,\lambda_{0}))(b_{j}),\end{split}$
(11)

which is known to be not scalable; see, e.g.,
Ciaramella_mini_10_CiaramellaGander4 ; Ciaramella_mini_10_CHS1 . The
scalability of PSM and OSM for different external conditions applied at the
top and at the bottom of the domain is summarized in Table 1.

bottomtop | Dirichlet | Robin | Neumann
---|---|---|---
Dirichlet | yes | yes | yes
Robin | yes | yes | yes
Neumann | yes | yes | no

bottomtop | Dirichlet | Robin | Neumann
---|---|---|---
Dirichlet | - | yes | -
Robin | yes | no | no
Neumann | - | no | -

Table 1: Left: Scalability of PSM and OSM for different external conditions
(for a fixed and finite $q>0$) applied at the top and at the bottom of the
domain. Right: Robustness of PSM and OSM with respect to $q\in[0,\infty]$.

Inequalities (9) and (10) lead to another interesting observation. The
contraction factors are clearly influenced by the external boundary
conditions. Dirichlet conditions lead to faster convergence than Robin
conditions, which in turn lead to faster convergence than Neumann conditions.
For example, if one external condition is of the Dirichlet type, then PSM and
OSM converge faster if the other condition is of the Dirichlet type and slower
if this is of Robin and even slower for the Neumann type. The case (RR) is
slightly different, because the corresponding convergence of PSM and OSM
depends heavily on the Robin parameter $q$. The behavior of the bounds
$\rho_{\rm RR}(\delta,q)$, $\rho_{\rm DR}(\delta,q)$ and $\rho_{\rm
NR}(\delta,q)$ with respect to $q$ is depicted in Fig. 2 (right), which shows
the bounds discussed in Theorem 3.2 as functions of $q$ (recall that
$\rho_{\rm NN}=1$). Here, we can observe that the inequalities (9) and (10)
are satisfied and that

  * •

As $q$ increases the Dirichlet part of the Robin external condition dominates.
In addition, the bounds $\rho_{\rm RR}$ and $\rho_{\rm DR}$ decrease and
approach $\rho_{\rm DD}$ as $q\rightarrow\infty$. Similarly, $\rho_{\rm NR}$
decreases and approaches $\rho_{\rm DN}$.

  * •

As $q$ decreases the Neumann part of the Robin external condition dominates.
In addition, the bounds $\rho_{\rm NR}$ and $\rho_{\rm RR}$ decrease and
approach $\rho_{\rm NN}=1$ as $q\rightarrow 0$. Similarly, $\rho_{\rm DR}$
increases and approaches $\rho_{\rm DN}$.

These observations lead to Tab. 1 (right), where we summarize the robustness
of PSM and OSM with respect to the parameter $q$. The methods are robust with
respect to $q$ only if one of the two external boundary conditions is of
Dirichlet type. This is due to the fact that Robin conditions become Neumann
conditions for $q\rightarrow 0$.

##  4 Numerical experiments

In this section, we test the scalability of PSM and OSM by numerical
simulations. For this purpose, we run PSM and OSM for all the external
boundary conditions discussed in this paper and measure the number of
iterations required to reach a tolerance on the error of $10^{-6}$. To
guarantee that the initial errors contain all frequencies, the methods are
initialized with random initial guesses. In all cases, each subdomain is
discretized with a uniform grid of size $90$ interior points in direction $x$
and $50$ interior points in direction $y$. The mesh size is $h=\frac{L}{51}$,
with $L=1$, and the overlap parameter is $\delta=10h$. For the OSM the robin
parameter is $p=10$. The Robin parameter $q$ of the external Robin conditions
is $q=10$, and the (RR) case is also tested with $q=0.1$. The results of our
experiments are shown in Tab. 2 and confirm the theoretical results discussed
in the previous sections.

$N$ | DD | DR(10) | DN | RR(10) | NR(10) | NN | RR(0.1)
---|---|---|---|---|---|---|---
3 | 12 - 9 | 13 - 10 | 27 - 19 | 14 - 10 | 26 - 19 | 77 - 54 | 65 - 45
4 | 13 - 9 | 14 - 10 | 29 - 21 | 15 - 11 | 29 - 21 | 130 - 90 | 95 - 66
5 | 13 - 9 | 14 - 10 | 31 - 22 | 15 - 11 | 31 - 22 | 194 - 134 | 124 - 86
10 | 13 - 10 | 14 - 10 | 33 - 24 | 15 - 11 | 34 - 24 |  $>$401 - $>$401 | 227 - 155
20 | 13 - 10 | 14 - 10 | 34 - 24 | 15 - 11 | 35 - 24 |  $>$401 - $>$401 | 293 - 199
30 | 13 - 10 | 14 - 10 | 34 - 24 | 15 - 11 | 35 - 24 |  $>$401 - $>$401 | 311 - 210
40 | 13 - 10 | 14 - 10 | 34 - 24 | 15 - 11 | 35 - 24 |  $>$401 - $>$401 | 317 - 214
50 | 13 - 10 | 14 - 10 | 34 - 24 | 15 - 11 | 35 - 24 |  $>$401 - $>$401 | 319 - 216
Table 2: Number of iterations of PSM (left) and OSM (right) needed to reduce
the norm of the error below a tolerance of $10^{-6}$ for increasing number $N$
of fixed-sized subdomains. The maximum number of allowed iterations is 401.
This limit is only reached in the (NN) case, for which PSM and OSM are not
scalable.

## References

  * [1] N. Bootland, V. Dolean, A. Kyriakis, and J. Pestana.  Analysis of parallel Schwarz algorithms for time-harmonic problems using block Toeplitz matrices.  arXiv.2006.08801, 2020.
  * [2] E. Cancès, Y. Maday, and B. Stamm.  Domain decomposition for implicit solvation models.  J. Chem. Phys., 139:054111, 2013.
  * [3] F. Chaouqui, G. Ciaramella, M. J. Gander, and T. Vanzan.  On the scalability of classical one-level domain-decomposition methods.  Vietnam J. Math., 46(4):1053–1088, 2018.
  * [4] G. Ciaramella and M. J. Gander.  Analysis of the parallel Schwarz method for growing chains of fixed-sized subdomains: Part I.  SIAM J. Numer. Anal., 55(3):1330–1356, 2017.
  * [5] G. Ciaramella and M. J. Gander.  Analysis of the parallel Schwarz method for growing chains of fixed-sized subdomains: Part II.  SIAM J. Numer. Anal., 56 (3):1498–1524, 2018.
  * [6] G. Ciaramella and M. J. Gander.  Analysis of the parallel Schwarz method for growing chains of fixed-sized subdomains: Part III.  Electron. Trans. Numer. Anal., 49:210–243, 2018.
  * [7] G. Ciaramella, M. Hassan, and B. Stamm.  On the scalability of the parallel Schwarz method in one-dimension.  In Domain Decomposition Methods in Science and Engineering XXV, pages 151–158. Springer International Publishing, 2020.
  * [8] G. Ciaramella, M. Hassan, and B. Stamm.  On the scalability of the Schwarz method.  SMAI-JCM, 6:33–68, 2020.
  * [9] P. J. Olver.  Introduction to Partial Differential Equations.  Undergraduate Texts in Mathematics. Springer International Publishing, 2013.


# Federated Learning for Intrusion Detection in IoT Security: A Hybrid
Ensemble Approach

Sayan Chatterjee and Manjesh K. Hanawal  IEOR, IIT Bombay, Mumbai, India
<EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

Critical role of Internet of Things (IoT) in various domains like smart city,
healthcare, supply chain and transportation has made them the target of
malicious attacks. Past works in this area focused on centralized Intrusion
Detection System (IDS), assuming the existence of a central entity to perform
data analysis and identify threats. However, such IDS may not always be
feasible, mainly due to spread of data across multiple sources and gathering
at central node can be costly. Also, the earlier works primarily focused on
improving True Positive Rate (TPR) and ignored the False Positive Rate (FPR),
which is also essential to avoid unnecessary downtime of the systems. In this
paper, we first present an architecture for IDS based on hybrid ensemble
model, named PHEC, which gives improved performance compared to state-of-the-
art architectures. We then adapt this model to a federated learning framework
that performs local training and aggregates only the model parameters. Next,
we propose Noise-Tolerant PHEC in centralized and federated settings to
address the label-noise problem. The proposed idea uses classifiers using
weighted convex surrogate loss functions. Natural robustness of KNN classifier
towards noisy data is also used in the proposed architecture. Experimental
results on four benchmark datasets drawn from various security attacks show
that our model achieves high TPR while keeping FPR low on noisy and clean
data. Further, they also demonstrate that the hybrid ensemble models achieve
performance in federated settings close to that of the centralized settings.

###### Index Terms:

IoT Security, Ensemble Learning, Federated Learning, Noise Robust
Classification

##  I Introduction

Internet of Things (IoT) are one of the most effective combinations of
physical objects and networks. It involves the uses of embedded systems,
wireless networks, machine learning, automation and many other fields. As IoT
are becoming critical infrastructure, they can be targets of attackers and
need to be proactively protected. Intrusion detection system (IDS) is one of
the most common security mechanisms used to thwart malicious attacks. IDS may
be anomaly-based or signature-based. Signature-based models generally work
well for previously known attacks but not for new/unknown attacks. Machine
learning models are increasingly applied in IDS, which work better in
detecting previously unknown attacks.

Most of the attacks in IoT networks can be broadly categorized into four
groups: Denial of Service (DoS), Probe, Remote to Local (R2L), User to Root
(U2R). According to the literature [1, 2], U2R and R2L mimic normal traffic
characteristics to a huge extent and hence, difficult to detect. In modern
days, a huge number of IoT devices can be connected to a vast network and not
all part of the networks see these attacks in equal proportions. For example,
some portion of the network may see DoS attack more while the other portion
may see more U2R and R2L attacks. Hence data pertaining to these attacks are
often collected at a centralized facility to train the models which can detect
all type of attacks. However, transferring data to the central node may incur
high transfer costs, significant communication overhead, operational
constraints [3]. Moreover, due to privacy concerns, it may not be practically
feasible to collect data from many devices and store them in a single entity.

In many IoT networks, the nodes are often equipped with enough computational
capabilities such that they can process the data locally. Hence instead of
collecting the data at a central node, each source node can train models
locally and only share the parameters of the trained models with the central
node that can combine the shared parameters appropriately to get the final
aggregated model. This federated learning has emerged as a popular method
where nodes cooperate, connect and form an aggregated model. This work
proposes a Probabilistic Hybrid Ensemble Classification (PHEC) model for
detecting threats in IoT networks (in centralized settings) and adapting it to
federated settings. The term hybrid in PHEC signifies that multiple
classifiers of different types are combined to predict labels. The term
probabilistic indicates that the confidence value in the predicted label is
taken into consideration rather than the actual labels of the individual
classifiers. Also, Ensemble suggests that a group of classifiers work to give
better results.

The main advantage of the PHEC model is its versatility and flexibility – we
can achieve from low False Positive Rate (FPR) to high True Positive Rate
(TPR) by tuning the threshold $\gamma$. As is well know in the literature,
simultaneously achieving high TPR and low FPR may not be practically feasible
– decreasing FPR reduces TPR and increasing TPR raises FPR[4, 5]. Depending on
the type of application, high TPR may be more desirable while FPR up to a
threshold is acceptable (fire alarm systems, health and medical diagnosis
etc.); in other cases, low FPR is more critical while TPR above a threshold is
desirable (justice systems). The proposed model can be adapted to application
needs by simply tuning a single hyper-parameter $\gamma$ to achieve the
desired trade-off between TPR and FPR.

In the centralized setup of PHEC, we first process the data and perform
dimensionality reduction. Two classifiers based on KNN and Random forest
algorithms are trained separately using the extracted set of features. Then,
the classifiers’ outputs are averaged and depending on whether the average is
above pre-defined threshold, the final label is decided.

PHEC model is also adapted to federated settings with suitable modifications.
In federated settings, model parameters (the weights and biases) need to be
shared across devices. However, as there are no weights associated with KNN
and Random Forest, we use Multi-layer Perceptron (MLP) for training at each
node. The final output is the ensembled result of all the Multi-layer
Perceptrons.

In the federated setup, model parameters obtained by averaging the node
parameters may not be good in detecting rare attacks. This is because during
training, nodes generally face more samples of common attacks like DoS and
Probe, which contribute more in defining the aggregated model. So, relatively
infrequent attacks become difficult to detect. Another problem that may arise
is that different nodes often face different type of attacks (different
attacks generally have different characteristics). As an example, let’s say
node-$1$ faces more DoS attacks and node-$2$ faces mostly Probe attacks. Let
$W_{1},W_{2}$ denote model parameters for node-$1$ and node-$2$ respectively.
Even though $W_{1}$ and $W_{2}$ may be very good individually for DoS and
Probe attacks respectively, but the federated model obtained by averaging
these parameters $(W_{1}+W_{2})/2$ may not be much effective on either of the
attacks! The main reason is the non-iid nature of the training data across
different nodes. In our proposed model, we aim to overcome these issues. The
proposed federated PHEC is designed in a way so that each node gets
specialized in detecting a particular kind of an attack and then instead of
averaging out, we stack them. This kind of aggregation prevents high influence
of majority samples on the aggregated model.

Often accuracy of the federated frameworks [3] is significantly lower compared
to the centralized settings. However, the proposed federated PHEC architecture
shows good accuracy and TPR while keeping FPR within tolerable limit.

We next consider the case where labels may be corrupted by noise. Performance
of most of the supervised machine learning algorithms drop in the presence of
noise. We need Noise Robust Models to perform well in the presence of label-
noise in the training data. It is seen that classifiers that use weighted
convex surrogate loss functions, like Biased SVM and Weighted Logistic
Regression are provably noise-tolerant [6]. Using weighted version of the
convex surrogate loss functions, we modify the PHEC framework and propose
Noise-Tolerant PHEC in federated and centralized settings.

In summary, our contributions are as follows:

  * •

We develop PHEC architecture for centralized IDS that aims to achieve good TPR
while keeping FPR below a user-given permissible limit. The hyper-parameter
$\gamma$ allows the system to balance between TPR and FPR.

  * •

To address the privacy concerns related to the data, we adapt PHEC in
federated settings. We propose a different kind of model aggregation
‘FedStacking’ here. It is seen from the experiments that federated system
works faster than the centralized system.

  * •

We evaluate the performance of PHEC on four standard datasets, namely ‘NSL-
KDD’, ‘DS2OS Traffic Traces’, ‘Gas Pipeline Dataset’, ‘Water Tank Dataset’. On
the ‘NSL-KDD’ dataset, improvement is up to 10% TPR in centralized settings
and up to 6% accuracy in Federated settings. We achieved 1% improvement in TPR
on the ‘DS2OS Traffic Traces’ dataset (centralized and federated Settings). We
also observed more than 97% TPR for a minimal amount of FPR on both the ‘Gas
Pipeline’ and ‘Water Tank’ datasets in centralized and federated Settings.

  * •

To account for the label-noise problem, we propose Noise-Tolerant PHEC in both
centralized and federated settings. We are the first to propose Label-Noise
Robust Intrusion Detection System in IoT Security to the best of our
knowledge.

###  I-A Related Work

Intrusion detection System in Network Security has been well studied in last
few years. Existing IDS involves statistical models, machine learning
approaches and signal processing models. Classical statistical models like
Hidden Markov Model, Bayes Theory[7] have been implemented in this regard.

Centralized IDS setup: In the domain of Anomaly-based intrusion detection,
supervised learning classification models like Random Forest, Naive-Bayes
Classifier, SVM, Logistic Regression are often used [8, 9]. Unsupervised
approaches[10] come handy especially when there is a shortage of labeled data.
A hybrid model based on SVM and hierarchical clustering BIRCH is proposed in
[11], which performed well on DoS and Probe attacks but poorly on U2R and R2L
attacks. [1] proposed a hybrid model in centralized settings to detect threats
in IoT networks. To make the models computationally efficient, [12] applied
mutual information to select the optimal number of features for Intrusion
Detection System. Most of the earlier works [13, 14, 15] did not include FPR
into account and primarily focused on TPR and accuracy. PHEC is different from
the earlier works as we focus on optimizing both FPR and TPR simultaneously to
the best possible extent. Its performance is good not only in detecting common
attacks like DoS but also in detecting rare category of threats like U2R and
R2L.

Federated IDS setup: With the advent of fog computing, edge & cloud computing,
distributed frameworks have renewed interest. Many researchers have explored
federated Learning and its applications in recent past[16] and broader
problems and open challenges are discussed in [17]. [3] proposed IDS in
federated settings in IoT networks. They compared on-device training and
federated learning framework in their work and carried experimentation on the
NSL-KDD dataset[18]. Similar work was also done in [19], where Logistic
Regression was used to detect threats in IoT networks. Most of the previous
works related to federated learning[19, 3] use a simple weighted average
(FedAvg) to update the central server model. Here, we propose a different
model aggregation to adapt PHEC in federated settings.

Noise-Tolerant IDS: Label-Noise problem is often studied in the standard
classification task. The use of weighted convex surrogate loss functions to
reduce the effect of label noise is proposed in [20, 6]. [21] provided a
sufficient criteria for a loss function to be noise-robust. In this regard,
they showed that sigmoid loss, ramp loss, etc. are noise tolerant. [22] showed
that risk minimization under 0–1 loss function has impressive noise-tolerance
properties. Class-Conditional Noise is also studied by some researchers [23].
Here, we are considering the Symmetric Label Noise (SLN) problem only and have
proposed Noise Tolerant IDS in centralized and federated settings.
Organization of the paper: Section II describes the architecture of the
Probabilistic Hybrid Ensemble Classifier. Section III introduces the proposed
algorithm in centralized settings and gives its analysis. Section IV discusses
the proposed IDS in federated settings and Section V explains how the PHEC can
be adapted to address the Symmetric Label Noise (SLN) problem. Section VI
gives a brief description of the benchmark datasets used for the experiments.
Details of the experiments and results are discussed in Section VII. Section
VIII discusses the experiments on noisy labeled data. Conclusions with future
work is indicated in Section IX.

##  II Probabilistic Hybrid Ensemble Architecture

In this section we discuss Probabilistic Hybrid Ensemble Classifier (PHEC) for
IDS. PHEC involves an ensemble of classifiers whose predictions are combined
to label a given sample as threat or normal. Each classifier is separately
trained and are applied on each input parallely. A similar setup was proposed
by Pajouh [1], where multiple classifiers were used serially and in a
sequential manner. The parallel architecture gives the advantage of
controlling the False Positive Rate (FPR). We use the standard definitions of
TPR and FPR. Let TP, TN denote the number of True Positives & True Negatives
respectively and FP, FN denote the number of False Positives & False Negatives
respectively. Then,

$\mbox{TPR}=\frac{\mbox{TP}}{\mbox{TP+FN}}\quad\mbox{and}\quad\mbox{FPR}=\frac{\mbox{FP}}{\mbox{FP+TN}}.$

Figure 1: PHEC Architecture

PHEC architecture is shown in Figure 1. Let $n$ denote the number of
classifiers in PHEC. Each classifier gives a probability or confidence on
classifying an input as a threat. For a given sample, let $p_{i}$ for all
$i=1,2,\ldots,n$ denote the confidence of the $i$-th classifier in classifying
it as a threat. On $\\{p_{i}\\}$s, we apply aggregator function
$f:[0,1]^{n}\rightarrow[0,1]$ to get the final score, which is then compared
against a threshold $\gamma$. If $f(p_{1},p_{2},\ldots p_{n})>=\gamma$, then
the sample is labeled as threat, else it is labeled as normal. The parameter
$\gamma$ is based on the specified tolerance on FPR.

In security systems, often permissible value of FPR is specified. Let $u$
denote maximum tolerable limit of FPR. Under this circumstances, the objective
is to maximize the True Positive Rate (TPR) while keeping the FPR below $u$.
For a given $u$, let $g(\gamma)$ denote the TPR and $h(\gamma)$ denote the FPR
of PHEC. We set $\gamma\in[0,1]$ such that it maximizes the TPR subjected to
the FPR constraint as follows:

$\displaystyle\max_{0\leq\gamma\leq 1}\quad$ $\displaystyle g(\gamma)$
subjected to $\displaystyle h(\gamma)\leq u.$ (1)

##  III PHEC model in centralized setup

This section considers the case where the entire training data can be made
available in a single system. We first discuss how each classifier is trained
in PHEC and how their outputs are combined to obtain the final label. Figure 2
shows the four stages of the training phase in PHEC.

Figure 2: Block Diagram of Training Phase

###  III-A Data Prepossessing

This part involves data cleaning and normalization of features. Data cleaning
includes activities like converting categorical variables into numerical
values and dropping irrelevant features. Label Encoding is preferred to
execute the conversion of categorical variables into suitable numeric form and
features are further normalized. It is the process of scaling individual
samples to have unit norm. Features, that originally take wide range of
values, get scaled into a small range $[-1,1]$ from its original value. The
most familiar kind of normalization is ‘l2’ normalization. It creates
smoothness and also rotational invariance, which helps further in
dimensionality reduction.

###  III-B Dimensionality Reduction

This part uses Principal Component Analysis (PCA) for dimension reduction.
This allows the classification framework to use fewer features and helps to
make the detection system faster. However, instead of PCA, some other
dimension reduction framework like LDA, Autoencoder can be tried out. However,
PCA gave better performance on the NSL-KDD dataset as is evident from Table-
IX. We denote the number of extracted features after dimensionality reduction
as $M$. This value of $M$ is a hyperparameter that can be suitably chosen. An
useful approach may be to use cross-validation to find the best possible value
of $M$. However, this cross-validation itself is quite time-consuming and
often, close to the optimal number of extracted dimensions workout well
practically.

###  III-C Classifier Selection and Training

In the centralized settings, we restrict to fewer classifiers as each
classifier is trained on the entire dataset. We set $n=2$ and use $K$-Nearest
Neighbour (KNN) and Random Forest (RF) as the two classifiers. Both the
classifiers are trained independently using their probabilistic outputs. One
could use other classifiers like SVM, Logistic Regression. However, KNN and
Random Forest are preferred due to its simplicity and ensemble nature
respectively. Further, the usage of these two classifiers gave better
performance than other combinations of classifiers. The aggregator function
$f$ is simply the arithmetic mean, i,e, if the prediction probabilities of KNN
and Random Forest classifier are $p_{1}$ and $p_{2}$ respectively, then

$f(p_{1},p_{2})=\frac{(p_{1}+p_{2})}{2}$.

Tuning $\gamma$: Finding optimal $\gamma$ over the range $[0,1]$ is
challenging. Instead, we discretize $[0,1]$ into a finite set of values and
search for the best value of $\gamma$. We compute $g(\gamma)$ and $h(\gamma)$
over the validation dataset and obtain optimal value of $\gamma$ by solving
optimization problem 1 (see Eq. (1)) over discrete values of $\gamma$. We
denote the optimal value of $\gamma$ as $\gamma^{*}$.

###  III-D Testing Phase

For a test sample, let the trained KNN and RF predict the chances that it
belongs to ‘Threat’ class with confidence $p_{1}$ and $p_{2}$, respectively.
Then, the test sample is labeled as ‘Threat’ if
$f(p_{1},p_{2})\geq\gamma^{*}$, it is labeled ‘Normal’ otherwise.

##  IV PHEC in Federated Settings

In this section we discuss the adaptation of PHEC in federated settings. The
federated setup in [19] allows each node to train on local data that includes
samples from different type of attacks and non-malicious samples. Then the
node parameters are averaged to form the final aggregated model. The drawback
of this model is that the training data are often dominated by samples of
common attacks and the parameters of the aggregated central model obtained by
averaging the parameters of the nodes do not generalize well to detect rare
types of attacks. We overcome this issue by specializing each node for
detecting a particular kind of attack and then combining them in a slightly
different manner. Our federated setup is based on the idea that each node is
trained to detect a particular type of attack and the parameters of each node
are used separately at the central node to retain the characteristics of each
node.

We group different attacks in training data into $n$ major category based on
their characteristics. One such example of grouping of various attacks is
shown in Table-I. The value of $n$ depends on the network size, different
devices connected to the network etc. However, most of the attacks that IoT
networks face generally fall into any one of the $4$ broader groups, namely
User to Root (U2R), Remote to Local (R2L), Denial of Service (DoS), and Probe
[1]. Hence for practical purposes, $n$ may be chosen as $4$.

TABLE I: Grouping of Different Attacks in IoT Networks Broad Class | Sub-class of attack in training and test data
---|---
DoS | back, land, neptune, pod, smurf, teardrop
| apache2, mailbomb, processtable, udpstorm, worm
R2L | ftp write, spy, guess passwd, imap, multhop, phf
| xlock, xsnoop, warezclient, warezmaster, snmpguess
| sendmail, named, snmpgetattack, httptunnel
Probe | ipsweep, nmap, portsweep, satan, mscan, saint
U2R | buffer overflow, perl, loadmodule, rootkit
| ps, sqlattack, xterm
Figure 3: PHEC in federated framework

Federated Architecture: The PHEC architecture in the federated setup is shown
in Fig. 3. It consists of $n$ nodes and one central node. Each of the $n$
nodes use a local training dataset to train a Multi-Layer Perceptron (MLP) and
share their MLP parameters with the central server where they are aggregated.
For each sample data, the aggregated model outputs probability vector
$(p_{1},p_{2}\ldots p_{n})$, where $p_{i}$ corresponds to the probability
obtained using the parameters of the $i$ th MLP from $i$ th node. The sample
is classified as ‘Threat’ / ‘Normal’ by thresholding $f(p_{1},p_{2}\ldots
p_{n})$ at $\gamma^{*}$. We next discuss how individual models are trained and
model parameters are aggregated.

Dataset Preparation: For a completely new system, a test-bed may be setup to
collect the data. All the samples belonging to $i$ th type of attack are
collected and put in group $D(i)$. Now, the remaining non-malicious samples
are added to each group such that the malicious and non-malicious samples are
in the ratio $1:1$. Usually, the number of non-malicious samples be much more
than the malicious samples and hence multiple datasets with equal proportions
of malicious and non-malicious samples can be created.
Classifier Selection: In the centralized setup of PHEC, Random Forest and KNN
were used. However, they cannot be used in the federated setup as they are
non-parametric. For better aggregation, the parametric model MLP is a natural
choice. Here, each of the $n$ nodes involved trains one MLP each.
Label Assignment: Let $w_{i}$ denote the set of MLP parameters of node $i$.
Each sample passes through each of the $n$ MLPs. Let $p_{i}$ denote the
probability that the sample belongs to malicious class as predicted by the MLP
parameters of the $i$ th node. The aggregated model combines the probabilities
from $n$ MLPs resulting in a probability vector $(p_{1},p_{2}\ldots p_{n})$.
and then apply an aggregate function $f$ as follows:

$f(p_{1},p_{2},\cdots p_{n})=max(p_{1},p_{2},\cdots p_{n})$

If $f(p_{1},p_{2},\cdots p_{n})$ exceeds $\gamma^{*}$, then the sample is
labeled as ‘Threat’, else labeled as ‘Normal’, where $\gamma^{*}$ is a
hyperparameter tuned using a validation set.
Now that the procedure to generate the labels from $\hat{w}_{t}$ and
$\gamma^{*}$ is clear, we will discuss how to find the matrix $\hat{w_{t}}$
and the optimal threshold $\gamma^{*}$.
Decentralized Training: Each of the $n$ MLP classifiers is trained using the
local dataset available to that particular node ($i$ th node has access to the
local dataset $D(i)$). Back-propagation algorithm can be used to tune the
parameters (set of weights & biases) of each of the $n$ MLPs.
For node $i=1,2,\cdots n$, node parameters are updated in round $t$ as
follows:

  1. 1.

The gradient is calculated on $D(i)$ as $g_{i}=\nabla F_{i}(w_{i}^{t})$, where
$F_{i}(w_{i}^{t})$ is the cross-entropy loss for the $i$-th node with the
model parameters $w_{i}^{t}$.

  2. 2.

The parameters of $i$-th node at $(t+1)$ iteration are updated as
$w_{i}^{t+1}\leftarrow w_{i}^{t}-\eta g_{i}$, where $\eta$ is learning rate.

Model Aggregation: The model aggregation takes place in the central node.
Individual nodes can download and use the aggregated model. The most common
technique of model aggregation is FedAvg[19, 3]. Instead of FedAvg, we propose
and use a stacked aggregation model (FedStacking).

In IoT networks, different devices may face different attacks, resulting in
non-iid data. Federated architecture with FedAvg Aggregation may not perform
well on non-iid data. Secondly, the central model in FedAvg gets more
influenced by attacks that frequently occur in training data, resulting in
poor detection of rare type of attacks (e.g. U2R,R2L).
FedAvg: It is the weighted average of all the trained parameters. In the
$t$-th iteration, an update of the central server model can be made as,

$\hat{w_{t}}=\sum_{i=1}^{n}\frac{a_{i}}{a}w_{i}^{t}.$

Here, $a_{i}$ denotes the size of the training data for the $i$ th node
($a_{i}=|D(i)|$) and $a=\sum_{i=1}^{n}a_{i}$.
FedStacking: We concatenate the parameters of the trained models (of $n$
nodes) in order to store them efficiently. Consider the matrix $\hat{w}_{t}$
with the number of columns as $n$ such that $i$ th column corresponds to the
model parameters $w_{i}^{t}$.

$\hat{w}_{t}=\left[w_{1}^{t},w_{2}^{t},\ldots w_{n}^{t}\right]$

Now the central node just needs to store the matrix $\hat{w}_{t}$. The matrix
$\hat{w}_{t}$ corresponds to the resultant model set of parameters at the end
of $t$-th iteration.
Model Evaluation: The model is evaluated on a validation dataset. As in the
centralized setup, we discretized the values of $\gamma$ over $[0,1]$ into $S$
uniformly spaced values. Given a predefined value of $u$, the training is
performed as follows.
For each iteration $t=1,2,\ldots$

  1. 1.

Using $\hat{w_{t}}$, generate the probability vector $(p_{1},p_{2}\ldots
p_{n})$ for each sample in the validation data.

  2. 2.

For each $\gamma\in S$, assign the label to all the samples in the validation
data and evaluate associated TPR and FPR.

  3. 3.

Find optimal $\gamma$ that maximizes TPR while keeping FPR below $u$ (see Eq.
(1)). Say the optimal value of $\gamma$ in round $t$ is $\gamma^{t}$.

  4. 4.

Repeat untill the stopping criteria is met.

Stopping Criteria: With the increase in iteration $t$, if it is seen that TPR
has saturated/ TPR starts dropping, the training is stopped and the final
parameters are stored. As soon as the central node detects the saturation of
TPR, the same is communicated to the nodes and local training at all the nodes
also stop. If the training is stopped at $t=T$, then $\gamma^{T}$ is taken as
$\gamma^{*}$ and $\hat{w}_{T}$ gives the final set of parameters. It is
important to carefully choose the stopping point: stopping early may underfit
the data whereas stopping late may lead to overfitting of data.

The choice of $n$ plays a major role in the federated settings. There may be
trade-off between quicker detection and performance metrics. For large value
of $n$, as more number of MLP classifiers get involved, Detection time
increases (slower detection). On the other hand, with large $n$, we can make
more specific grouping of different attacks, it may lead to better performance
metrics.

Some of the benchmark datasets will involve a mix of multiple threats. The
usual practice is to divide the benchmark datasets into $n$ groups, followed
by pre-processing and supplying it locally to each of the individual node[19,
3]. To evaluate the proposed model, it is customary to split the dataset into
multiple datasets and use it as local training data.

##  V Symmetric Label Noise-Tolerant PHEC

Label-Noise is a common problem in the domain of supervised Machine-Learning.
Symmetric Label Noise (SLN) is defined as the label noise problem where each
label is flipped independently with some probability $\rho\in[0,0.5)$ and the
degree of flipping a label is independent of the actual label of the class.
Class-Conditional random noise is the label noise problem where the degree of
noise depends on the class in which the instance belongs. Consider a binary
classification task with actual label $y\in\\{-1,1\\}$ and the flipped label
$\tilde{y}$, let’s define $\rho_{+1}=P(\tilde{y}=-1|y=+1)$,
$\rho_{-1}=P(\tilde{y}=+1|y=-1)$. For SLN Noise, $\rho_{+1}=\rho_{-1}=\rho$.
For the IDS using supervised methods, it is important to address the issue of
the label-noise problem. We modify the proposed PHEC models in centralized and
federated setup such that the modified PHEC performs well even in the presence
of SLN noise.

Under the binary classification task, [20] proposed weighted loss function
(convex surrogate functions) in the presence of SLN noise. An unweighted loss
function in binary classification (where true label $y\in\\{-1,1\\}$) takes
the form,

$l(z,y)=1_{\\{y=1\\}}l_{1}(z)+1_{\\{y=-1\\}}l_{-1}(z)$

where $z$ represents the margin, $z=yg(x)$, $g(x)$ corresponds to the function
of the specific classifier. $l_{1}(z)$ and $l_{-1}(z)$ indicate the loss
function for the true label $y=1$ and $y=-1$ respectively.
Proposed $\alpha$-Weighted loss function takes the form,

$l_{\alpha}(z,y)=(1-\alpha)1_{\\{y=1\\}}l(z)+\alpha 1_{\\{y=-1\\}}l(-z)$

If the loss function given by $l$ is convex, then this $\alpha$-weighted loss
function $l_{\alpha}(z,y)$ (with suitably chosen $\alpha$) turns out to be
noise tolerant[20, 6]. As a consequence of this, suitably weighted Biased SVM
and weighted Logistic Regression are provably Noise-Tolerant [20, 6].
Noise-Tolerant PHEC (NT-PHEC) in Centralized Setup: In the proposed PHEC model
in centralized setup, PCA is used for dimension reduction. PCA does not use
the label information and hence, label noise-tolerant. For the noise tolerant
PHEC, we propose the following modifications to the model proposed in section
III.

  1. 1.

Random Forest can be replaced by weighted Logistic Regression classifier.
Finding optimal $\alpha$ over the range $[0,1]$ is challenging. Instead, we
discretize $[0,1]$ into a finite set of values and search for the best
$\alpha$.

  2. 2.

The other classifier used in the proposed PHEC is KNN. KNN involving large
number of nearest neighbors i.e. KNN with a higher value of $K$ performs well
in the presence of SLN Noise [24]. Intuitively, this is due to the fact that
larger the value of $K$, the lesser the effect of label noises on the majority
decision that is taken by the KNN classifier. So, we propose to apply the
constraint $K\geq 5$ for KNN.

Noise-Tolerant PHEC (NT-PHEC) in Federated Setup: For MLP, the resulting
cross-entropy loss function may turn out to be non-convex. However, to restore
the convexity of the loss function, we propose to limit the number of layers
to one input layer and one output layer that consists of a single neuron with
a sigmoid activation function. This binary classification unit (with cross-
entropy loss) performs similarly to a binary logistic regression classifier
and it leads to optimizing over a convex surrogate loss function. Now,
$\alpha$-weighted cross-entropy loss can be used as a noise-tolerant convex
surrogate loss function. Rest of the architecture remains exactly same as that
is proposed in section IV. To find the suitable value of $\alpha$, we
discretize $[0,1]$ into a finite set of values and search for the best value
of $\alpha$.

The advantages of this proposed model are as follows:

  1. 1.

This proposed architecture is Noise Tolerant.

  2. 2.

For $\alpha=1/2$, weighted cross-entropy loss turns out to be the same as
unweighted cross-entropy loss function. With the $\alpha$-weighted loss,
$\alpha$ can be tuned in order to find the best possible value of $\alpha$ in
the range $[0,1]$. As this range includes $\frac{1}{2}$, range of $\alpha$ in
unweighted case is a strict subset of range of $\alpha$ in weighted loss
function. So, for the exactly same setup, an MLP classifier, trained with
weighted cross-entropy loss (with optimally chosen $\alpha$) is expected to
perform at least as good as the MLP classifier (with exactly the same
architecture) trained on an unweighted loss function. However, due to
discretization of $\alpha$ over the range $[0,1]$, it may be difficult to find
out the optimal $\alpha$ practically. Hence, the superiority of
$\alpha$-weighted loss functions over unweighted loss functions may not be
evident sometimes (if optimal $\alpha$ is not chosen).

  3. 3.

Any class imbalance nature present in the dataset (if exists), can be adjusted
by suitable weighting of $\alpha$.

##  VI Description of the datasets

In this section, we describe four benchmark datasets that are used to evaluate
the performance of the proposed models.
NSL-KDD Dataset[18, 25]: This NSL-KDD dataset is improved version of the KDD99
dataset. There were some problems pointed out on KDD99, which are later
rectified in this NSL-KDD dataset. The modifications in NSL-KDD dataset are as
follows:

  1. 1.

Redundant records & features are removed from the training dataset. Duplicate
Records are deleted from the test dataset.

  2. 2.

Number of selected records from each difficulty level group is inversely
proportional to the percentage of records in KDD99 dataset

  3. 3.

The number of samples are quite affordable in both training and test dataset,
that makes it relatively easier and cheaper to experiment with.

This dataset is having 3 sections, one is the large ‘train+’ dataset, second
one is the ‘Train+_20Percent’ and last one is the ‘test+’ data. The first two
are used for training purposes where ‘Train+_20Percent’ is a 20% subset of the
‘train+’ dataset. There are 41 features and one label column in all three
datasets. It is important to note that 17 such new type of attacks exist in
‘test+’ dataset that are not present in the training data. This makes NSL-KDD
very relevant in IoT security, as it is very important to detect previously
unknown attacks.

Here, this grouping of smaller category attacks into a larger category is
essential due to the following reasons:

  1. 1.

For many attacks, very few training samples are available. It is difficult to
train a machine learning algorithm on these very few number of samples.

  2. 2.

There exist many sub-classes of attacks in the test dataset, which do not
exist in training data. So, it is impossible to detect unknown attacks without
such grouping.

The grouping of sub-classes of attacks into broader categories is given in
Table I. Similar grouping was used in [14].
Even though all these attacks are present in the data, still both training as
well as test data are very skewed and the distribution is non-uniform in
training and test datasets. There exists class imbalance in NSL-KDD data. More
than half of the samples (data points) in the training data belongs to normal
traffic and U2R & R2L are extremely rare in terms of frequency. Even with this
low frequency of U2R, R2L attacks, this data is a very realistic and quite
accurate representation of distribution of modern-day attacks in IoT networks.
This is because the most frequent attack in IoT network is DoS, also U2R and
R2L are extremely rare in reality. Even though R2L & U2R are rare, these
occasional attacks may make the entire network vulnerable to malware.

DS2OS Traffic Traces[26]: This is an open source benchmark dataset in IoT
security, contributed by [26]. The creators captured the data using four
simulated IoT sites with different type of services: light controller,
thermometer, movement sensors, washing machines, batteries, thermostats, smart
doors and smartphones. Each of the sites had a different organization and a
different number of services. They created a virtual IoT environment using
Distributed Smart Space Orchestration System (DS2OS) for producing synthetic
data.

TABLE II: Different Type of Attacks and its Distribution in the Dataset Attack | Frequency | % of Data | % of Anomaly
---|---|---|---
Denial of Service | 5780 | 01.61% | 57.70%
Data Type Probing | 342 | 00.09% | 03.41%
Malicious Control | 889 | 00.24% | 08.87%
Malicious Operation | 805 | 00.22% | 08.03%
Scan | 1547 | 00.43% | 15.44%
Spying | 532 | 00.14% | 05.31%
Wrong Setup | 122 | 00.03% | 01.21%
TABLE III: Features and its Description Feature Number | Features | Type of Data
---|---|---
1 | Source ID | Nominal
2 | Source Address | Nominal
3 | Source Type | Nominal
4 | Source Location | Nominal
5 | Destination Service Address | Nominal
6 | Destination Service Type | Nominal
7 | Destination Location | Nominal
8 | Accessed Node Address | Nominal
9 | Accessed Node Type | Nominal
10 | Operation | Nominal
11 | Value | Continuous
12 | Timestamp | Discrete
13 | Normality | Nominal

Table-II describes the different types of attacks and their distributions.
Clearly, majority of the attack samples belong to the ‘Denial of Service’
type. Table-III describes different features and their corresponding
datatypes. Here the target variable is ‘Normality’.

Gas Pipeline Data (SCADA Traffic and Payload Datasets)[27]: This is a freely
available dataset collected in Gas Pipeline. It was generated from network
flow records that was captured with a serial port data logger. Here two
categories of features are present, namely network traffic features and
payload content features. Network traffic features include the device address,
function code, length of packet, packet error checking information and time
intervals between packets. While “network traffic features” account for the
communication patterns in networks, “Payload content features” takes care of
the system’s current state.

First two datasets[18, 26] include features only related to network traffic.
However, this Gas Pipeline Data includes features involving payload patterns
as well as Network Traffic.

Water Tank Data (SCADA Traffic and Payload Datasets)[27]: This dataset is
quite similar to the Gas Pipeline Data, both these datasets include Traffic
and Payload Data in a SCADA network. However, this dataset is collected in
Water Storage Tank instead of a Gas Pipeline system.

##  VII Implementation & Experimental Results

The experiments are conducted in Google Colab using Python programming
language, running on a personal computer. All the performance metrics are
expressed in percentages.

###  VII-A NSL-KDD Dataset

####  VII-A1 PHEC in Centralized Setup

For the experimental results in Table-LABEL:table:results_1, extracted number
of dimensions considered are 20. In Table-LABEL:table:results_1, models are
trained on smaller training dataset (‘Train+_20 Percent’). It can be observed
that PHEC is the best performing model in terms of detecting threats and that
by quite significant margin (maximum TPR obtained using PHEC is atleast 10%
more compared to any other model).

TABLE IV: Results on ‘test+’ dataset (trained on ‘train+_20percent’ data) Model | $\gamma^{*}$ | TPR | FPR | Accuracy | $u$
---|---|---|---|---|---
PHEC | 0.015 | 94.6 | 12.34 | 91.6 | 13
PHEC | 0.030 | 92.28 | 9.94 | 91.34 | 10
PHEC | 0.060 | 88.04 | 6.22 | 90.77 | 6.5
PHEC | 0.065 | 86.98 | 5.39 | 90.27 | 6
PHEC | 0.075 | 86.38 | 5.25 | 89.98 | 5.25
TDTC[1] | N/A | 84.82 | 5.56 | N/A | N/A
Two-Tier[2] | N/A | 83.24 | 4.83 | N/A | N/A
Naive Bayes[8] | N/A | 76.56 | N/A | N/A | N/A
Random Forest[8] | N/A | 80.67 | N/A | N/A | N/A
SVM[8] | N/A | 69.52 | N/A | N/A | N/A
Decision Trees(J48)[8] | N/A | 81.05 | N/A | N/A | N/A

If TDTC[1] and PHEC (at $\gamma^{*}=0.075$) are compared in Table-
LABEL:table:results_1, it can be seen that for PHEC, results have
significantly improved in terms of both FPR and TPR. It indicates direct
superiority of PHEC over TDTC[1]. Compared to Two-Tier model[2], TPR in PHEC
(at $\gamma^{*}=0.075$) improved by 3.14% at the cost of only additional 0.42%
FPR. Also, it is seen that as $\gamma^{*}$ drops, desired metric TPR gets
improved but that happens at the cost of larger value of FPR.

TABLE V: Results on ‘test+’ dataset (model trained on larger training dataset) Model | $\gamma^{*}$ | TPR | FPR | Accuracy | $u$
---|---|---|---|---|---
PHEC | 0.010 | 95.85 | 12.70 | 92.17 | 13
PHEC | 0.020 | 93.07 | 10.91 | 91.41 | 11
PHEC | 0.045 | 90.875 | 6.8 | 91.89 | 7
PHEC | 0.050 | 90.06 | 6.44 | 91.52 | 6.5
SVM-IDS[9] | N/A | 82 | 15 | N/A | N/A
Two-Tier[2] | N/A | 81.97 | 5.44 | N/A | N/A
TDTC[1] | N/A | 84.86 | 4.86 | N/A | N/A
SOM-IDS[28] | N/A | 75.49 | N/A | N/A | N/A

The results in Table-LABEL:table:results_2 are obtained when models are
trained on larger training dataset. Number of extracted dimensions considered
are 16. If results of PHEC are compared with that of Two-Tier[2] and TDTC[1]
models, it is seen that the TPR has improved by a large margin at the expense
of very small increase to the metric FPR. Compared to the Two Tier model[2],
TPR has improved by 8.09% at the expense of 1% extra FPR in PHEC
($\gamma^{*}=0.050$). Also, compared to the TDTC[1], TPR has improved by by
5.20% at the expense of only 1.58% extra FPR in PHEC ($\gamma^{*}=0.050$).
Classification Results (For Each Category of Attack): We evaluate the
effectiveness of the proposed PHEC algorithm on common as well as on uncommon
category of attacks. The results show that PHEC is the best performing model
for common (Probe) as well as uncommon attacks (U2R, R2L).

For Table-VI, FPR is $5.39$%, $\gamma^{*}=0.065$ and $u=6\%$.

TABLE VI: results on ‘test+’ data for each category of attack (model trained on ‘Train+_20Percent’ dataset) Attack | Total | Detected as Threat | Not Detected | TPR
---|---|---|---|---
R2L | 2885 | 1571 | 1314 | 54.45
U2R | 67 | 53 | 14 | 79.10
DoS | 7460 | 7124 | 336 | 95.50
Probe | 2421 | 2415 | 6 | 99.75

For Table-VII, FPR is $6.44\%$, $\gamma^{*}=0.05$ and $u=6.5\%$.

TABLE VII: results on ‘test+’ data for each category of attack (model trained on larger training dataset) Attack | Total | Correctly Classified | Misclassified | TPR
---|---|---|---|---
R2L | 2885 | 1957 | 928 | 67.83
U2R | 67 | 40 | 27 | 59.70
DoS | 7460 | 7154 | 306 | 95.90
Probe | 2421 | 2397 | 24 | 99
TABLE VIII: Comparative analysis of TPR on ‘test+’ dataset Algorithm | Trained on | Probe | DoS | U2R | R2L
---|---|---|---|---|---
PHEC | Train+ | 99 | 95.90 | 59.70 | 67.83
PHEC | Train+_20% | 99.75 | 95.50 | 79.10 | 54.45
SVM with BIRCH[11] | N/A | 99.5 | 97.5 | 28.8 | 19.7
TDTC[1] | N/A | 87.32 | 88.20 | 70.15 | 42
Two-tier[2] | N/A | 79.76 | 84.68 | 67.16 | 34.81
Association IDS [8] | N/A | 96.8 | 74.9 | 0.79 | 0.38
HFR-MLR [29] | N/A | 80.2 | 89.70 | 29.50 | 34.20
ESC-IDS[30] | N/A | 99.5 | 84.1 | 31.5 | 14.1

Effect of Dimension Reduction on Results: In the proposed PHEC algorithm,
different dimension reduction techniques can be applied. We implement
nonlinear dimensionality reduction like Autoencoder and linear dimensionality
reduction like Linear Discriminant Analysis (LDA) along with PCA in the
proposed PHEC setup. In Table-IX, it can be seen that performance of PHEC with
PCA is way better than other dimension reduction techniques.

TABLE IX: Effect of Dimension Reduction on Results Dimension Reduction | $\gamma^{*}$ | FPR | TPR
---|---|---|---
Autoencoder | 0.010 | 13.625 | 89.74
Autoencoder | 0.020 | 11.46 | 84.92
Autoencoder | 0.045 | 9.88 | 78.10
Autoencoder | 0.050 | 9.70 | 77.51
LDA | 0.010 | 13.29 | 72.25
LDA | 0.020 | 13.23 | 72.13
LDA | 0.045 | 13.23 | 72.13
LDA | 0.050 | 13.23 | 72.13
PCA | 0.010 | 12.7 | 95.85
PCA | 0.020 | 10.91 | 93.07
PCA | 0.045 | 6.80 | 90.875
PCA | 0.050 | 6.44 | 90.06
PCA+LDA | 0.010 | 13.15 | 72.67
PCA+LDA | 0.020 | 13.09 | 72.48
PCA+LDA | 0.045 | 13.09 | 72.48
PCA+LDA | 0.050 | 13.09 | 72.48

####  VII-A2 PHEC in Federated Setup

Table-X shows the performance of proposed PHEC Model in federated settings.
Even though performance in Federated Settings dropped compared to PHEC in
centralized settings, still very high TPR along-with decent accuracy can be
obtained here.

TABLE X: Experimental Results of PHEC on NSL-KDD Dataset (‘test+’ Dataset) in Federated Settings $n$ | $u$ | $\gamma^{*}$ | Accuracy | TPR | Precision | FPR | Training Data
---|---|---|---|---|---|---|---
4 | 10 | 0.75 | 88.42 | 96.67 | 85.04 | 9.68 | ‘Train+’
4 | 9 | 0.875 | 87.27 | 93.16 | 85.72 | 8.83 | ‘Train+’
4 | 10 | 0.015 | 83.78 | 88.46 | 83.92 | 9.64 | ‘Train+_20Percent’

In a recent work on IoT security [3], test accuracy reported on NSL-KDD
dataset in Federated settings was around 82% but significantly improved
performance is obtained here.

###  VII-B DS2OS Traffic Traces Dataset

  1. 1.

PHEC in Centralized Setup:

TABLE XI: Experimental Results on ‘DS2OS Traffic Traces’ Dataset (Training Data) in Centralized Settings Model | Accuracy | TPR | FPR | F1-Score
---|---|---|---|---
PHEC | 99.97 | 100 | 0.026 | 99
Logistic Regression[31] | 98.3 | 98 | N/A | 98
SVM[31] | 98.2 | 98 | N/A | 98
Decision Tree[31] | 99.4 | 99 | N/A | 99
Random Forest[31] | 99.4 | 99 | N/A | 99
Neural Net[31] | 99.4 | 99 | N/A | 99

Table-XI & XII presents comparative results on training and test dataset of
‘DS2OS Traffic Traces’ respectively. Here, the maximum tolerable limit of FPR
$u$ is fixed at $1\%$.

TABLE XII: Experimental Results on ‘DS2OS Traffic Traces’ Dataset (Test Data) in Centralized Settings Model | Accuracy | TPR | FPR | F1-Score
---|---|---|---|---
PHEC | 99.98 | 100 | 0.016 | 99.3
Logistic Regression[31] | 98.3 | 98 | N/A | 98
SVM[31] | 98.2 | 98 | N/A | 98
Decision Tree[31] | 99.4 | 99 | N/A | 99
Random Forest[31] | 99.4 | 99 | N/A | 99
Neural Net[31] | 99.4 | 99 | N/A | 99
  2. 2.

PHEC in Federated Setup: PHEC achieves more than $98\%$ accuracy on ‘DS2OS
Traffic Traces’ data in federated settings.

TABLE XIII: Experimental Results on ‘DS2OS Traffic Traces’ Dataset (Test Data) in Federated Settings $u$ | $n$ | $\gamma^{*}$ | Accuracy | TPR | FPR | Precision | F1-score
---|---|---|---|---|---|---|---
2 | 7 | 0.925 | 98.27 | 97.69 | 1.674 | 61.5 | 75.49

###  VII-C Gas pipeline Data (SCADA Traffic and Payload Datasets)

  1. 1.

PHEC in Centralized Setup: Table-XIV presents the experimental results on ‘Gas
Pipeline’ dataset. Results indicate the excellence of performance of PHEC in
centralized settings.

TABLE XIV: Experimental Results on ‘Gas Pipeline’ Data in Centralized Settings (Test Data) $u$ | $\gamma^{*}$ | Accuracy | TPR | FPR | Precision | F1-score
---|---|---|---|---|---|---
2 | 0.3 | 98.38 | 97.56 | 1.15 | 97.98 | 97.77
  2. 2.

PHEC in Federated Setup: Table-XV shows that the performance observed in
Federated settings (in PHEC) is marginally better than centralized settings!
Generally, centralized settings gives better performance metrics, here we
observe slight exception in results.

TABLE XV: Experimental Results on ‘Gas Pipeline’ Data (Test Data) in Federated Settings $u$ | $n$ | $\gamma^{*}$ | Accuracy | TPR | FPR | Precision | F1-score
---|---|---|---|---|---|---|---
1 | 7 | 0.95 | 98.71 | 97.47 | 0.36 | 98.99 | 98.22

###  VII-D Water Tank (SCADA Traffic and Payload Data)

  1. 1.

PHEC in Centralized Setup: Here PHEC is implemented on ‘Water Tank’ dataset in
centralized settings and results are presented in Table-XVI. Results show that
for a very less FPR ($<1\%$), obtained TPR and Accuracy are very high! (Both
are $>99\%$.)

TABLE XVI: Experimental Results on ‘Water Tank’ Data (Test Data) in Centralized Settings $u$ | $\gamma^{*}$ | Accuracy | TPR | FPR | Precision | F1-score
---|---|---|---|---|---|---
1 | 0.25 | 99.11 | 99.37 | 0.99 | 97.40 | 98.37
  2. 2.

PHEC in Federated Setup: Table-XVII shows that even though performance of PHEC
dropped in federated settings, still the performance is quite good.

TABLE XVII: Experimental Results on ‘Water Tank’ Data (Test Data) in Federated Settings $u$ | $n$ | $\gamma^{*}$ | Accuracy | TPR | FPR | Precision | F1-score
---|---|---|---|---|---|---|---
6 | 7 | 0.95 | 93.74 | 97.41 | 5.56 | 82.34 | 89.24

###  VII-E Comparison of Time in Centralized and Federated Settings

Here we compare the time required to detect a test sample in centralized and
federated settings. It can be seen that time required is (10-100) times less
in federated setup. This is very useful in IoT security as often, intrusions
have substantial effect on system and detecting at earlier stage makes sure
that immediate actions can be taken.

TABLE XVIII: Comparison of Time in Centralized and Federated Settings Dataset | Settings | Time/Instance
---|---|---
NSL-KDD | Centralized |  $9.02*10^{-6}$s
NSL-KDD | Federated | $1.14*10^{-8}s$
DS2OS | Centralized | $37.1*10^{-6}s$
DS2OS | Federated | $0.736*10^{-8}s$
Gas Pipeline Data | Centralized | $6.96*10^{-6}s$
Gas Pipeline Data | Federated | $0.882*10^{-8}s$
Water Tank Data | Centralized | $10.6*10^{-6}s$
Water Tank Data | Federated | $8.89*10^{-8}s$

##  VIII Implementation and Results on Noisy Data

###  VIII-A Centralized Settings

Degree of noise (in Percentage) is represented by $\rho$ and we consider,
$\rho\in\\{10,20\\}$.

The following steps are taken to generate noisy training labels.

  1. 1.

For each instance of the training data, generate one uniform random number $v$
that lies in-between $[0,1]$.

  2. 2.

If $100v\leq\rho$, then change the label of that instance. Otherwise, keep it
as it is.

Now, the training data is having $\rho$% of the training samples with noisy
labels.

TABLE XIX: Experimental Results on Noisy Data using Noise Tolerant PHEC in Centralized Settings Dataset | $\rho$ | Accuracy | FPR | TPR
---|---|---|---|---
NSL-KDD | 10 | 83.22 | 11.05 | 78.89
NSL-KDD | 20 | 81.02 | 11.12 | 75.07
DS2OS | 10 | 99.96 | 0.0186 | 98.46
DS2OS | 20 | 95.13 | 4.87 | 95.64
Gas Pipeline | 10 | 97.48 | 1.66 | 95.98
Gas Pipeline | 20 | 92.74 | 6.844 | 92.015
Water Tank | 10 | 97.83 | 0.73 | 93.87
Water Tank | 20 | 93.74 | 6.61 | 94.71

The performance of Noise Tolerant PHEC (NT-PHEC) on noisy and clean data are
tabulated in Table-XIX and Table-XX respectively.

TABLE XX: Experimental Results on Clean Data using Noise Tolerant PHEC in Centralized Settings Dataset | Accuracy | FPR | TPR
---|---|---|---
NSL-KDD | 83.77 | 3.2 | 73.92
DS2OS | 99.97 | .01 | 98.56
Gas Pipeline | 98.33 | 0.64 | 96.53
Water Tank | 98.64 | 0.66 | 96.72

###  VIII-B Federated Settings

The results obtained using Noise Tolerant PHEC (NT-PHEC) on noisy as well as
on clean data are presented in this section.

TABLE XXI: Experimental Results on Noisy Data using Noise Tolerant PHEC in Federated Settings Dataset | $\rho$ | Accuracy | FPR | TPR
---|---|---|---|---
NSL-KDD | 10 | 76.48 | 19.12 | 92.30
NSL-KDD | 20 | 74.22 | 21.44 | 92.39
DS2OS | 10 | 91.66 | 7.34 | 63.54
DS2OS | 20 | 90.48 | 8.50 | 62.87
Gas Pipeline | 10 | 94.26 | 1.282 | 87.79
Gas Pipeline | 20 | 93.988 | 1.28 | 87.046
Water Tank | 10 | 90.47 | 0.0017 | 64.21
Water Tank | 20 | 90.22 | 0.28 | 64.35
TABLE XXII: Experimental Results on Clean Data using Noise Tolerant PHEC in Federated Settings Dataset | Accuracy | FPR | TPR
---|---|---|---
NSL-KDD | 83.65 | 15.86 | 99.15
DS2OS | 94.224 | 5.22 | 79.89
Gas Pipeline | 94.75 | 1.28 | 89.13
Water Tank | 90.48 | 0.0067 | 64.28

###  VIII-C Comparison of Results on Noisy and Clean Data

Here, we compare the accuracy obtained using NT-PHEC and PHEC in both
centralized and federated settings.

TABLE XXIII: Comparison of Experimental Results on Noisy Data using Noise Tolerant PHEC and PHEC in Centralized Settings Dataset | $\rho$ | Accuracy of PHEC | Accuracy of NT-PHEC
---|---|---|---
NSL-KDD | 10 | 82.18 | 83.22
NSL-KDD | 20 | 76.36 | 81.02
DS2OS | 10 | 85.96 | 99.96
DS2OS | 20 | 79.25 | 95.13
Gas Pipeline | 10 | 90.86 | 97.48
Gas Pipeline | 20 | 84.24 | 92.74
Water Tank | 10 | 87.05 | 97.83
Water Tank | 20 | 86.95 | 93.74

The following observations can be made on noisy data:

  1. 1.

It can be observed in Table-XXIII that for different degrees of noise, the
accuracy obtained by Noise Tolerant PHEC is better than that obtained from
PHEC for each of the four datasets. On noisy data, mean difference of the
accuracy obtained by NT-PHEC and PHEC in centralized settings is 8.53%
(approx).

  2. 2.

As evident from Table-XXIV, performance metrics obtained by NT-PHEC is better
than that obtained by PHEC in federated settings. On noisy data, the mean
difference of accuracy (across four datasets, for various degrees of noise)
between NT-PHEC and PHEC in federated settings is 2.6735% (approx).

TABLE XXIV: Comparison of Experimental Results on Noisy Data using Noise Tolerant PHEC and PHEC in Federated Settings Dataset | $\rho$ | Accuracy of PHEC | Accuracy of NT-PHEC
---|---|---|---
NSL-KDD | 10 | 72.87 | 76.48
NSL-KDD | 20 | 68.28 | 74.22
DS2OS | 10 | 89.9 | 91.66
DS2OS | 20 | 88.46 | 90.48
Gas Pipeline | 10 | 91.36 | 94.26
Gas Pipeline | 20 | 89.98 | 93.988
Water Tank | 10 | 89.82 | 90.47
Water Tank | 20 | 89.72 | 90.22

On clean data, PHEC performs better than NT-PHEC, in federated and centralized
settings. The mean difference of accuracy between PHEC and NT-PHEC in
centralized and federated settings are 2.1% & and 4% respectively (approx.).

TABLE XXV: Comparison of Experimental Results on Clean Data using Noise Tolerant PHEC and PHEC in Federated and Centralized Settings Dataset | Settings | Accuracy of PHEC | Accuracy of NT-PHEC
---|---|---|---
NSL-KDD | Centralized | 92.05 | 83.77
DS2OS | Centralized | 99.98 | 99.97
Gas Pipeline | Centralized | 98.38 | 98.33
Water Tank | Centralized | 98.71 | 98.64
NSL-KDD | Federated | 88.42 | 83.65
DS2OS | Federated | 98.27 | 94.224
Gas Pipeline | Federated | 98.71 | 94.75
Water Tank | Federated | 93.74 | 90.48

  1. 1.

In centralized settings, PHEC uses Random Forest instead of weighted Logistic
Regression. Random Forest performs better on clean data due to ensembling of
results. For NT-PHEC, by imposing the constraint $K\geq 5$ on the KNN
classifier, the feasible region for $K$ becomes a subset of the feasible
region for $K$ of KNN in PHEC. So, the optimal $K$ of KNN in PHEC is atleast
as good as that of KNN in NT-PHEC. Due to these reasons, PHEC performs better
than NT-PHEC on clean data.

  2. 2.

For the NT-PHEC in federated settings, the MLP is having one input layer and
one output layer with single neuron. There exists no hidden layer in this
case. The MLP in PHEC has the luxury of using multiple hidden layers with any
number of neurons along-with any non-linear activation functions. Due to the
large extent of flexibility of MLP, it captures the pattern of the data better
than a simplified MLP (of NT-PHEC) and hence PHEC outperforms NT-PHEC on clean
data.

##  IX Conclusion

We propose a probabilistic hybrid ensemble classifier (PHEC) in IoT security
in centralized settings and then adapt it to federated settings. PHEC
maximizes TPR while keeping the FPR within permissible limit. Experimental
results demonstrate that it performs better than state-of-the-art Intrusion
Detection Systems. Even though the results obtained in centralized setup are
better than that of federated settings, performance metrics obtained in
federated settings is quite close to centralized settings. It is advisable to
use PHEC in the centralized settings if there exists no privacy issue and
entire data processing in a single system is feasible. Otherwise, it is
advisable to adapt the proposed model PHEC in federated settings. The
classifiers used in PHEC use the training data labels to learn the pattern
from the data. If labels of the training data get noisy, performance of PHEC
drops. To overcome this, we use weighted convex surrogate loss functions to
propose Noise-Tolerant PHEC in federated & centralized settings. Experimental
results on noisy data demonstrate that Noise-Tolerant PHEC works well in the
presence of SLN Noise.

An interesting direction of future work may be to come up with Intrusion
Detection Systems such that it can be trained even in the absence of anomaly
samples in the training data, the one class models may be useful there.

## References

  * [1] H. Haddad Pajouh, R. Javadian, R. Khayamiand, A. Dehghantanha, and R. Choo, “A two layer dimension reduction and two tier classification model for anomaly based intrusion detection in IoT backbone networks,” _IEEE Transactions on Emerging Topics in Computing_ , vol. 7, no. 2, 2016.
  * [2] H. H. Pajouh, G. Dastghaibyfard, and S. Hashemi, “Two-tier network anomaly detection model: a machine learning approach,” _J. Intell. Inf. Syst._ , pp. 1–14, 2015.
  * [3] S.A.Rahman, H. Tout, C. Talhi, and A.Mourad, “Internet of Things Intrusion Detection: Centralized, On-Device, or Federated Learning?” _IEEE Network_ , 2020.
  * [4] R. V. Craiu and L. Sun, “Choosing the lesser evil: trade-off between false discovery rate and non-discovery rate,” _Statistica Sinica._ , vol. 18, no. 3, pp. 861–879, 2008.
  * [5] A. W. Cappelen, C. Cappelen, and B. Tungodden, “Second-Best Fairness Under Limited Information: The Trade-Off between False Positives and False Negatives,” _Discussion Paper Series in Economics, Norwegian School of Economics_ , 2018.
  * [6] N. Natarajan, I. S. Dhillon, P. Ravikumar, and A. Tewari, “Learning with Noisy Labels,” _NIPS_ , 2013.
  * [7] L. Koc, T. A. Mazzuchi, and S. Sarkani, “A network intrusion detection system based on a Hidden Naïve Bayes multiclass classifier,” _Expert Syst. Appl._ , vol. 39, no. 18, p. 13492–13500, 2012.
  * [8] M. Tavallaee, E. Bagheri, W. Lu, and A. A. Ghorbani, “A detailed analysis of the KDD CUP 99 data set,” _Proceedings of the IEEE Symposium on Computational Intelligence for Security and Defence Applications_ , 2009.
  * [9] J. Zhang, M. Zulkernine, and A. Haque, “Random-Forests based network intrusion detection systems,” _IEEE Trans. Syst. Man Cybern. Part C Appl. Rev._ , vol. 38, no. 5, p. 649–659, 2008.
  * [10] P. Casas, J. Mazel, and P. Owezarski, “Unsupervised network intrusion detection systems: Detecting the unknown without knowledge,” _Comput. Commun._ , vol. 35, no. 7, pp. 772–783, 2012.
  * [11] S. J. Horng _et al._ , “A novel intrusion detection system based on hierarchical clustering and support vector machines,” _Expert Syst. Appl._ , vol. 38, no. 1, pp. 306–313, 2011.
  * [12] M. A. Ambusaidi, X. He, P. Nanda, and Z. Tan, “Building an Intrusion Detection System Using a FilterBased Feature Selection Algorithm,” _IEEE Trans. Comput._ , vol. 65, no. 10, pp. 2986–2998, 2016.
  * [13] W. Xuren, H. Famei, and X. Rongsheng, “Modeling Intrusion Detection System by Discovering Association Rule in Rough Set Theory Framework,” _International Conference on Computational Intelligence for Modelling, Control and Automation_ , p. 24, 2006.
  * [14] S. Revathi and D. A. Malathi, “A Detailed Analysis on NSL-KDD Dataset Using Various Machine Learning Techniques for Intrusion Detection,” _International Journal of Engineering Research & Technology_, vol. 2, no. 12, 2013.
  * [15] O. Osanaiye, K. R. Choo, and M. Dlodlo, “Distributed denial of service (DDoS) resilience in cloud: Review and conceptual cloud DDoS mitigation framework,” _J. Netw. Comput. Appl._ , vol. 67, no. 7, pp. 147–165, 2016\.
  * [16] Q. Yang, Y. Liu, T. Chen, and Y. Tong, “Federated Machine Learning: Concept and Applications,” _ACM Trans. Intell. Syst. Technol._ , 2019.
  * [17] P. Kairouz _et al._ , “Advances and Open Problems in Federated Learning,” _arXiv preprint_ , 2021.
  * [18] “NSL-KDD Dataset,” https://github.com/defcom17/NSL_KDD.
  * [19] T. Sharma. (2019) Anomaly detection in smart buildings using federated learning. [Online]. Available: https://www.tuhinsharma.com/talks/oreillyailondon2019/
  * [20] N. Natarajan, I. S. Dhillon, P. Ravikumar, and A. Tewari, “Cost-Sensitive Learning with Noisy Labels,” _Journal of Machine Learning Research_ , 2018\.
  * [21] A. Ghosh, N. Manwani, and P. Sastry, “Making risk minimization tolerant to label noise,” _Neurocomputing_ , 2015.
  * [22] N. Manwani and P. S. Sastry, “Noise Tolerance Under Risk Minimization,” _IEEE Transactions on Cybernetics_ , 2013.
  * [23] H. Reeve and A. Kaban, “Classification with unknown class-conditional label noise on non-compact feature spaces,” _Conference on Learning Theory (COLT)_ , 2019.
  * [24] S. Ougiaroglou and G. Evangelidis, “Dealing with noisy data in the context of k-NN Classification,” _BCI ’15: Proceedings of the 7th Balkan Conference on Informatics_ , 2015.
  * [25] Canadian Institute of Cybersecurity, “NSL-KDD Dataset,” https://www.unb.ca/cic/datasets/nsl.html, 2009.
  * [26] M.O.Pahl and F. Aubet. (2018) Ds2os traffic traces. [Online]. Available: https://www.kaggle.com/francoisxa/ds2ostraffictraces
  * [27] W. T. Morris, “Industrial Control System Network Traffic Data sets to Facilitate Intrusion Detection System Research,” _IFIP Advances in Information and Communication Technology_ , 2014.
  * [28] C. D’Orazio, K.-K. R. Choo, and L. T. Yang, “Data Exfiltration from Internet of Things Devices: iOS Devices as Case Studies,” _IEEE Internet of Things Journal_ , 2016.
  * [29] “A Novel Anomaly Detection System Based on HFR-MLR Method,” _Mobile, Ubiquitous, and Intelligent Computing_ , vol. 274, pp. 279–286, 2016.
  * [30] A. N. Toosi and M. Kahani, “A new approach to intrusion detection based on an evolutionary soft computing model using neuro-fuzzy classifiers,” _Comput. Commun._ , vol. 30, no. 10, pp. 2201–2212, 2007.
  * [31] M. M. M.Hasan, M.M.Islam, “Attack and anomaly detection in IoT sensors in IoT sites using machine learning approaches,” _IFIP Advances in Information and Communication Technology_ , 2019.