# Explicit formulas for Killing magnetic curves in Heisenberg group††thanks:
The paprer was supported by Laboratory of fundamental and applied mathematics,
University of Oran

Khadidja Derkaoui1 and Fouzi Hathout2
1Department of mathematics, university of Chlef, Algeria
Email<EMAIL_ADDRESS>
2Department of mathematics, university of Saïda, Algeria
Email<EMAIL_ADDRESS>Corresponding author

###### Abstract

In this paper, We present the geometry three dimensional Heisenberg group
$(\mathbb{H}_{3},g)$ and its geodesics curves. After, we study the Killing
magnetic curves and some geodesic Killing magnetic curves with its explicit
formulas for such curves.

Key words: Heisenberg group; geodesic Killing magnetic curves; Killing vector
fields; Killing magnetic curves.

MSC: 53A04, 53C25

##  1 Introduction

In physics, particularly in electromagnetism, the trajectory of charged
particles moving under the action of a magnetic fields makes an important
research topic. In geometry, this trajectory in any manifold is known as a
magnetic curve.

On a Riemannian manifold, the magnetic curve $\gamma$ is modeled as a solution
of two order differential equation
$\nabla_{\gamma^{\prime}}\gamma^{\prime}=\varphi\left(\gamma^{\prime}\right)$
known as Lorentz equation, where $\varphi$ is $(1,1)$-tensor field that
present the Lorentz force associated to the magnetic fields $F$. The magnetic
curve generalise the geodesic curves in following way: When the particles move
under the absence of the magnetic fields so freely only under the influence of
gravity (i.e. $\varphi\equiv 0$), the Lorentz equation is exactly the geodesic
equation $\nabla_{\gamma^{\prime}}\gamma^{\prime}=0.$

The magnetic curve was studied intensively in different kind of manifolds in
Riemannian, Lorentzian and generally in pseudo-Riemannian concept. (See [1],
[6], [7], [18])

Furthermore, if the magnetic fields $F$ corresponds to a killing vector, then
the trajectory of particles moving under the action of $F$ is called Killing
magnetic curve.

Interesting results on Killing magnetic curves are given in Euclidian 3-space
([9]), Minkowski 3-space ([8]), $\mathbb{S}^{2}\times\mathbb{R}$ ([17]),
$SL(2,\mathbb{R})$ ([10]), Sol Space ([12]), warped product manifold ([15]),
almost paracontact manifold ([5]), Almost Cosymplectic Sol Space ([11]) and in
Walker manifolds ([2]).

The framework of the paper is to study the Killing magnetic curves in
$3$-dimensional Heisenberg group.

The contents of this study is the following: we present in the second section
a general notions and definitions of killing magnetic curves.

The section $3$ is devoted to the geometry of Heisenberg group and its contact
structure.

Finally in the section $4$, we classifies fourth kind of Killing magnetic
curves, we give its explicit parametric formulas at each kind in different
subsections and we close it with figures presented in Euclidian space.

##  2 Preliminaries

On Riemannian manifold $(M,g),$ the magnetic curves is a trajectories of the
charged particles moving under the action of the magnetic fields $F$ which can
be represented by a closed $2$-form

$F(X,Y)=g(\varphi\left(X\right),Y)$ (1)

where $X,Y$ are vector fields on $(M,g)$ and $\varphi$ is skew-symmetric
$(1,1)$-tensor field. that present the Lorentz force associated to $F$. For a
regular curve $\gamma:I\subset\mathbb{R}\rightarrow(M,g)$, $\gamma$ is called
magnetic curve if

$\nabla_{\mathbf{t}}\mathbf{t=}\varphi\left(\mathbf{t}\right)$ (2)

known as the Lorentz equation, where $\nabla$ is the Levi-Civita connection
associated to $g\ $and $\mathbf{t}=\gamma^{\prime}$ is the speed vector of
$\gamma.$ The magnetic curve generalise the notion of geodesic curve under
arc-length parametrization.

From the property of magnetic curve $\gamma$

$\frac{d}{dt}g(\gamma^{\prime},\gamma^{\prime})=0$

$\gamma$ has a constant speed vector. In particular, if $\gamma$ is
parameterized by the arc length, then $\gamma$ is called normal magnetic
curve.

We call $K$ a Killing vector field on $M$ if it satisfy the Killing equation

$g(\nabla_{X}K,Y)+g(\nabla_{Y}K,X)=0$

for every vector fields $X,Y$ on $M$.

We define on M the cross product of two vector fields $X,Y$ on $M$ as

$g(X\times Y,Z)=dvg(X,Y,Z)$ (3)

for all vector fields $Z$ on $M$ and $dvg$ denotes the volume form on $M.$

Let $F_{K}=\emph{i}_{K}dvg$ be the Killing magnetic field corresponding to the
Killing vector field $K$ on $M$, where i is inner product. Then, the
$(1,1)$-tensor fields corresponding to the Lorentz force of $F_{K}$ is

$\gamma(X)=K\times X.$ (4)

Then, we can rewrite the Lorentz equation Eq.(2) as

$\nabla_{\mathbf{t}}\mathbf{t=}K\times\mathbf{t}$ (5)

and the it solution is called Killing magnetic curves corresponding to the
killing vector fields $K.$

In the sequel, to simplify, we call this curve a $K$-magnetic curve.

##  3 Geometry structure of $\mathbb{H}_{3}$

The Heisenberg group $\mathbb{H}_{3}$ is a quasi-abelian Lie group
diffeomorphic to $\mathbb{R}^{3}$ and it has the standard representation in
$GL(3,\mathbb{R})$ as

$\mathbb{H}_{3}=\left\\{\left(\begin{array}[]{ccc}0&x&z\\\ 0&0&y\\\
0&0&0\end{array}\right)\mid\left(x,y,z\right)\in\mathbb{R}^{3}\right\\}$

endowed with the multiplication

$(x_{1},y_{1},z_{1})(x_{2},y_{2},z_{2})=(x_{1}+x_{2},y_{1}+y_{2},z_{1}+z_{2}-x_{1}y_{2}).$

The invariant Riemannian metric with respect to the left-translations
corresponding to that multiplication is denoted by

$g=\frac{1}{\lambda^{2}}dx^{2}+dy^{2}+(xdy+dz)^{2}.$ (6)

where $\lambda$ is a strictly positive real number. All left-invariant
Riemannian metric on the $\mathbb{H}_{3}$ is isometric to the metric $g$.

The Levi-Civita connection $\nabla$ of the metric $g$ with respect to the
left-invariant orthonormal basis

$e_{1}=\partial y-x\partial z,\ \ e_{2}=\lambda\partial x,\ \ e_{3}=\partial
z,$ (7)

with dual basis

$\omega^{1}=dy;\ \ \omega^{2}=\frac{1}{\lambda}dx;\ \ \omega^{3}=xdy+dz.$

are given by

$\left\\{\begin{array}[]{l}\nabla_{e_{1}}e_{1}=0\\\
\nabla_{e_{1}}e_{2}=\frac{\lambda}{2}e_{3}\\\
\nabla_{e_{1}}e_{3}=-\frac{\lambda}{2}e_{2}\end{array}\begin{array}[]{l}\nabla_{e_{2}}e_{1}=-\frac{\lambda}{2}e_{3}\\\
\nabla_{e_{2}}e_{2}=0\\\
\nabla_{e_{2}}e_{3}=\frac{\lambda}{2}e_{1}\end{array}\begin{array}[]{l}\nabla_{e_{3}}e_{1}=-\frac{\lambda}{2}e_{2}\\\
\nabla_{e_{3}}e_{2}=\frac{\lambda}{2}e_{1}\\\
\nabla_{e_{3}}e_{3}=0\end{array}\right.$ (8)

The Lie bracket of the base $\left(e_{i}\right)_{i=\overline{1,3}}$ are given
by the following identities

$[e_{1},e_{2}]=\lambda e_{3};\ \ \ [e_{1},e_{3}]=[e_{2},e_{3}]=0$ (9)

The Lie algebra of Killing vector field of $(\mathbb{H}_{3},g)$ is generated
by the following killing vectors

$\displaystyle\mathbf{K}_{1}$ $\displaystyle=$ $\displaystyle\partial z,\ \
\mathbf{K}_{2}=\partial y,\ \ \mathbf{K}_{3}=\partial x-y\partial z\ and$
$\displaystyle\mathbf{K}_{4}$ $\displaystyle=$
$\displaystyle\lambda^{2}y\partial x-x\partial
y-\frac{1}{2}(\lambda^{2}y^{2}-x^{2})\partial z,$

and using the Eq.(7), we can rewrite the killing vectors in the base
$\left(e_{i}\right)_{i=\overline{1,3}}$ as

$\displaystyle\mathbf{K}_{1}$ $\displaystyle=$ $\displaystyle e_{3},\ \
\mathbf{K}_{2}=e_{1}+xe_{3},\ \ \ \
\mathbf{K}_{3}=\frac{1}{\lambda}e_{2}-ye_{3}\ and$ (10) $\displaystyle\
\mathbf{K}_{4}$ $\displaystyle=$ $\displaystyle-xe_{1}+\lambda
ye_{2}-\frac{1}{2}(\lambda^{2}y^{2}-3x^{2})e_{3}.$

for more detail see ([3]).

On the other hand, for the contact form

$\eta=xdy+dz=\omega^{3}$ (11)

and the $(1,1)$-tensor $\varphi$ given in base
$\left(e_{i}\right)_{i=\overline{1,3}}$ by

$\varphi\left(e_{1}\right)=e_{2};\ \varphi\left(e_{2}\right)=-e_{1}\ and\
\varphi\left(e_{3}\right)=0$ (12)

we have

$\displaystyle\eta\left(e_{3}\right)$ $\displaystyle=$ $\displaystyle 1;\
\varphi^{2}\left(X\right)=-X+\eta\left(X\right)e_{3}\ and$ $\displaystyle
g(\varphi\left(X\right),\varphi\left(Y\right))$ $\displaystyle=$
$\displaystyle g(X,Y)+\eta(X)\eta(Y)$

for any $X,Y\in\chi(\mathbb{H}_{3})$ and $\xi=e_{3}$, the Heisenberg group
$(\mathbb{H}_{3},\varphi,\xi,\eta,g)$ is an almost contact manifold. Moreover,
we have

$d\eta(X,Y)=g(X,\varphi\left(Y\right))$ (13)

then $(\mathbb{H}_{3},\varphi,\xi,\eta,g)$ is a contact manifold and the
fundamental $2$-form $d\eta$ is closed and hence it defines a magnetic field.
For more detail see ([13], [14], [4], [16]).

##  4 Killing magnetic curves in $\mathbb{H}_{3}$

In this section, we have used two computer softwares (Wolfram Mathematica and
Scientific Workplace) to solve some differential systems and for curve
figures.

Let
$\gamma(t)=(x(t),y(t),z(t)):I\subset\mathbb{R\rightarrow}\left(\mathbb{H}_{3},g\right)$
be a regular curve. Its speed curve is

$\gamma^{\prime}(t)=\mathbf{t}=(x^{\prime}(t),y^{\prime}(t),z^{\prime}(t))$
(14)

from the Eq.(7), the speed vector $\mathbf{t}$ is expressed in the base
$\left(e_{i}\right)_{i=\overline{1,3}}$ as

$\mathbf{t}=y^{\prime}e_{1}+\frac{x^{\prime}}{\lambda}e_{2}+\left(z^{\prime}+xy^{\prime}\right)e_{3}$
(15)

Using the connection formulas given in the Eq.(8), the covariant derivative of
the speed vector $\mathbf{t}$ is

$\nabla_{\mathbf{t}}\mathbf{t=}\left(y^{\prime\prime}+x^{\prime}\left(z^{\prime}+xy^{\prime}\right)\right)e_{1}+\left(\frac{x^{\prime\prime}}{\lambda}+\lambda
y^{\prime}\left(z^{\prime}+xy^{\prime}\right)\right)e_{2}+\left(z^{\prime}+xy^{\prime}\right)^{\prime}e_{3}$
(16)

We know that the equation of geodesics is a particular case of the Lorentz
equation given in Eq.(2) when the Lorentz force vanishes, the geodesics is a
particular magnetic trajectories. A simple computation of the geodesic
equation $\nabla_{\mathbf{t}}\mathbf{t}=0,$ give a differential equations
system

$S_{G}:\left\\{\begin{array}[]{l}y^{\prime\prime}+x^{\prime}\left(z^{\prime}+xy^{\prime}\right)=0\\\
x^{\prime\prime}+\lambda^{2}y^{\prime}\left(z^{\prime}+xy^{\prime}\right)=0\\\
\left(z^{\prime}+xy^{\prime}\right)^{\prime}=0\end{array}\right.$

where its general solutions are explicit formulas of geodesic curves
$\gamma_{G}$ in $(\mathbb{H}_{3},g)$ given by the following proposition.

###### Proposition 1

The parametric equations of the geodesic curves $\gamma_{G}$ in
$(\mathbb{H}_{3},g)$ is given by

$\begin{array}[]{l}i.\
\gamma_{G}(t)=\left\\{\begin{array}[]{l}x\left(t\right)=c_{1}t+c_{2}\\\
y\left(t\right)=c_{3}t+c_{4}\\\
z(t)=\frac{c_{1}c_{3}}{2}t^{2}+c_{2}c_{3}t+c_{5}\end{array}\right.\text{
or}\\\ ii.\
\gamma_{G}(t)=\left\\{\begin{array}[]{l}x\left(t\right)=-\frac{c_{1}}{c}e^{c\lambda
t}-\frac{c_{2}}{c}e^{-c\lambda t}+c_{3}\\\
y\left(t\right)=\frac{c_{1}}{c\lambda}e^{c\lambda
t}-\frac{c_{2}}{c\lambda}e^{-c\lambda t}+c_{4}\\\
z(t)=\frac{2c_{1}c_{2}+c^{2}}{c}t-\frac{c_{3}}{\lambda
c}\left(c_{1}e^{ct\lambda}-c_{2}e^{-ct\lambda}\right)+\left(\frac{c_{1}^{2}-c_{2}^{2}}{2c^{2}\lambda}\right)e^{-2c\lambda
t}\end{array}\right.\end{array}$ (17)

where $c_{\overline{1,4}}$ are a real constants.

###  4.1 $\mathbf{K}_{1}$\- magnetic curves

We consider $\mathbf{K}_{1}$-magnetic curves which correspond to the Killing
vector field $\mathbf{K}_{1}=e_{3}=\partial z.$

Firstly, we have the product vector

$\mathbf{K}_{1}\times\mathbf{t}=-\frac{x^{\prime}}{\lambda}e_{1}+y^{\prime}e_{2}$
(18)

We can also obtain the Eq.(18) in the following way.
Because $\mathbf{K}_{1}=\xi$ given from the almost contact structure
$(\mathbb{H}_{3},\varphi,\xi,\eta,g)$, the magnetic fields
$F_{\mathbf{K}_{1}}$ corresponding to $\mathbf{K}_{1}$ is exactly the magnetic
fields $F$ associated to Lorentz force which presented by the skew-symmetric
$(1,1)$-tensor $\varphi$ given by the Eq.(12).

Thus, we find the right-hand side of the relation given in Eq.(18)

$\displaystyle\varphi\left(\mathbf{t}\right)$ $\displaystyle=$
$\displaystyle\varphi\left(y^{\prime}e_{1}+\frac{x^{\prime}}{\lambda}e_{2}+\left(z^{\prime}+xy^{\prime}\right)e_{3}\right)$
$\displaystyle=$ $\displaystyle
y^{\prime}e_{2}-\frac{x^{\prime}}{\lambda}e_{1}=\mathbf{K}_{1}\times\mathbf{t}$

Now, to find the explicit formulas of $\mathbf{K}_{1}$-magnetic curves, we
must solve the differential equations system denoted by $(S_{1})$, given from
the Eqs.(16, 18) and Lorentz equation

$\nabla_{\mathbf{t}}\mathbf{t}=\mathbf{K}_{1}\times\mathbf{t}$

The system $(S_{1})$ is

$S_{1}:\left\\{\begin{array}[]{l}y^{\prime\prime}+x^{\prime}\left(\left(z^{\prime}+xy^{\prime}\right)+\frac{1}{\lambda}\right)=0\\\
x^{\prime\prime}+y^{\prime}\left(\lambda^{2}\left(z^{\prime}+xy^{\prime}\right)-\lambda\right)=0\\\
\left(z^{\prime}+xy^{\prime}\right)^{\prime}=0\end{array}\right.$

After integrating the third equation $\left(S_{1_{3}}\right)$ and replaced
them in the equations $\left(S_{1_{1,2}}\right)$, the system $(S)$ turns to

$S_{1}:\left\\{\begin{array}[]{l}y^{\prime\prime}+x^{\prime}\left(c+\frac{1}{\lambda}\right)=0\\\
x^{\prime\prime}+y^{\prime}\lambda\left(\lambda c-1\right)=0\\\
z^{\prime}+xy^{\prime}=c\ \ (constant)\end{array}\right.$

the general solution of the equations $(S_{1_{1,2}})$ is

$\left\\{\begin{array}[]{c}x\left(t\right)=\frac{\lambda}{\lambda
c+1}\left(c_{1}e^{\sqrt{\lambda^{2}c^{2}-1}t}+c_{2}e^{-\sqrt{\lambda^{2}c^{2}-1}t}\right)+c_{3}\\\
y\left(t\right)=\frac{1}{\sqrt{\lambda^{2}c^{2}-1}}\left(c_{1}e^{\sqrt{\lambda^{2}c^{2}-1}t}-c_{2}e^{-\sqrt{\lambda^{2}c^{2}-1}t}\right)+c_{4}\end{array}\right.$
(19)

where $c_{\overline{1,4}}$ are a real constants, $\left|\lambda c\right|>1$
(if $\left|\lambda c\right|<1$ the system don’t admit a real solutions) and
$\lambda c\neq\pm 1$ (we studied these cases $\lambda c=\pm 1$ later).

Substituting the Eq.(19) in the equation $(S_{1_{3}})$ and by an integration
with respect to $t$, we have

$z(t)=\left(c+\frac{2\lambda}{\lambda
c+1}c_{1}c_{2}\right)t+\frac{1}{\sqrt{\lambda^{2}c^{2}-1}}\left(\begin{array}[]{c}c_{1}c_{3}e^{-t\sqrt{\lambda^{2}c^{2}-1}}-c_{2}c_{3}e^{t\sqrt{\lambda^{2}c^{2}-1}}+\\\
\frac{\lambda}{2\left(\lambda
c+1\right)}\left(c_{1}^{2}e^{-2t\sqrt{\lambda^{2}c^{2}-1}}-c_{2}^{2}e^{2t\sqrt{\lambda^{2}c^{2}-1}}\right)\end{array}\right)+c_{5}$

where $c_{5}$ is real constant.

If $c=\dfrac{1}{\lambda},$ we rewrite the system $(S_{1})$ as

$S_{1}:\left\\{\begin{array}[]{l}y^{\prime\prime}+x^{\prime}\frac{2}{\lambda}=0\\\
x^{\prime\prime}=0\\\
z^{\prime}+xy^{\prime}=\dfrac{1}{\lambda}\end{array}\right.$

Its general solution is

$\left\\{\begin{array}[]{l}x\left(t\right)=c_{1}t+c_{2},\\\
y\left(t\right)=\frac{-c_{1}}{\lambda}t^{2}+c_{3}t+c_{4}\\\
z\left(t\right)=\frac{2c_{1}^{2}}{3\lambda}t^{3}+c_{1}\left(\frac{c_{2}}{\lambda}-\frac{c_{3}}{2}\right)t^{2}+\left(\frac{1}{\lambda}-c_{2}c_{3}\right)t+c_{5}\end{array}\right.$

where $c_{\overline{1,5}}$ are a real constants.

If $c=\dfrac{-1}{\lambda},$ the system $(S_{1})$ is

$S_{1}:\left\\{\begin{array}[]{l}y^{\prime\prime}=0\\\
x^{\prime\prime}-2y^{\prime}\lambda=0\\\
z^{\prime}+xy^{\prime}=\dfrac{-1}{\lambda}\end{array}\right.$

with a general solution

$\left\\{\begin{array}[]{l}x\left(t\right)=c_{1}\lambda t^{2}+c_{2}t+c_{3},\\\
y\left(t\right)=c_{1}t+c_{4}\\\
z\left(t\right)=\frac{c_{1}c_{2}}{2}t^{2}+\left(\dfrac{-1}{\lambda}+c_{3}c_{1}-\frac{c_{1}^{2}}{3}\lambda\right)t+c_{5}\end{array}\right.$

Now, we can present the following theorem.

###### Theorem 2

The explicit formulae of all $\mathbf{K}_{1}$-magnetic curves in
$(\mathbb{H}_{3},g)$ are the space curves given by parametric equations:
1\.
$\gamma(t)=\left(\begin{array}[]{l}x\left(t\right)=c_{1}t+c_{2},\\\
y\left(t\right)=\frac{-c_{1}}{\lambda}t^{2}+c_{3}t+c_{4}\\\
z\left(t\right)=\frac{2c_{1}^{2}}{3\lambda}t^{3}+c_{1}\left(\frac{c_{2}}{\lambda}-\frac{c_{3}}{2}\right)t^{2}+\left(\frac{1}{\lambda}-c_{2}c_{3}\right)t+c_{5}\end{array}\right)$
or
2\.
$\gamma(t)=\left(\begin{array}[]{l}x\left(t\right)=c_{1}\lambda
t^{2}+c_{2}t+c_{3},\\\ y\left(t\right)=c_{1}t+c_{4}\\\
z\left(t\right)=\frac{c_{1}c_{2}}{2}t^{2}+\left(\tfrac{-1}{\lambda}+c_{3}c_{1}-\frac{c_{1}^{2}}{3}\lambda\right)t+c_{5}\end{array}\right)$
or
3\.
$\gamma(t)=\left(\begin{array}[]{l}x\left(t\right)=\frac{\lambda}{\lambda
c+1}\left(c_{1}e^{\sqrt{\lambda^{2}c^{2}-1}t}+c_{2}e^{-\sqrt{\lambda^{2}c^{2}-1}t}\right)+c_{3}\\\
y\left(t\right)=\frac{1}{\sqrt{\lambda^{2}c^{2}-1}}\left(c_{1}e^{\sqrt{\lambda^{2}c^{2}-1}t}-c_{2}e^{-\sqrt{\lambda^{2}c^{2}-1}t}\right)+c_{4}\\\
z\left(t\right)=\left(c+\frac{2\lambda c_{1}c_{2}}{\lambda
c+1}\right)t+\frac{1}{\sqrt{\lambda^{2}c^{2}-1}}\left(\begin{array}[]{c}c_{3}\left(c_{1}e^{-t\sqrt{\lambda^{2}c^{2}-1}}-c_{2}e^{t\sqrt{\lambda^{2}c^{2}-1}}\right)+\\\
\frac{\lambda}{2\left(\lambda
c+1\right)}\left(c_{1}^{2}e^{-2t\sqrt{\lambda^{2}c^{2}-1}}-c_{2}^{2}e^{2t\sqrt{\lambda^{2}c^{2}-1}}\right)\end{array}\right)+c_{5}\end{array}\right)$
where in (3), $\left|\lambda c\right|>1$ and $c,c_{\overline{1,5}}$ are a real
constants.

###### Corollary 3

The curve presented in assertion (1) of the Theorem (2) for $c_{1}=0$ and
$\lambda=\frac{1}{2c_{2}c_{3}}$ is a geodesic $\mathbf{K}_{1}$-magnetic curve
in $(\mathbb{H}_{3},g).$

Proof. It’s a direct consequence from the geodesic curve formulas in Eq.(17)
an the Theorem (2).

We present in $(\mathbb{R}_{3},g_{euc})$ some examples of
$\mathbf{K}_{1}$-magnetic curve in $(\mathbb{H}_{3},g)$ in following figures
drawing in $(\mathbb{R}_{3},g_{euc})$.
For $c_{1,2.3}=1;\ \ c_{4,5}=0$ and$\ \lambda=1$, the figure 1 at left side,
present the $\mathbf{K}_{1}$-magnetic curve for the first assertion in
$(\mathbb{H}_{3},g)$.

Figure 1: $\mathbf{K}_{1}$-magnetic curve

For $c_{1,2}=\lambda=1\ $and$\ c_{3,4,5}=0,$ the figure 1 at right side,
present the $\mathbf{K}_{1}$-magnetic curve for the assertion (2) in
$(\mathbb{H}_{3},g)$.

Figure 2: $\mathbf{K}_{1}$-magnetic curve

For $c_{1,2,3}=1;\ \ c_{4,5}=0$ and$\ \lambda=1;\ c=\sqrt{2}$ (i.e.
$\left|\lambda c\right|>1$), the figure 2 present the
$\mathbf{K}_{1}$-magnetic curve for the assertion (3) in $(\mathbb{H}_{3},g)$.

###  4.2 $\mathbf{K}_{2}$-magnetic curves

Similarly, as in subsection (4.1), we have

$\mathbf{K}_{2}\times\mathbf{t}=-\frac{x^{\prime}x}{\lambda}e_{1}+\left(xy^{\prime}-\left(z^{\prime}+xy^{\prime}\right)\right)e_{2}+\frac{x^{\prime}}{\lambda}e_{3}$
(20)

We can find a same formula as the Eq.(20) using the Eqs.(3, 4 and 11) to
determine the magnetic fields $F_{\mathbf{K}_{2}}$and associated skew-
symmetric $(1,1)$-tensor $\varphi.$

The $\mathbf{K}_{2}$-magnetic curves are the solution of the differential
equations system

$S_{2}:\left\\{\begin{array}[]{l}x^{\prime}\left(z^{\prime}+xy^{\prime}\right)=-y^{\prime\prime}-\frac{xx^{\prime}}{\lambda}\\\
\left(\lambda
y^{\prime}+1\right)\left(z^{\prime}+xy^{\prime}\right)=xy^{\prime}-\frac{x^{\prime\prime}}{\lambda}\\\
\left(z^{\prime}+xy^{\prime}\right)^{\prime}=\frac{x^{\prime}}{\lambda}\end{array}\right.$

given from the Eqs.(16, 20) and Lorentz equation

$\nabla_{\mathbf{t}}\mathbf{t}=\mathbf{K}_{2}\times\mathbf{t}$

after integrating the equation $\left(S_{2_{3}}\right),$ we have

$z^{\prime}+xy^{\prime}=\frac{x}{\lambda}+c\text{ }$ (21)

here $c$ is a arbitrary real constant. Substituting the last equation in the
equations $\left(S_{2_{2,3}}\right),$ we get the system

$\overline{S}_{2}:\left\\{\begin{array}[]{l}x^{\prime}\left(\frac{2x}{\lambda}+c\right)=-y^{\prime\prime}\\\
\left(\lambda
y^{\prime}+1\right)\left(\frac{x}{\lambda}+c\right)=xy^{\prime}-\frac{x^{\prime\prime}}{\lambda}\end{array}\right.$

and

$\overline{S}_{2}:\left\\{\begin{array}[]{l}y^{\prime}=-\frac{x^{2}}{\lambda}-xc\\\
x^{\prime\prime}-cx^{2}\lambda+x\left(1-c^{2}\lambda^{2}\right)+c\lambda=0.\end{array}\right.$

it is very difficult to find exact solutions of the system
($\overline{S}_{2}$) for every constant $c$. However, without loss of
generality, we can assume that $c=0,$ the solution can be given as

$\left\\{\begin{array}[]{l}x(t)=c_{1}\cos t-c_{2}\sin t\\\
y(t)=\frac{1}{2\lambda}c_{1}c_{2}\cos
2t+\frac{1}{4\lambda}\left(c_{1}^{2}-c_{2}^{2}\right)\sin
2t+\frac{1}{2\lambda}\left(c_{1}^{2}+c_{2}^{2}\right)t\end{array}\right.$

Substituting the solutions $x(t)$ and $y(t)$ in Eq.(21) and by an integration,
we have the following solution

$z(t)=\frac{1}{\lambda}\left(\begin{array}[]{c}\frac{1}{4}c_{2}\left(c_{1}^{2}-\frac{1}{3}c_{2}^{2}\right)\cos
3t+\frac{1}{4}c_{1}\left(\frac{1}{3}c_{1}^{2}-c_{2}^{2}\right)\sin 3t\\\
+\left(1+\frac{3}{4}\left(c_{2}^{2}+c_{1}^{2}\right)\right)\left(c_{2}\cos
t+c_{1}\sin t\right)\end{array}\right)$

Then we have the following theorem:

###### Theorem 4

The space curves given by parametric equations

$\gamma(t)=\left\\{\begin{array}[]{l}x(t)=c_{1}\cos t-c_{2}\sin t\\\
y(t)=\frac{1}{2\lambda}c_{1}c_{2}\cos
2t+\frac{1}{4\lambda}\left(c_{1}^{2}-c_{2}^{2}\right)\sin
2t+\frac{1}{2\lambda}\left(c_{1}^{2}+c_{2}^{2}\right)t\\\
z(t)=\frac{1}{\lambda}\left(\begin{array}[]{c}\frac{1}{4}c_{2}\left(c_{1}^{2}-\frac{1}{3}c_{2}^{2}\right)\cos
3t+\frac{1}{4}c_{1}\left(\frac{1}{3}c_{1}^{2}-c_{2}^{2}\right)\sin 3t\\\
+\left(1+\frac{3}{4}\left(c_{2}^{2}+c_{1}^{2}\right)\right)\left(c_{2}\cos
t+c_{1}\sin t\right)\end{array}\right)\end{array}\right.$

are $\mathbf{K}_{2}$-Killing magnetic curves in $(\mathbb{H}_{3},g),$ where
$c_{1},\ c_{2}$ are a real constants.

###### Corollary 5

There is no $\mathbf{K}_{2}$-magnetic curves od the space curves of the
Theorem (4) which is a geodesic in $(\mathbb{H}_{3},g).$

In $(\mathbb{R}_{3},g_{euc}),$ we present an example of
$\mathbf{K}_{2}$-magnetic curve in $(\mathbb{H}_{3},g)$ in figure $3$ with
$c_{1}=2c_{2}=2$ and $\lambda=1.$

Figure 3: $\mathbf{K}_{2}$-magnetic curve in $(\mathbb{H}_{3},g)$ presented in
$(\mathbb{R}_{3},g_{euc})$

###  4.3 $\mathbf{K}_{3}$-magnetic curves

As above in subsections 4.1 and 4.2, we have the product vector

$\mathbf{K}_{3}\times\mathbf{t=}\frac{1}{\lambda}\left(yx^{\prime}+z^{\prime}+xy^{\prime}\right)e_{1}-yy^{\prime}e_{2}-\frac{1}{\lambda}y^{\prime}e_{3}$

Also, we can find a same formula as the Eq.(20) using the Eqs.(3, 4 and 11) to
determine the magnetic fields $F_{\mathbf{K}_{2}}$and the associated skew-
symmetric $(1,1)$-tensor $\varphi.$

Using the Eqs(16, 20) and

$\nabla_{\mathbf{t}}\mathbf{t}=\mathbf{K}_{3}\times\mathbf{t}$

we have the differential equations system $\left(S_{3}\right)$

$S_{3}:\left\\{\begin{array}[]{c}y^{\prime\prime}+x^{\prime}\left(z^{\prime}+xy^{\prime}\right)=\frac{1}{\lambda}\left(z^{\prime}+xy^{\prime}\right)+y\frac{x^{\prime}}{\lambda}\\\
\frac{x^{\prime\prime}}{\lambda}+\lambda
y^{\prime}\left(z^{\prime}+xy^{\prime}\right)=-yy^{\prime}\\\
\left(z^{\prime}+xy^{\prime}\right)^{\prime}=-\frac{1}{\lambda}y^{\prime}\end{array}\right.$

The integration of the third equation $\left(S_{3_{3}}\right)$, give

$z^{\prime}+xy^{\prime}=-\frac{1}{\lambda}y+c$ (22)

substituting the last equation in equations $\left(S_{3_{1,2}}\right),$ we
have the differential equations system

$\overline{S}_{3}:\left\\{\begin{array}[]{c}y^{\prime\prime}+2\lambda
cy^{2}+y\left(\frac{1}{\lambda^{2}}-\lambda^{2}c^{2}\right)-\frac{c}{\lambda}=0\\\
x^{\prime}=-\lambda^{2}cy\end{array}\right.$

Analogously as the subsection 4.2, it is a true challenge to find exact
solutions for the system ($\overline{S}_{3}$). Therefore, we try to solve’it
in particular case $c=0$.

By integrating the system $\left(\overline{S}_{3}\right)$ in the case $c=0,$
we find the general solution

$\left\\{\begin{array}[]{l}x(t)=c_{1}t+c_{2}\\\
y(t)=c_{3}\exp\left(\frac{\sqrt{2\lambda
c_{1}-1}}{\lambda}t\right)+c_{4}\exp\left(\frac{-\sqrt{2\lambda
c_{1}-1}}{\lambda}t\right)\end{array}\right.$

Substituting the solutions $x(t)$ and $y(t)$ in the Eq.(22), we get

$z(t)=\begin{array}[]{c}\left(\frac{-c_{3}}{\sqrt{2\lambda
c_{1}-1}}-c_{3}\left(c_{2}-\lambda c_{1}\sqrt{2\lambda
c_{1}-1}+c_{1}t\right)\right)\exp\left(\frac{\sqrt{2\lambda
c_{1}-1}}{\lambda}t\right)\\\ +\left(\frac{c_{4}}{\sqrt{2\lambda
c_{1}-1}}-c_{4}\left(c_{2}+\lambda c_{1}\sqrt{2\lambda
c_{1}-1}+c_{1}t\right)\right)\exp\left(-\frac{\sqrt{2\lambda
c_{1}-1}}{\lambda}t\right)\end{array}$

where $c_{\overline{1,4}}$ are an arbitrary real constants.

Finally, we can present the following theorem.

###### Theorem 6

The space curves given by parametric equations

$\gamma(t)=\left(\begin{array}[]{l}x(t)=c_{1}t+c_{2}\\\
y(t)=c_{3}\exp\left(\frac{\sqrt{2\lambda
c_{1}-1}}{\lambda}t\right)+c_{4}\exp\left(\frac{-\sqrt{2\lambda
c_{1}-1}}{\lambda}t\right)\\\
z(t)=\begin{array}[]{c}\left(\frac{-c_{3}}{\sqrt{2\lambda
c_{1}-1}}-c_{3}\left(c_{2}-\lambda c_{1}\sqrt{2\lambda
c_{1}-1}+c_{1}t\right)\right)\exp\left(\frac{\sqrt{2\lambda
c_{1}-1}}{\lambda}t\right)\\\ +\left(\frac{c_{4}}{\sqrt{2\lambda
c_{1}-1}}-c_{4}\left(c_{2}+\lambda c_{1}\sqrt{2\lambda
c_{1}-1}+c_{1}t\right)\right)\exp\left(-\frac{\sqrt{2\lambda
c_{1}-1}}{\lambda}t\right)\end{array}\end{array}\right)$

are $\mathbf{K}_{3}$-magnetic curves in $(\mathbb{H}_{3},g),$ where
$c_{\overline{1,4}}$ are a real constants.

###### Corollary 7

There is no $\mathbf{K}_{3}$-magnetic curves of the space curves of the
Theorem (6) which is a geodesic in $(\mathbb{H}_{3},g).$

The following figure present in $(\mathbb{R}_{3},g_{euc})$ an example of
$\mathbf{K}_{3}$-magnetic curve in $(\mathbb{H}_{3},g)$ with
$c_{\overline{1,4}}=1$ and $\lambda=1.$

Figure 4: $\mathbf{K}_{3}$-magnetic curve in $(\mathbb{H}_{3},g)$ presented in
$(\mathbb{R}_{3},g_{euc})$

###  4.4 $\mathbf{K}_{4}$-magnetic curves

Finally, as subsections 4.1, 4.2 and 4.3, we consider
$\mathbf{K}_{4}$-magnetic curves which correspond to the Killing vector field
$\mathbf{K}_{4}.$

Firstly, we have the product vector

$\displaystyle\mathbf{K}_{4}\times\mathbf{t}$ $\displaystyle=$
$\displaystyle-\frac{1}{2\lambda}\left(3x^{2}x^{\prime}-y^{2}x^{\prime}\lambda^{2}-2y\lambda^{2}\left(z^{\prime}+xy^{\prime}\right)\right)e_{1}$
$\displaystyle-\frac{1}{2}\left(-3x^{2}y^{\prime}+y^{2}y^{\prime}\lambda^{2}-2x\left(z^{\prime}+xy^{\prime}\right)\right)e_{2}-\frac{1}{\lambda}\left(xx^{\prime}+yy^{\prime}\lambda^{2}\right)e_{3}$

The same formula can be found as the Eq.(4.4), using the Eqs.(3, 4 and 11) to
determine the magnetic fields $F_{\mathbf{K}_{4}}$and the associated skew-
symmetric $(1,1)$-tensor $\varphi.$

Using the Eqs(16, 4.4) and Lorentz equation formula

$\nabla_{\mathbf{t}}\mathbf{t}=\mathbf{K}_{4}\times\mathbf{t}$

we have the differential equations system $\left(S_{4}\right)$

$S_{4}:\left\\{\begin{array}[]{l}y^{\prime\prime}+x^{\prime}\left(z^{\prime}+xy^{\prime}\right)=\frac{3}{2\lambda}x^{2}x^{\prime}-\frac{\lambda}{2}y^{2}x^{\prime}-\lambda
y\left(z^{\prime}+xy^{\prime}\right)\\\
x^{\prime\prime}+\lambda^{2}y^{\prime}\left(z^{\prime}+xy^{\prime}\right)=\frac{3\lambda}{2}x^{2}y^{\prime}-\frac{\lambda^{3}}{2}y^{2}y^{\prime}+\lambda
x\left(z^{\prime}+xy^{\prime}\right)\\\
\left(z^{\prime}+xy^{\prime}\right)^{\prime}=-\lambda
yy^{\prime}-x\frac{x^{\prime}}{\lambda}\end{array}\right.$

the integration of the third equation $\left(S_{4_{3}}\right),$ give

$z^{\prime}+xy^{\prime}=-\frac{x^{2}}{2\lambda}-\frac{\lambda}{2}y^{2}+c$ (24)

Substituting the last equation in the equations $\left(S_{4_{1,2}}\right)$, we
get

$\overline{S}_{4}:\left\\{\begin{array}[]{l}y^{\prime\prime}-\frac{2}{\lambda}x^{2}x^{\prime}=\frac{1}{2}y\left(y^{2}\lambda^{2}+x^{2}\right)-c\left(y\lambda+x^{\prime}\right)\\\
x^{\prime\prime}-2y^{\prime}x^{2}\lambda=-\frac{1}{2}x\left(y^{2}\lambda^{2}+x^{2}\right)+c\left(x\lambda-
cy^{\prime}\lambda^{2}\right)\end{array}\right.$

It is not essay to solve the last differential equations system
$\left(\overline{S}\right)$ or is not exactly solvable in general case,
however we can solve’it in particular case when $c=0$ and let $x(t)=y(t)$ and
taking account that $y^{2}\lambda^{2}+x^{2}\neq 0,$ then
$\left(\overline{S}_{4}\right)$ terns to

$y^{\prime\prime}-\frac{1+\lambda^{2}}{\lambda}y^{2}y^{\prime}=0$

by integrating the last equation with respect to $y$, we have

$y^{\prime}-\frac{1+\lambda^{2}}{3\lambda}y^{3}=c_{1}$

where $c_{1}$ is a real constant. Without loss of generality, we can assume
that $c_{1}=0,$ then the non null solution is

$y(t)=\pm\frac{1}{\sqrt{2}\sqrt{c_{2}-\left(\frac{1+\lambda^{2}}{3\lambda}\right)t}}$

where $c_{2}$ is a constant. From the Eq.(24), we have

$z(t)=\frac{3}{4}\ln\left|\left(\frac{1+\lambda^{2}}{3\lambda}\right)t-c_{2}\right|\pm\frac{1}{4\left(c_{2}-\left(\frac{1+\lambda^{2}}{3\lambda}\right)t\right)}+c_{3}$

where $c_{2},c_{3}$ are a real constants. then we have the theorem.

###### Theorem 8

The space curves given by parametric equations

$\gamma(t)=\left(\begin{array}[]{l}x(t)=\frac{1}{\sqrt{2}\sqrt{c_{1}-\left(\frac{1+\lambda^{2}}{3\lambda}\right)t}}\\\
y(t)=\pm\frac{1}{\sqrt{2}\sqrt{c_{1}-\left(\frac{1+\lambda^{2}}{3\lambda}\right)t}}\\\
z(t)=\frac{3}{4}\ln\left|\left(\frac{1+\lambda^{2}}{3\lambda}\right)t-c_{1}\right|\pm\frac{1}{4\left(c_{1}-\left(\frac{1+\lambda^{2}}{3\lambda}\right)t\right)}+c_{2}\end{array}\right)$

are $\mathbf{K}_{4}$-magnetic curves in $(\mathbb{H}_{3},g)$, where
$c_{1},c_{2}$ are an arbitrary real constants.

###### Corollary 9

There is no $\mathbf{K}_{4}$-magnetic curves of the space curves of the
Theorem (8) which is a geodesic in $(\mathbb{H}_{3},g).$

Finally, we present in the following figure in $(\mathbb{R}_{3},g_{euc}),$ an
example of $\mathbf{K}_{4}$-magnetic curve in $(\mathbb{H}_{3},g)$ where
$c_{1}=c_{2}=0$ and $\lambda=1.$

Figure 5: $\mathbf{K}_{4}$-magnetic curve in $(\mathbb{H}_{3},g)$ presented in
$(\mathbb{R}_{3},g_{euc})$

## References

  * [1] M. Barros, A. Romero: Magnetic vortices, EPL 77 (2007), 34002.
  * [2] C. Bejan, S. L. Drută-Romaniuc. Walker manifolds and Killing magnetic curves, Diff. Geo. and its App. , 35 (2014), 106-116. doi.org/10.1016/j.difgeo.2014.03.001.
  * [3] W. Batat, A. Zaeim. On symmetries of the Heisenberg group, arXiv:1710.04539v1.
  * [4] L. Capogna, D. Danielli, S.D. Pauls, J.T. Tyson. An introduction to the Heisenberg group and the sub-Riemannian isoperimetric problem. (Progress in Mathematics). Birkhäuser Verlag, Basel (2007).
  * [5] G. Calvaruso, M. I. Munteanu, A. Perrone. Killing magnetic curves in three-dimensional almost paracontact manifolds, J. of Math. Ana. and App., 426(1), (2015), 423-439. doi.org/10.1016/j.jmaa.2015.01.057
  * [6] S. L. Drută-Romaniuc, J. Inoguchi, M. I. Munteanu and A. I. Nistor: Magnetic curves in cosymplectic manifolds, Rep. Math. Phys. 78 (2016), 33.
  * [7] S. L. Drută-Romaniuc, J. Inoguchi, M. I. Munteanu, A. I. Nistor: Magnetic curves in Sasakian manifolds, J. Nonlinear Math. Phys. 22 (2015), 428.
  * [8] S. L. Drută-Romaniuc, M. I. Munteanu. Killing magnetic curves in a Minkowski 3-space, Nonlinear Analysis: Real World Appl. 14 (2013), 383.
  * [9] S. L. Drută-Romaniuc and M. I. Munteanu, Magnetic curves corresponding to Killing magnetic fields in $\mathbb{E}^{3}$, J. Math. Phys. 52 (2011), 113506.
  * [10] Z. Erjavec. On Killing magnetic curves in $SL(2,\mathbb{R})$ geometry, Reports on mathematical physics, 84(3), (2019), 333-350.
  * [11] Z. Erjavec, Ji. Inoguchi. On Magnetic Curves in Almost Cosymplectic Sol Space. Results Math 75, 113 (2020). doi.org/10.1007/s00025-020-01235-y
  * [12] Z. Erjavec, Ji. Inoguchi. Killing Magnetic Curves in Sol Space. Math. Phys. Anal. Geom. 21, 15 (2018). doi.org/10.1007/s11040-018-9272-6
  * [13] C. Figueroa. The Gauss map of minimal graphs in the Hzisenberg group, J. of Geo. and Sym. in Phys. 25, (2012), 1-21.
  * [14] T. Hangan. Au sujet des flots riemanniens sur le groupe nilpotent de Heisenberg. Rend. Circ. Mat. Palermo 35, 291–305 (1986). doi.org/10.1007/BF02844738.
  * [15] Z. Iqbal, J. Sengupta, S. Chakraborty. Magnetic trajectories corresponding to Killing magnetic fields in a three-dimensional warped product 2020, Inter. J. of Geo. Meth. in Mod. Phys., 17(14), 2050212 (2020). doi.org/10.1142/S0219887820502126
  * [16] J. Milnor, Curvature of left invariant metrics on Lie groups, Adv. Math. 21 (1976), 293-329.
  * [17] M. I. Munteanua, A. Nistor. The classification of Killing magnetic curves in $\mathbb{S}^{2}\times\mathbb{R}$, J. of Geo. and Phys., 62 (2012) 170–182. doi:10.1016/j.geomphys.2011.10.002
  * [18] C. Özgür. On magnetic curves in $3$-dimensional Heisenberg group, Pro. of the Ins. of Math. and Mech., National Academy of Sciences of Azerbaijan, 43(2), (2017), 278-286.


# A statistical approach for controlling the probability of false alarm and
missed detection in smartphone-based earthquake early warning systems

Frank Yannick Massoda Tchoussi  Francesco Finazzi

###### Abstract

Smartphone-based earthquake early warning systems (EEWS) are emerging as a
complementary solution to classic EEWS based on expensive scientific-grade
instruments. Smartphone-based systems, however, are characterized by a highly
dynamic network geometry and by noisy measurements. Thus the need to control
the probability of false alarm and the probability of missed detection.

This paper proposes a statistical approach based on the maximum likelihood
method to address this challenge and to jointly estimate in near real-time
earthquake parameters like epicentre and depth.

The approach is tested using data coming from the Earthquake Network citizen
science initiative which implements a global smartphone-based EEWS.

Keywords: Maximum likelihood, Monte Carlo simulation, hypothesis testing.

##  1 Introduction

Earthquake early warning systems (EEWSs) [1, 2] are deployed in seismic areas
to detect earthquakes in real-time, in order to send a forewarning to citizens
and to stop critical processes before the ground shaking begins. Classic EEWSs
are based on a dense network of scientific-grade instruments with construction
and operational costs in the order of millions of euros [3].

As a result of the accessibility of smartphones, and the advancement of
technologies for mobile apps development, low-cost EEWSs can be implemented.
This path has been explored by the Earthquake Network (EQN) citizen science
initiative [4, 5, 6], which, since 2013, implements the first smartphone-based
EEWS.

Smartphones are used to detect the ground shaking induced by the earthquake
and a warning is issued as soon as the earthquake is detected. People living
at a further distance from the epicentre may be alerted before they are
reached by the damaging seismic waves.

The primary challenge faced by the EQN is to control the probability of false
alarm and the probability to miss an earthquake. Since the earthquake
detection is based on smartphone accelerometer readings, alerts may be
triggered by events unrelated with earthquakes. Also, it is possible that the
network misses a (possibly strong) earthquake, especially if the number of
monitoring smartphones is small. Both false alarms and missed detections
undermine people trustiness on the EEWS.

This paper proposes a statistical approach based on maximum likelihood and
hypothesis testing methods to address the above mentioned problems and to
jointly estimated earthquake epicentre and depth in near real-time (i.e., in
less than one or two seconds).

The statistical approach is developed and tested using Monte Carlo simulations
which rely on the EQN smartphone network, and it is then applied to some true
and false EQN earthquake detections.

##  2 Detection algorithm

Before describing the statistical methodology developed in this work, we
detail the output of the earthquake detection algorithm currently implemented
by EQN [7]. For any given area of radius $30$ km, the algorithm compares the
number of triggering smartphones in the last $10$ seconds with the number of
active smartphones. A triggering smartphone is a smartphone that detected an
acceleration above a threshold, while an active smartphone is a smartphone
known to be monitoring for earthquakes. If the ratio between triggering
smartphones and active smartphones exceeds a threshold, an earthquake is
claimed to be detected. The output of the detection algorithm consist of the
detection location and of the list of the triggering smartphones (triggers for
short), which are identified by their spatial coordinates (latitude and
longitude) and by the triggering time.

##  3 Statistical modelling

The generic observed triggering time for a smartphone sensing an earthquake is
modelled as

$t_{i}=t_{i}^{*}+\epsilon_{i},$ (1)

where $t_{i}^{*}$ is the expected triggering time while $\epsilon_{i}\sim
N(0,\sigma_{\epsilon}^{2})$ is a random component. More in detail

$t_{i}^{*}=\frac{D_{i,H}}{v}+t_{O},$ (2)

with

$D_{i,H}=\sqrt{d_{E}^{2}+4R(R-d_{E})sin\left(\frac{D_{i,E}}{2R}\right)^{2}},$
(3)

the distance between the hypocentre and the smartphone location, $v$ the
seismic wave speed and $t_{O}$ the earthquake origin time. In (3), $D_{i,E}$
is the distance between the epicentre $(lat_{E},lon_{E})$ and the smartphone
location, $d_{E}$ is the earthquake depth and $R$ the earth radius (6371 km).
Here, it is assumed that all smartphones either detect the primary seismic
wave ($v=7.8$ km/s) or they all detect the secondary wave ($v=4.5$ km/s). This
assumption is justified by the fact that the earthquake detection is based on
smartphones within a radius of $30$ km, which is a relatively small area.

The role of the random component $\epsilon_{i}$ is to model the difference
between the expected and the observed triggering time. This difference is
mainly due to the smartphone detection delay and to a seismic wave speed that
may differ from the expected values.

Let us define $\Delta t_{i}=t_{i}-t_{i}^{*}$, then $\Delta t_{i}\sim
N(0,\sigma_{\epsilon}^{2})$. The model parameter vector is
$\bm{\theta}=(lat_{E},lon_{E},d_{E},t_{O},\sigma_{\epsilon}^{2})$.
To classify an earthquake detection between true and false, we implement a
statistical hypothesis test on the variance of $\Delta t_{i}$. The system of
hypothesis is given by

$\displaystyle\left\\{\begin{array}[]{c}H_{0}\mathrel{\mathop{\mathchar
58\relax}}\sigma_{\epsilon}^{2}=\delta\\\ H_{1}\mathrel{\mathop{\mathchar
58\relax}}\sigma_{\epsilon}^{2}>\delta.\end{array}\right.$ (4)

Null hypothesis is rejected when the variance is higher than expected, namely
when smartphone triggering times do not follow the propagation law of primary
or of the secondary seismic wave. The test statistic is

$T=df\frac{{\sigma_{\epsilon}}^{2}}{\delta},$ (5)

which, under the null hypothesis, is distributed as a chi-square with $n-3$
degree of freedom ($df$), where $n$ is the number of triggering smartphones
and $3$ is the number of estimated parameters in equation (7).

Since we do not know which seismic wave is detected by the smartphones, two
tests are done: one with $v=7.8$ km and one with $v=4.5$ km. The detection is
classified as a false earthquake if the null hypothesis is rejected under both
tests. Otherwise the earthquake is classified as true.

It is worth noting that, in general, $\delta$ is unknown since the variance of
$\Delta t_{i}$ is hard to assess under a true earthquake. In Section (4.3),
$\delta$ is estimated using Monte Carlo simulations in order to fix the
desired level of type I error. Since the test is on the variance of the
difference between the observed and the expected triggering time for a given
value of $v$, we assume that $\delta$ does not depend on $v$.

###  3.1 Model estimation

To implement the test in (4), an estimate of $\sigma^{2}_{\epsilon}$ is
needed. Using maximum likelihood, elements of the parameter vector
$\bm{\theta}$ are jointly estimated.

Assuming to have a list of $n$ triggering smartphones provided by the EQN
detection algorithm, the log-likelihood function based on the joint
probability distribution of the $\Delta t_{i}$, $i=1,...,n$, is

$l(\bm{\theta})=-\frac{n}{2}\ln{2\pi}-\frac{n}{2}\ln{\sigma_{\epsilon}^{2}}-\frac{1}{2\sigma_{\epsilon}^{2}}\sum_{i=1}^{n}\Delta
t_{i}^{2}.$ (6)

Note that $\Delta t_{i}$ are assumed to be independent. This assumption is
realistic because smartphones do not share a common clock, detection delays
are independent and the detection by each smartphone is influence by local
factors (e.g., where the smartphone is located, at which floor of the
building, the accelerometer sensitivity and so on).

Maximum likelihood estimates of $lat_{E}$, $lon_{E}$ and $d_{E}$ are given by

$\operatorname*{arg\,min}_{lat_{E},lon_{E},d_{E}}\sum_{i=1}^{n}\Delta
t_{i}^{2}.$ (7)

The solution of (7) cannot be obtained in closed form, due to the non-
linearity of (3), hence estimates are obtained via numerical optimization [8].
As usual, to avoid local minima, the numerical optimization algorithm is run
multiple times starting from random initial values for $lat_{E}$, $lon_{E}$
and $d_{E}$. Note that $t_{O}$ cannot be estimated from (7) since $\Delta
t_{i}$ do not carry information on $t_{O}$. Nonetheless, $t_{O}$ is a nuisance
parameter which is not needed for classifying the EQN detection between true
and false.

Finally, the maximum likelihood estimate of the variance is

$\hat{\sigma_{\epsilon}}^{2}=\frac{1}{n}\sum_{i=1}^{n}(\hat{\Delta
t_{i}}-\hat{\mu})^{2},$ (8)

where $\hat{\Delta t_{i}}=t_{i}-\hat{t_{i}}^{*}$ is computed after replacing
in (2) and in (3) the maximum likelihood estimates, while $\hat{\mu}$ is the
mean of the $\hat{\Delta t_{i}}$.

##  4 Simulation study

Since $\delta$ in (4) is unknown, its value is estimated using Monte Carlo
simulations. The simulation is based on the EQN smartphone network in Lima
(Peru). True and false earthquake detections are simulated considering the
locations of $1000$ smartphones. True detections are used to estimate $\delta$
while false detections are used to assess the power of the test.

###  4.1 Simulation of true detections

For simulating a true earthquake, the following aspects are taken into
account: the earthquake epicentre and depth, the arrival time of the seismic
wave at the smartphone locations, the earthquake detectability by the
smartphone and the error on the triggering time. Lastly, we account for the
fact that smartphones may detect events unrelated to the earthquake.

The epicentre locations ($lon_{E}$, $lat_{E}$) is simulated uniformly inside
the coordinates box $[-12.39^{\circ},-11.74^{\circ}]$ for latitude and
$[-77.17^{\circ},-76.66^{\circ}]$ for longitude. The box encompasses the EQN
network of Lima. On the other hand, the earthquake depth is simulated
uniformly in the range $[0,100]$ km independently of the earthquake epicentre.

The arrival time of the seismic wave at each smartphone location is simulated
from (2) assuming $t_{O}=0$ and $v=7.8$ km/s. Only 70% of the smartphones are
made triggering because of the earthquake. For these smartphones, the error on
the triggering time is simulated from a zero mean normal distribution with
variance $\sigma_{\varepsilon}^{2}=1.67$. Such variance guarantees that the
1-st and the 99-th percentiles of the error are around $-3$ and $3$ s,
respectively, which are realistic values for an error on the triggering time.

Of the remaining 30% of smartphones which do not trigger, 6% are made
triggering at random with a triggering time uniformly generated in the range
$[0,12]$ s. This implies that, when the earthquake is detected by the EQN
detection algorithm, the list of triggering smartphones may include triggers
unrelated with the earthquake.

Once the list of triggering smartphones is defined and sorted by triggering
time, the EQN detection algorithm is applied to the list. The algorithm stops
when the detection condition is satisfied, and the sub-list of triggers that
concurred to the earthquake detection is given as output.

Figure 1 shows an example of a simulated true earthquake. Two separated
regions can be visually identified, one with triggering smartphones (those
that concurred to the detection), and another with non-triggering smartphone
not yet reached by the seismic waves.

Figure 1: True simulated earthquake based on the EQN smartphone network of
Lima (Peru). Smartphones that concurred to the earthquake detection are
represented by circles with diameter proportional to the triggering time.
Active smartphones are represented by diamond markers. The magenta triangular
marker represents the simulated epicentre location.

###  4.2 Simulation of false detections

To simulate a false detections, we assume that smartphones trigger at random
with a triggering time which does not follow the law of the seismic wave
propagation. Only 30% of the smartphones are made triggering and their the
triggering time is uniformly sampled in the range $[0,12]$ s.

Figure 2 shows an example of a simulated false EQN detection. Contrary to true
earthquakes, no specific spatial pattern on the triggers is observed.

Figure 2: Simulated false detection based on the EQN smartphone network of
Lima (Peru). Smartphones that concurred to the detection are represented by
circles with diameter proportional to the triggering time. Active smartphones
are represented by diamond markers.

###  4.3 Simulation results

Following the simulation setup described above, 1000 true and 1000 false
detections are simulated. For each detection, $\hat{\sigma_{\epsilon}}^{2}$ is
then estimated using (8). Figure 3 shows the empirical distributions of
$\hat{\sigma_{\epsilon}}^{2}$ for both true and false detections. The
overlapping between distributions suggest that classification errors are
possible.

Figure 3: Empirical distribution of the estimated variance of the $\Delta
t_{i}$ under simulated true detections (blue histogram), and under simulated
false detections (red histogram). Figure 4: Box plot of the errors on
epicentre location (left) and box plot of the errors on earthquake depth
(right).

Considering the empirical distribution for true detections, we found that
fixing $\delta=0.6$ in (4) gives a type I error equal to $1\%$. Type II error
is assessed using the empirical distribution for false detections and, for the
same value of $\delta$, it is equal to $0.8\%$.

A by-product of detection classification are the estimates on the earthquake
parameters. Figure 4 show box-plots of errors on earthquake epicentre and
depth. Both errors have a median of around $18$ km, suggesting that, along
with the detection classification (true/false), the model output can be
exploited to provide preliminary estimates of the earthquake parameters.

##  5 Real data example

The methodology developed in this work is applied on a true and on a false
detections detection made by EQN. As a true earthquake, the event occurred
near Genova (Italy) on October 4, 2022, at 21:41:10.5 UTC is considered.
Figure 5 depicts the triggering smartphones ($n=21$), while estimation and
classification results are reported in Table 1 for $v=7.8$ and $v=4.5$ km/s,
respectively.

Figure 5: EQN triggers for the earthquake occurred on October 4, 2022 close to
Genoa (Italy). Circles are triggering smartphone with radius proportional to
the triggering time. The red triangle represent the true epicentre and the
black triangle the estimated epicentre.

For both seismic wave velocities, we can observe that latitude and longitude
are accurately estimated, while the error on depth is not negligible.
Nonetheless, the true values are within the 95% confidence intervals computed
from the Hessian matrix given by the algorithm used to minimize (6).
Additionally, the earthquake is classified as true under both velocities since
both observed test statistics are lower than the test critical value. This
happens because triggers are close to the epicentre, and primary and secondary
seismic waves are nearly concurrent.

|  |  $v=7.8$ km/s |  $v=4.5$ km/s
---|---|---|---
| Real | Estimated | Error | Estimated | Error
Latitude (∘) | 44.46 | 44.43 | 0.03 | 44.43 | 0.02
|  | [44.38, 44.47] |  | [44.40, 44.45] |
Longitude (∘) | 9.06 | 9.06 | 0.00 | 9.03 | 0.03
|  | [9.01, 9.11] |  | [9.03, 9.09] |
Depth (km) | 8.00 | 0.01 | 7.99 | 0.01 | 7.99
|  | [0.00, 8.36] |  | [0.00, 3.80] |
Estimated variance | - | 0.57 | - | 1.03 | -
Test statistic value | - | 17.18 | - | 31.02 | -
Critical value | - | 34.80 | - | 34.80 | -
Classification | - | True earthquake | - | True earthquake | -
Table 1: Detection classification and earthquake parameters estimation for the
EQN detection near Genova (Italy) assuming $v=7.8$ and $v=4.5$ km/s. The
number of triggering smartphones is $n=21$. In brackets, 99% confidence
intervals. Real earthquake parameters are taken from the website of the
European-Mediterranean Seismological Centre www.emsc-csem.org. Figure 6:
Triggers for the false EQN detection occurred on September 25, 2022, close to
Acapulco (Mexico). Circles are triggering smartphone with radius proportional
to the triggering time.

The estimation and classification result was obtained in less than $1$ s using
an Intel(R) Core(TM) i7-9750H CPU @2.60GHz, suggesting that the methodology is
useful for real-time applications.

Figure 6 shows, instead, the triggers of a false detection occurred near
Acapulco (Mexico) on September 25, 2022, at 09:55:45 UTC. The detection is
based on $n=108$ triggers. In this case, the computed test statistics are
$1039.7$ and $1026.0$ for $v=4.5$ and $7.8$ km/s, respectively, while the
critical values is $141.62$. $H_{0}$ is rejected in both cases and the
detection is claimed as false.

##  6 Conclusion

This paper developed a statistical methodology for classifying earthquakes
detected in real-time by smartphone-based earthquake early warning systems.
The methodology is based on maximum likelihood estimation and on hypothesis
testing. Thanks to its simplicity, classification and earthquake parameters
estimation are performed in near real-time, making the methodology suitable to
be implemented in operational systems. On the other hand, the methodology does
not fully exploit the information content of the available data. In
particular, the modelling is only on the triggering smartphones, while the
active non-triggering smartphones are ignored. Knowing, at the earthquake
detection time, which smartphones have not (yet) triggered may better
constraint epicentre and depth, thus improving their estimates. This will be
the focus of future works.

## References

  * [1] Claudio Satriano, Yih-Min Wu, Aldo Zollo, and Hiroo Kanamori.  Earthquake early warning: Concepts, methods and physical grounds.  Soil Dynamics and Earthquake Engineering, 31(2):106–118, 2011.
  * [2] Gemma Cremen and Carmine Galasso.  Earthquake early warning: Recent advances and perspectives.  Earth-science reviews, 205:103184, 2020.
  * [3] Douglas D Given, Elizabeth S Cochran, Thomas Heaton, Egill Hauksson, Richard Allen, Peggy Hellweg, John Vidale, and Paul Bodin.  Technical implementation plan for the ShakeAlert production system: An earthquake early warning system for the west coast of the United States.  US Department of the Interior, US Geological Survey Reston, VA, 2014.
  * [4] Francesco Finazzi.  The earthquake network project: Toward a crowdsourced smartphone-based earthquake early warning system.  Bulletin of the Seismological Society of America, 106(3):1088–1099, 2016.
  * [5] Francesco Finazzi.  The earthquake network project: A platform for earthquake early warning, rapid impact assessment, and search and rescue.  Frontiers in Earth Science, 8:243, 2020.
  * [6] Rémy Bossu, Francesco Finazzi, Robert Steed, Laure Fallou, and István Bondár.  “shaking in 5 seconds!”—performance and user appreciation assessment of the earthquake network smartphone-based public earthquake early warning system.  Seismological Society of America, 93(1):137–148, 2022.
  * [7] Francesco Finazzi and Alessandro Fassò.  A statistical approach to crowdsourced smartphone-based earthquake early warning systems.  Stochastic environmental research and risk assessment, 31(7):1649–1658, 2017.
  * [8] Kenneth Lange, J Chambers, and W Eddy.  Numerical analysis for statisticians, volume 2.  Springer, 1999.


Neural Machine Translation models are often trained on large open-source data
coming from institutions such as the European parliament, the European
commission, movies subtitles, Wikipedia pages, etc. These corpora offer us the
necessary amount of data to train neural networks having hundreds of millions
of parameters. However these models are often not well performing on
specialized datasets and therefore transfer learning may be used.

In our approach, we use Dynamic Data Selection, a transfer learning technique,
to train models on specialized datasets that will play a teacher role when
building a multi-domain student through a multi-task knowledge distillation
strategy.

Knowledge distillation as a multi-task technique Initially, we presented the
distillation strategy as a way to perform compression on neural networks. This
has been proved to reduce the complexity while preserving the performance of
the cumbersome network. In our work, we used knowledge distillation to produce
a multi-domain student that may or may not be of the same size than the
teachers.

0.5pt

every picture/.style=line width=0.75pt

[x=0.75pt,y=0.75pt,yscale=-0.9,xscale=0.9] (122.52,31.28) – (122.52,65.73) ..
controls (122.52,70.85) and (110.52,75) .. (95.71,75) .. controls (80.9,75)
and (68.9,70.85) .. (68.9,65.73) – (68.9,31.28)(122.52,31.28) .. controls
(122.52,36.4) and (110.52,40.55) .. (95.71,40.55) .. controls (80.9,40.55) and
(68.9,36.4) .. (68.9,31.28) .. controls (68.9,26.15) and (80.9,22) ..
(95.71,22) .. controls (110.52,22) and (122.52,26.15) .. (122.52,31.28) –
cycle ; (366.81,129.36) – (440.5,129.36) – (440.5,159.15) – (366.81,159.15) –
cycle ; (216.58,36.95) .. controls (216.58,33.1) and (219.71,29.97) ..
(223.57,29.97) – (310.43,29.97) .. controls (314.29,29.97) and (317.41,33.1)
.. (317.41,36.95) – (317.41,57.91) .. controls (317.41,61.77) and
(314.29,64.89) .. (310.43,64.89) – (223.57,64.89) .. controls (219.71,64.89)
and (216.58,61.77) .. (216.58,57.91) – cycle ; (226.57,243.16) .. controls
(226.57,239.27) and (229.73,236.11) .. (233.63,236.11) – (320.34,236.11) ..
controls (324.24,236.11) and (327.4,239.27) .. (327.4,243.16) – (327.4,263.97)
.. controls (327.4,267.87) and (324.24,271.03) .. (320.34,271.03) –
(233.63,271.03) .. controls (229.73,271.03) and (226.57,267.87) ..
(226.57,263.97) – cycle ; (217.33,101.54) .. controls (217.33,97.68) and
(220.45,94.55) .. (224.31,94.55) – (311.17,94.55) .. controls (315.03,94.55)
and (318.16,97.68) .. (318.16,101.54) – (318.16,122.49) .. controls
(318.16,126.35) and (315.03,129.48) .. (311.17,129.48) – (224.31,129.48) ..
controls (220.45,129.48) and (217.33,126.35) .. (217.33,122.49) – cycle ;
(217.33,165.21) .. controls (217.33,161.35) and (220.45,158.22) ..
(224.31,158.22) – (311.17,158.22) .. controls (315.03,158.22) and
(318.16,161.35) .. (318.16,165.21) – (318.16,186.16) .. controls
(318.16,190.02) and (315.03,193.15) .. (311.17,193.15) – (224.31,193.15) ..
controls (220.45,193.15) and (217.33,190.02) .. (217.33,186.16) – cycle ;
(122.52,47) – (146.67,46.96) – (213.86,46.37) ; [shift=(215.86,46.35), rotate
= 539.49] [fill=rgb, 255:red, 0; green, 0; blue, 0 ][line width=0.75] [draw
opacity=0] (8.93,-4.29) – (0,0) – (8.93,4.29) – cycle ; (112.47,234.12) –
(112.47,270.27) .. controls (112.47,275.64) and (99.49,280) .. (83.48,280) ..
controls (67.48,280) and (54.5,275.64) .. (54.5,270.27) –
(54.5,234.12)(112.47,234.12) .. controls (112.47,239.49) and (99.49,243.85) ..
(83.48,243.85) .. controls (67.48,243.85) and (54.5,239.49) .. (54.5,234.12)
.. controls (54.5,228.74) and (67.48,224.38) .. (83.48,224.38) .. controls
(99.49,224.38) and (112.47,228.74) .. (112.47,234.12) – cycle ; [color=rgb,
255:red, 74; green, 144; blue, 226 ,draw opacity=1 ] (318.14,46.35) –
(416.7,46.35) ; [color=rgb, 255:red, 74; green, 144; blue, 226 ,draw opacity=1
] (318.88,110.94) – (403.31,110.94) ; [color=rgb, 255:red, 74; green, 144;
blue, 226 ,draw opacity=1 ] (318.88,175.52) – (335.06,175.52) ; [color=rgb,
255:red, 74; green, 144; blue, 226 ,draw opacity=1 ] (335.06,121.85) –
(335.06,175.52) ; [color=rgb, 255:red, 74; green, 144; blue, 226 ,draw
opacity=1 ] (335.06,121.85) – (389.17,121.85) ; [color=rgb, 255:red, 74;
green, 144; blue, 226 ,draw opacity=1 ] (416.7,46.35) – (416.95,74.53) –
(417.42,128.04) ; [shift=(417.44,130.04), rotate = 269.49] [fill=rgb, 255:red,
74; green, 144; blue, 226 ,fill opacity=1 ][line width=0.75] [draw opacity=0]
(8.93,-4.29) – (0,0) – (8.93,4.29) – cycle ; [color=rgb, 255:red, 74; green,
144; blue, 226 ,draw opacity=1 ] (403.31,110.94) – (402.65,127.13) ;
[shift=(402.56,129.13), rotate = 272.34000000000003] [fill=rgb, 255:red, 74;
green, 144; blue, 226 ,fill opacity=1 ][line width=0.75] [draw opacity=0]
(8.93,-4.29) – (0,0) – (8.93,4.29) – cycle ; [color=rgb, 255:red, 74; green,
144; blue, 226 ,draw opacity=1 ] (389.17,121.85) – (389.17,127.13) ;
[shift=(389.17,129.13), rotate = 270] [fill=rgb, 255:red, 74; green, 144;
blue, 226 ,fill opacity=1 ][line width=0.75] [draw opacity=0] (8.93,-4.29) –
(0,0) – (8.93,4.29) – cycle ; [color=rgb, 255:red, 126; green, 211; blue, 33
,draw opacity=1 ] (406.28,251.02) – (406.28,162.06) ; [shift=(406.28,160.06),
rotate = 450] [fill=rgb, 255:red, 126; green, 211; blue, 33 ,fill opacity=1
][line width=0.75] [draw opacity=0] (8.93,-4.29) – (0,0) – (8.93,4.29) – cycle
; [color=rgb, 255:red, 126; green, 211; blue, 33 ,draw opacity=1 ]
(328.18,251.02) – (406.28,251.02) ; [color=rgb, 255:red, 245; green, 166;
blue, 35 ,draw opacity=1 ] [dash pattern=on 4.5pt off 4.5pt] (366.86,145.5) –
(305.98,208.59) – (280.47,235.02) ; [shift=(279.09,236.46), rotate = 313.98]
[color=rgb, 255:red, 245; green, 166; blue, 35 ,draw opacity=1 ][line
width=0.75] (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) ..
controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ; [dash pattern=on 4.5pt
off 4.5pt] (113.21,254.84) .. controls (142.81,227.68) and (142.96,89.77) ..
(214.04,55.23) ; [shift=(215.12,54.72), rotate = 514.99] [fill=rgb, 255:red,
0; green, 0; blue, 0 ][line width=0.75] [draw opacity=0] (10.72,-5.15) – (0,0)
– (10.72,5.15) – (7.12,0) – cycle ; [dash pattern=on 4.5pt off 4.5pt]
(113.21,252.84) .. controls (137.01,244.24) and (156.35,223.73) ..
(165.69,206.36) .. controls (174.88,189.26) and (180,139.74) ..
(213.56,118.27) ; [shift=(215.12,117.3), rotate = 509.1] [fill=rgb, 255:red,
0; green, 0; blue, 0 ][line width=0.75] [draw opacity=0] (10.72,-5.15) – (0,0)
– (10.72,5.15) – (7.12,0) – cycle ; [dash pattern=on 4.5pt off 4.5pt]
(113.21,252.84) .. controls (144.71,265.38) and (181.99,195.85) ..
(213.67,182.46) ; [shift=(215.12,181.89), rotate = 519.71] [fill=rgb, 255:red,
0; green, 0; blue, 0 ][line width=0.75] [draw opacity=0] (10.72,-5.15) – (0,0)
– (10.72,5.15) – (7.12,0) – cycle ; [dash pattern=on 4.5pt off 4.5pt]
(113.21,252.84) .. controls (124.2,300.32) and (192.93,286.03) ..
(223.42,259.51) ; [shift=(224.79,258.29), rotate = 497.47] [fill=rgb, 255:red,
0; green, 0; blue, 0 ][line width=0.75] [draw opacity=0] (10.72,-5.15) – (0,0)
– (10.72,5.15) – (7.12,0) – cycle ; [color=rgb, 255:red, 245; green, 166;
blue, 35 ,draw opacity=1 ] (142.96,253.75) – (223.53,252.86) ;
[shift=(225.53,252.84), rotate = 539.37] [fill=rgb, 255:red, 245; green, 166;
blue, 35 ,fill opacity=1 ][line width=0.75] [draw opacity=0] (8.93,-4.29) –
(0,0) – (8.93,4.29) – cycle ; [color=rgb, 255:red, 245; green, 166; blue, 35
,draw opacity=1 ] (186.85,46.35) – (184.99,253.29) ; [color=rgb, 255:red, 245;
green, 166; blue, 35 ,draw opacity=1 ] (143.71,176.43) – (142.96,253.75) ;
[color=rgb, 255:red, 245; green, 166; blue, 35 ,draw opacity=1 ]
(164.53,110.94) – (163.79,253.75) ; (122.52,98.28) – (122.52,132.73) ..
controls (122.52,137.85) and (110.52,142) .. (95.71,142) .. controls
(80.9,142) and (68.9,137.85) .. (68.9,132.73) – (68.9,98.28)(122.52,98.28) ..
controls (122.52,103.4) and (110.52,107.55) .. (95.71,107.55) .. controls
(80.9,107.55) and (68.9,103.4) .. (68.9,98.28) .. controls (68.9,93.15) and
(80.9,89) .. (95.71,89) .. controls (110.52,89) and (122.52,93.15) ..
(122.52,98.28) – cycle ; (122.52,114) – (146.67,113.96) – (213.86,113.37) ;
[shift=(215.86,113.35), rotate = 539.49] [fill=rgb, 255:red, 0; green, 0;
blue, 0 ][line width=0.75] [draw opacity=0] (8.93,-4.29) – (0,0) – (8.93,4.29)
– cycle ; (121.72,160.28) – (121.72,194.73) .. controls (121.72,199.85) and
(109.72,204) .. (94.91,204) .. controls (80.1,204) and (68.1,199.85) ..
(68.1,194.73) – (68.1,160.28)(121.72,160.28) .. controls (121.72,165.4) and
(109.72,169.55) .. (94.91,169.55) .. controls (80.1,169.55) and (68.1,165.4)
.. (68.1,160.28) .. controls (68.1,155.15) and (80.1,151) .. (94.91,151) ..
controls (109.72,151) and (121.72,155.15) .. (121.72,160.28) – cycle ;
(121.72,176) – (145.87,175.96) – (213.06,175.37) ; [shift=(215.06,175.35),
rotate = 539.49] [fill=rgb, 255:red, 0; green, 0; blue, 0 ][line width=0.75]
[draw opacity=0] (8.93,-4.29) – (0,0) – (8.93,4.29) – cycle ; (97.7,54.29)
node [align=left]  Data
Domain A; (405.14,143.68) node [align=left] Loss; (267.28,48.17) node
[align=left] Teacher Domain A; (276.98,253.57) node [align=left] Multi-domain
Model; (268.03,112.76) node [align=left] Teacher Domain X; (268.03,176.43)
node [align=left] Teacher Domain Z; (82.21,260.5) node [align=left]  Generic
Data; (365.88,197.35) node [align=left] Back-propagation; (267.56,77) node
[align=left] …; (268.41,142) node [align=left] …; (97.7,121.29) node
[align=left]  Data
Domain X; (96.9,183.29) node [align=left]  Data
Domain Z; (95.56,81) node [align=left] …; (95.41,146) node [align=left] …;

Figure : Training a multi-domain student using multiple single domain teachers

This strategy enables us to use a single model to translate sentences from
different domains instead of storing different expert models, filtering the
data during inference and using the corresponding teacher. It is time and
memory efficient and particularly convenient in a production environment. The
use of specialists that are trained on different domains has some resemblance
to mixture of experts which learns how to assign each example to the most
likely expert through probability computation. During training, two learning
phases happen simultaneously, the experts are learning how to be accurate on
the examples assigned to them and the gating network is learning how to assign
examples to the corresponding experts. The major difference between the two
methods is parallelization. It is easier to train at the same time different
teachers on their corresponding domain than to parallelize mixtures of
experts.

##  Dynamic Data Selection

Here we present a transfer learning technique called Dynamic data selection
developed by Marlies van der Wees et al. in [van-der-wees-etal-2017-dynamic]
used to build the teachers during the distillation process. The idea is to
select sentences from generic data that are similar to the in-domain corpus
and at the same time dissimilar to the generic corpus. The metric used for the
ranking is based on the cross-entropy. Let I be the in-domain data, $G$ the
generic data. We assume that $G$ contains a subset $G_{I}$ that has the same
distribution than I.
The objective of the method is to select sentences $s$ from $G$ that are most
probably belonging to $G_{I}$, i.e. maximizing $P(G_{I}|s,G)$.

$P(G_{I}|s,G)=\frac{P(s|I)P(G_{I}|G)}{P(s|G)}$ (1)

This quantity, log-transformed, is close to : $H_{I}(s)-H_{G}(s)$.
The entropy $H_{A}(b)$ is defined as: $H_{A}(b)=E_{x\sim P}(-logQ(b))$, P
being the language model computed on the corpus A, Q the estimated language
model and b the sentence of interest.
In order to perform data selection on a bi-text corpus, a ranking metric is
introduced: CED_s = [H_I(s_source) - H_G(s_source)] + [H_I(s_target) -
H_G(s_target)] For example, when calculating $H_{I}(s_{source})$, we build a
language model on the in-domain corpus then we use the score function to rank
sentences. The output is the log-transformed product of each word’s
probability. During gradual fine-tuning, the selection size $n$ is a function
of the epoch $i$ :

$n(i)=\alpha|G|\beta^{\frac{i-1}{\nu}}$ (2)

where $\alpha$ is the relative start size i.e. the fraction of the out-of-
domain data for the first selection, $G$ is the size of the latter, 0
$\leq\beta\leq$ 1 is the retention rate i.e. the fraction to be kept at each
selection, $i$ the epoch, $\nu$ the number of epochs where the selected subset
doesn’t change.
This finetuning approach has been proven to provide state-of-the-art result in
the context of domain specialization (especially when the set of in-domain
parallel sentences is small) while significantly reducing the training time.
This method have been used in order to finetune our expert teachers on single
domains.

##  Distillation process

The training that we propose for distillation process is described in
Algorithm 1. Multi-domain student training pipeline Input: Generic dataset
$\mathcal{G}$, $n$ different specialiazied datasets
$(\mathcal{D}_{i})_{i\in\\{1..n\\}}$ Output: Multi-domain student model
$S_{multi}$ trained using knowledge distillation Initialization: Transformer
model $M_{gen}$ initialized with random weights. Empty array $\mathcal{P}_{T}$
of size (T,L,$|V|$) where T is the sentence length, L the training set size
and $|V|$ the vocabulary size. 1\. Train generic model: $M_{gen}$ not
converging Train $M_{gen}$ with batches from $\mathcal{G}$ 2\. Finetune
teachers: $i$ in $\\{1..n\\}$ Initialize $\mathcal{T}_{i}$ = $M_{gen}$
Finetune $\mathcal{T}_{i}$ using dynamic data selection on specialized dataset
$\mathcal{D}_{i}$ and generic data $\mathcal{G}$. 3\. Extend
$\mathcal{P}_{T}$: $i$ in $\\{1..n\\}$ $d$ in $\mathcal{D}_{i}$ Compute
$\mathcal{P}_{T_{i}}(d_{src})$, the probability distribution resulting from
$\mathcal{T}_{i}$’s translation of $d_{src}$. Append
$\mathcal{P}_{T_{i}}(d_{src})$ to $\mathcal{P}_{T}$ 4\. Train student model:
Let $\mathcal{G}_{sub}$ be a randomly selected subset from the generic
dataset. $S_{multi}$ not converging Train $S_{multi}$ with batches from
($\cup_{i\in\\{1..n\\}}\mathcal{D}_{i}$) $\cap\ \mathcal{G}_{sub}$ using
$\mathcal{P}_{T}$ in the cost function.

##  Top-K distillation

In our experiments, the student model does not match the full distribution of
the teacher model but only the top-K output distribution in order to reduce
memory cost. Actually, it is expensive in terms of RAM memory to load the full
distributions of the different teacher models knowing that we may have a large
number of teachers.

##  Word-Level knowledge distillation

In Neural Machine Translation, two kind of distillation processes have been
explored so far. The first one, word-level is based on training the student to
mimick teacher’s local word distributions (using the ground truth target
sequence) while the second one, sequence-level is based on training the
student to mimick the teacher’s output after beam search (without using the
ground truth target sequence). While [kim-rush-2016-sequence] have proved
sequence level knowledge distillation efficiency for neural network
compression. [multilingual] proved that sequence level knowledge distillation
when used in the multi-teacher framework results in significantly lower
performances than word-level distillation. Hence, all our experiments are
based on word-level knowledge distillation only.

##  Label smoothing impact on distillation

In [label_smoothing_help], the authors investigate the consequences of using
label smoothing, when training teachers, on the student performance. They’ve
shown that using label smoothing does not necessarily lead to better
distillation. They assume that this shortcoming is linked to the information
erasure caused by label smoothing. A visualization technique applied to the
penultimate layer representations of image classifiers trained on image
datasets such as CIFAR10 enabled to show that using label smoothing results in
a loss of information concerning similarities between examples of different
classes.