# A new mathematical symbol : the termirial

Claude-Alexandre Simonetti  LPC Caen  EAMEA Cherbourg  ENSICAEN

###### Abstract

The understanding of probability can be difficult for a few young scientists.
Consequently, this new mathematical symbol, related to binomial coefficients
and simplicial polytopic numbers, could be helpful to science education.
Moreover, one can obtain kinds of remarkable identities and generalize them to
a sort of “Newton’s binomial theorem”. Finally, this symbol could be perhaps
useful to other scientific subjects as well, such as computer science.

###### pacs:

Valid PACS appear here

##  I Study of binomial coefficients

###  I.1 Reminder

In a set of n elements, the number of combinations of parts of p elements is
the following:

$\binom{n}{p}=\frac{n!}{p!\leavevmode\nobreak\ (n-p)!}$ (1)

With $\binom{n}{p}$ the binomial coefficient, $(n,p)\in{\mathbb{N}^{2}}$ and
$p\leq n$. And the exclamation point in equation (1) is named “factorial” and
is defined as, $\forall n\in{\mathbb{N}^{*}}$:

$\displaystyle n!$ $\displaystyle=$ $\displaystyle
n\cdot(n-1)\cdot(n-2)\leavevmode\nobreak\ ...\leavevmode\nobreak\ 3\cdot
2\cdot 1$ $\displaystyle n!$ $\displaystyle=$ $\displaystyle\prod_{i=1}^{n}i$
(2)

For $n=0$, by definition : 0!=1.

###  I.2 From factorial to termirial

For its part, the termirial is defined as, $\forall n\in{\mathbb{N^{*}}}$:

$\displaystyle n\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$ $\displaystyle=$
$\displaystyle n+(n-1)+...+3+2+1$ $\displaystyle
n\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$ $\displaystyle=$
$\displaystyle\sum_{i=1}^{n}i$ (3)

This is called a triangular number of order n, see reference Dickson (1919).
The termirial symbol is almost like the factorial symbol, with just a little
difference, however : the dot ($\cdot$) of the interrogation point, which
could be a reminder of a multiplication, is replaced by a “plus” ($+$) sign.
Indeed, instead of multiplying factors of a multiplication – factorial – one
adds terms of an addition, hence the name of “termirial”. Up to this point,
things look quite basic. However, as the termirial is the $n^{th}$ partial sum
of an arithmetic sequence $(U_{n})_{n\in{\mathbb{N^{*}}}}$ with $U_{1}=1$ as
first term and $r=1$ as common difference, one can notice a first thing,
$\forall n\in{\mathbb{N^{*}}}$:

$\displaystyle n\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$ $\displaystyle=$
$\displaystyle\frac{n\cdot(n+1)}{2}=\binom{n+1}{2}=\binom{n+1}{n-1}$ (4)

One will get back to it later, with the “generalized” termirial.

###  I.3 Remarkable identity

It is possible to obtain a kind of remarkable identity. Indeed,
$\forall(n,m)\in{\mathbb{N^{*}}^{2}}$:

$\displaystyle(n+m)\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$
$\displaystyle=$ $\displaystyle\frac{(n+m)\cdot(n+m+1)}{2}$
$\displaystyle(n+m)\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$
$\displaystyle=$ $\displaystyle\frac{n\cdot(n+1)}{2}+\frac{2\cdot n\cdot
m}{2}+\frac{m\cdot(m+1)}{2}$
$\displaystyle(n+m)\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$
$\displaystyle=$ $\displaystyle
n\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}+n\cdot
m+m\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$ (5)

###  I.4 Intellectual path

At the beginning, I was studying the black body radiation (Max Planck’s law).
In this context, suppose one has $n$ particles to fill up in 2 discrete energy
levels determined by quantum mechanics. Suppose that the first energy level
named $m_{1}$ can contain $p$ particles, and that the second one ($m_{2}$) can
contain $(n-p)$ particles. The number of possible combinations is same as
equation (1):

$\binom{n}{p}=\frac{n!}{p!\leavevmode\nobreak\ (n-p)!}$ (6)

Let us start with a simple example : $n=5$ and $p=2$. The figure 1 tries to
explain the intellectual path which has led to the termirial. One can see the
energy level $m_{1}$ containing $p=2$ particles, with all the ways to fill it
up, for particles particules ranked from 1 to 5. In this case, as a reminder,
it is an unordered sampling without replacement, the rank order of the
particles has no importance : $\\{1\leavevmode\nobreak\ 2\\}$ and
$\\{2\leavevmode\nobreak\ 1\\}$ are counted only once. Finally :
$\binom{5}{2}=4\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}=10$.

Figure 1: This figure represents the intellectual path from the binomial
coefficient $\binom{5}{2}$ to the termirial of 4, through a classical tree
view. Here, only the energy level $m_{1}$ is represented, which is sufficient,
because one only has 2 energy levels, not more.

Let us make things a little bit more complicated, with $n=5$ and $p=3$. In
terms of binomial coefficients, one has the same result as before :
$\binom{5}{3}=\binom{5}{2}=10$. But the intellectual path is a bit different,
see figure 2.

Figure 2: This figure represents the intellectual path from the binomial
coefficient $\binom{5}{3}$ to a sum of termirials, a kind of “termirial of
termirials” or a $2^{nd}$ termirial. From now, one can generalize to the
$3^{rd}$ termirial, the $4^{th}$ termirial, etc.

One can see a kind of “termirial of termirials”, which is called a tetrahedral
number of order n, see reference Dickson (1919):

$\displaystyle n\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$ $\displaystyle
n\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}+(n-1)\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}+...+3\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}+2\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}+1\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$
$\displaystyle n\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\sum_{k=1}^{n}k\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}=\sum_{k=1}^{n}\sum_{i=1}^{k}i=\sum_{k=1}^{n}\frac{k(k+1)}{2!}$
(7) $\displaystyle
n\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$ $\displaystyle=$
$\displaystyle\binom{n+2}{3}=\binom{n+2}{n-1}=\frac{n(n+1)(n+2)}{3!}$ (8)

The transition from (7) to (8) can be done with mathematical induction.
Indeed, if the following proposition $P(n)$ is true:

$\displaystyle n\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\sum_{k=1}^{n}\frac{k(k+1)}{2!}=\frac{n(n+1)(n+2)}{3!}$ (9)

And, for $P(1)$:

$\displaystyle 1\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\sum_{k=1}^{1}\frac{k(k+1)}{2}=\frac{1\cdot(1+1)}{2}=1$
$\displaystyle\binom{3}{3}$ $\displaystyle=$
$\displaystyle\frac{1(1+1)(1+2)}{3!}=1$

Finally, with $P(n+1)$:

$\displaystyle(n+1)\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\sum_{k=1}^{n}\frac{k(k+1)}{2}+\frac{(n+1)(n+2)}{2}$
$\displaystyle=$ $\displaystyle\frac{n(n+1)(n+2)}{3!}+\frac{(n+1)(n+2)}{2}$
$\displaystyle=$ $\displaystyle\frac{n(n+1)(n+2)}{6}+3\frac{(n+1)(n+2)}{6}$
$\displaystyle(n+1)\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$ $\displaystyle\frac{(n+1)(n+2)(n+3)}{3!}$ (10)

QED.

###  I.5 Remarkable identity of the $2^{nd}$ termirial

Like the $1^{st}$ termirial, it is possible to obtain a kind of remarkable
identity. Indeed, $\forall(n,m)\in{\mathbb{N^{*}}^{2}}$:

$\displaystyle(n+m)\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\frac{(n+m+2)}{3}\cdot(n+m)\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$
$\displaystyle=$
$\displaystyle\frac{(n+m+2)}{3}\cdot(n\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}+n\cdot
m+m\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}})$
$\displaystyle(n+m)\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$ $\displaystyle
n\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}+n\cdot
m\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}+m\cdot
n\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}+m\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
(11)

From now on, one can generalized to the $p^{th}$ termirial.

##  II Generalization of the termirial

###  II.1 The $p^{th}$ termirial

Obviously, the the $p^{th}$ termirial, which is called a (p+1)-simplicial
polytopic number, see reference Dickson (1919), will be defined as,
$\forall(n,p)\in{\mathbb{N^{*}}\times\mathbb{N^{*}}}$:

$\displaystyle n\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\sum_{m=1}^{n}\sum_{l=1}^{m}...\sum_{j=1}^{k}\sum_{i=1}^{j}i$
(12) $\displaystyle
n\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$ $\displaystyle=$
$\displaystyle\sum_{k=1}^{n}k\overset{(p-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}=\sum_{k=1}^{n}\frac{1}{p!}\prod_{i=0}^{p-1}(k+i)$
(13) $\displaystyle
n\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$ $\displaystyle=$
$\displaystyle\binom{n+p}{p+1}=\binom{n+p}{n-1}$ (14) $\displaystyle
n\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$ $\displaystyle=$
$\displaystyle\frac{1}{(p+1)!}\prod_{i=0}^{p}(n+i)$ (15)

With, for the equation (12), a number of sigmas $(\sum)$ symbols equal to $p$.
For $p=0$, one can define the $0^{th}$ termirial as:

$n\overset{(0)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}=n=\binom{n}{1}$

For $p=-1$, one can define the $-1^{th}$ termirial as:

$n\overset{(-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}=1=\binom{n-1}{0}$

The proof to go from (13) to (14) (or from (13) to (15)) can be done with
mathematical induction as well. Indeed, admitting that the following $P(n)$
proposition is true:

$\displaystyle\sum_{k=1}^{n}\frac{1}{p!}\prod_{i=0}^{p}(k+i)$ $\displaystyle=$
$\displaystyle\frac{1}{(p+1)!}\prod_{i=0}^{p}(n+i)$ (16)

One have, for $P(1)$:

$\displaystyle
1\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}=\frac{1}{p!}\prod_{i=0}^{p-1}(1+i)=\frac{p!}{p!}$
$\displaystyle=$ $\displaystyle 1$
$\displaystyle\frac{1}{(p+1)!}\prod_{i=0}^{p}(1+i)=\frac{(p+1)!}{(p+1)!}$
$\displaystyle=$ $\displaystyle 1$ (17)

And, for $P(n+1)$:

$\displaystyle(n+1)\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\sum_{k=1}^{n}\frac{1}{p!}\prod_{i=0}^{p-1}(k+i)+\frac{1}{p!}\prod_{i=0}^{p-1}(n+1+i)$
$\displaystyle=$
$\displaystyle\frac{1}{(p+1)!}\prod_{i=0}^{p}(n+i)+\frac{(p+1)}{(p+1)!}\prod_{i=1}^{p}(n+i)$
$\displaystyle=$ $\displaystyle\frac{(n+p+1)}{(p+1)!}\prod_{i=1}^{p}(n+i)$
$\displaystyle(n+1)\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\frac{1}{(p+1)!}\prod_{i=1}^{p+1}(n+i)=\binom{n+p+1}{p+1}$ (18)

QED.

###  II.2 Pascal’s rule

With Pascal’s rule as a reminder:

$\displaystyle\binom{n}{p}+\binom{n}{p+1}$ $\displaystyle=$
$\displaystyle\binom{n+1}{p+1}$

It is possible to adapt it to termirials:

$\displaystyle(n+1)\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}+(n)\overset{(p+1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle(n+1)\overset{(p+1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$

###  II.3 Newton’s binomial theorem

With Newton’s binomial theorem as a reminder,
$\forall(a,b)\in{\mathbb{R}\times\mathbb{R}}$ and $\forall n\in{\mathbb{N}}$:

$\displaystyle(a+b)^{n}$ $\displaystyle=$
$\displaystyle\sum_{p=0}^{n}\binom{n}{p}a^{n-p}\cdot b^{p}$

It is possible to adapt it as well to termirials,
$\forall(n,m)\in{\mathbb{N}^{*}\times\mathbb{N}^{*}}$ and $\forall
p\in{\\{\\{-1\\}\cup\mathbb{N}\\}}$:

$\displaystyle(n+m)\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\sum_{i=-1}^{p}n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}\cdot
m\overset{(p-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$ (19)

The proof can be done with mathematical induction. Indeed, admitting that the
following $P(p)$ proposition is true:

$\displaystyle(n+m)\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\sum_{i=-1}^{p}n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}\cdot
m\overset{(p-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$

First of all, equations (5) and (11) respectively hold $P(1)$ and $P(2)$, even
if only $P(1)$ – or only $P(2)$ – is enough for this mathematical induction.
Considering $P(p+1)$:

$\displaystyle(n+m)\overset{(p+1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\frac{n+m+p+1}{p+2}(n+m)\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\frac{n+m+p+1}{p+2}\sum_{i=-1}^{p}n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}\cdot
m\overset{(p-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\frac{n+m+p+1}{p+2}\sum_{i=-1}^{p}n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}\cdot
m\overset{(p-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\frac{1}{p+2}\sum_{i=-1}^{p}\\{[n+(i+1)]+[m+p+1-(i+1)]\\}\cdot
n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}\cdot
m\overset{(p-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$ $\displaystyle\frac{1}{p+2}\sum_{i=-1}^{p}[n+(i+1)]\cdot
n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}\cdot
m\overset{(p-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}+\frac{1}{p+2}\sum_{i=-1}^{p}[m+p+1-(i+1)]\cdot
n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}\cdot
m\overset{(p-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$ $\displaystyle\frac{1}{p+2}\sum_{i=-1}^{p}(i+2)\cdot
n\overset{(i+1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}\cdot
m\overset{(p-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}+\frac{1}{p+2}\sum_{i=-1}^{p}[p+2-(i+1)]\cdot
n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}\cdot
m\overset{(p+1-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\frac{1}{p+2}\sum_{i=0}^{p+1}(i+1)n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}m\overset{(p+1-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}+\sum_{i=-1}^{p}n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}m\overset{(p+1-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}-\frac{1}{p+2}\sum_{i=-1}^{p}(i+1)n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}m\overset{(p+1-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$ $\displaystyle
n\overset{(p+1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}\cdot
m\overset{(-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}+\sum_{i=-1}^{p}n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}m\overset{(p+1-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle(n+m)\overset{(p+1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\sum_{i=-1}^{p+1}n\overset{(i)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}m\overset{(p+1-i-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$

QED.

##  III Pratical applications

###  III.1 Computational complexity

In computer science, the termirial can be used to calculate the complexity of
computer programs with intricated “for” loops as follows : for example, with 4
“for” loops, with:
\- for i from 1 to n=100 ;
\- for j from 1 to i ;
\- for k from 1 to j ;
\- for l from 1 to k.

The complexity will be:

$\displaystyle
100\overset{(4-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$
$\displaystyle=$
$\displaystyle\binom{100+3}{3+1}=\binom{103}{4}=\binom{103}{99}=4\leavevmode\nobreak\
421\leavevmode\nobreak\ 275$

So, approximatey 4,4 millions of operations.
More generally, the complexity of this kind of program will be, according to
equation (15) and $\forall(n,p)\in{\mathbb{N^{*}}\times\mathbb{N^{*}}}$ :
$n\overset{(p-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}=\Theta(n^{p})$.

###  III.2 Pseudo-fractal aspect

Figure 3: This figure tries to convert $p^{th}$ termirial of 4 into fractal
figures, for p=0, p=1 and p=2. Only the grey squares are counted.

The figure 3 tries to convert $p^{th}$ termirial of 4 into fractal figures,
for p=0, p=1 and p=2. Only the grey squares are counted. For example, for
$4\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}$, 20 squares are
in grey, which corresponds to
$4\overset{(2)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}=20$. For each
incrementation of p, the side of each square is divided by 2, and the same
basic pattern is repeated:
\- $4\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$ when the 4 previous squares
are in grey ;
\- $3\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$ when the 3 previous squares
are in grey ;
\- $2\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$ when the 2 previous squares
are in grey ;
\- $1\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}$ when only 1 previous square
is in grey.

But the Hausdorff dimension (D) of this presumed fractal is not constant, and
the limit of D as p approaches infinity is 2. Indeed, let $a$ the side length
of each square related to the $p^{th}$ termirial. The total surface $S_{p}$ of
the squares in grey will be:

$\displaystyle S_{p}$ $\displaystyle=$ $\displaystyle a^{2}\cdot
n\overset{(p)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}=a^{2}\cdot\frac{1}{(p+1)!}\prod_{i=0}^{p}(n+i)$

And for the $S_{p-1}$ surface, related to the $(p-1)^{th}$ termirial, for a
side length of each square doubled in size:

$\displaystyle S_{p-1}$ $\displaystyle=$ $\displaystyle 4a^{2}\cdot
n\overset{(p-1)}{\overset{|}{\raisebox{-4.30554pt}{\tiny{+}}}}=4a^{2}\cdot\frac{1}{(1)!}\prod_{i=0}^{p-1}(n+i)$

Hence, for $p>0$:

$\displaystyle\frac{S_{p-1}}{S_{p}}$ $\displaystyle=$ $\displaystyle
4\cdot\frac{p+n}{p+1}=4\cdot\frac{1+n/p}{1+1/p}$

Finally, this surface ratio, as p approaches infinity, is 4:

$\displaystyle\lim_{p\to\infty}\frac{S_{p-1}}{S_{p}}$ $\displaystyle=$
$\displaystyle 4$

Consequently, the Hausdorff dimension (D) is 2, as $2^{D}=4$, when p
approaches infinity. To conclude, as D is not constant, even if figure 3 looks
interesting, termirials do not seem to be related to fractals.

##  IV Conclusion

The termirial is a symbol which could be helpful to scientific students, for
the understanding of probability. As well, it could be perhaps helpful in
other subjects than science education, that are out of this pré-publication.

## References

  * Dickson (1919) L. E. Dickson,  _History of the Theory of Numbers, Volume 2, Chapter 1_ (Carnegie Institution of Whashington, 1919).
  * Pascal (2019) B. Pascal,  _Traité du triangle arithmétique_ (Arvensa Editions, 2019).
  * ISO (2009) _ISO 80000-2:2009(E), Quantities and units_ (International Organization for Standardization, 2009).
  * Simonetti (2020) C.-A. Simonetti, “Un nouveau symbole mathématique : la termirielle,”  (2020), working paper or preprint.


# Detecting Gas Vapor Leaks Using Uncalibrated Sensors

Diaa Badawi1 Tuba Ayhan2 Sule Ozev3 Chengmo Yang4 Alex Orailoglu5 A. Enis
Çetin1

Emails: 1{dbadaw2<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>This work is being supported in part by
NSF grants 1739396 (UIC), 1739451 (ASU), 1739390 (UD) and 1739684 (UCSD) . The
authors, Badawi and Cetin, additionally thank Nvidia for an equipment grant.
1Department of Electrical and Computer Engineering, University of Illinois at
Chicago, Illinois  2Electronics and Communication Engineering Department,
Istanbul Technical University, Turkey  3School of Electrical, Computer and
Energy Engineering, Arizona State University, Tempe, AZ  4Department of
Electrical & Computer Engineering, University of Delaware, Newark, DE
5Department of Computer Science & Engineering, University of California, San
Diego, La Jolla, CA

###### Abstract

Chemical and infra-red sensors generate distinct responses under similar
conditions because of sensor drift, noise or resolution errors. In this work,
we use different time-series data sets obtained by infra-red and E-nose
sensors in order to detect Volatile Organic Compounds (VOCs) and Ammonia vapor
leaks. We process time-series sensor signals using deep neural networks (DNN).
Three neural network algorithms are utilized for this purpose. Additive neural
networks (termed AddNet) are based on a multiplication-devoid operator and
consequently exhibit energy-efficiency compared to regular neural networks.
The second algorithm uses generative adversarial neural networks so as to
expose the classifying neural network to more realistic data points in order
to help the classifier network to deliver improved generalization. Finally, we
use conventional convolutional neural networks as a baseline method and
compare their performance with the two aforementioned deep neural network
algorithms in order to evaluate their effectiveness empirically.

###### Index Terms:

VOC gas leak detection; sensor drift; additive, convolutional, and generative
adversarial (GAN) neural networks; time-series data analysis

##  I Introduction

Ammonia and Volatile organic compounds (VOCs) are associated with numerous
health problems. Although VOCs and Ammonia are naturally occurring, they can
nonetheless cause serious health issues in high concentration. For example,
exposure to Ammonia in high concentration causes harm to skin, lungs and eyes.
Methane and other VOC compound leaks contribute to global warming. VOC
compounds such as benzene and toluene are carcinogenic[1, 2, 3, 4].

In this paper, we consider both an infrared (IR) and a chemical sensor system
for early detection and, thus, prevention of dangerous gas leaks111This work
was presented in part at the 2019 IEEE International Conference on Acoustics,
Speech and Signal Processing (ICASSP), Brighton, UK, May 2019 [5].. Mobile
infrared and chemical sensors can be part of an open air cyber-physical system
(CPS)[5]. We use the time-series data obtained by the sensors in order to
detect accidental and/or deliberate gas vapor leaks. The main contribution of
this paper centers on the exploitation of the time-series data that sensors
produce rather than conventional reliance on a single or a couple of sensor
readings for leak detection.

Some VOC gas vapors such as ethane and ammonia absorb infrared light in the
Long Wave Infrared (LWIR) while others such as methane in the Medium Wave
Infra-red (MWIR) bands. Absorbance by ammonia of infra-red light at different
wavelengths is shown in Fig 1. We can easily observe the existence of VOC gas
vapor using Infra-red (IR) cameras in open air as shown in Fig. 2. In this
figure, a dark smoke-like region denotes the image of VOC gas vapor. However,
the distance between the sensor and the source, and infrared reflections from
the background significantly affect the recorded level [6, 7].

Conventional optical devices, such as gas chromatographs and MWIR cameras, are
generally expensive. A cheaper alternative would be the use of IR sensors and
chemical gas sensors. Yet chemical gas sensors incur degradation in their
sensitivity over time. Consequently, identically manufactured sensors are
likely to yield significantly different responses upon exposure to gas
analytes under identical conditions [8, 9, 10, 11, 12]. This problem is known
in the literature as the _sensor drift problem_.

Causes of sensor drift can be summed up by two phenomena, namely, the physical
changes in the structure of the sensor and the changes in the operating
environment. The former case is known as _first-order sensor drift_. It is
caused by sensor aging or by sensor “poisoning”222A process by which the
sensor surface absorbs some compounds irreversibly, thus reducing its
resistance sensitivity [13].. Unfortunately, neither poisoning nor aging are
reversible as the physical structure of the sensor will have been permanently
damaged or at the least affected. The latter case is known as _second-order
sensor drift_ and is caused by external uncontrollable environmental changes,
such as temperature and humidity variations. In this regard, the sensor
response will be different from that expected from the original settings.
Consequently, any decision thresholds that are optimal prior to sensor drift
are likely to exhibit sub-optimal sensitivity and/or specificity once the
aforementioned changes take place.

Similarly, while it is not possible to detect the concentration of the gas
using MWIR and LWIR sensors in open air, it is possible to record a time-
varying signal and detect the existence of gas leakage using IR sensors as
shown in Fig. 3 using a machine learning algorithm such as a neural network.
The sensor signal exhibits sudden jumps and fluctuations due to gas vapor
leak. Uncalibrated IR sensor intensity measurements suddenly drop from 95 to
70 and fluctuate because of wind as shown in Fig. 3.

Figure 1: Infrared spectrum of ammonia. The figure is taken from NIST [14].

Figure 2: Two infrared images of VOC gas leaks. Red rectangles contain gas-
leak regions. Green rectangles contain leak-free regions. Images are
downloaded from FLIR systems and Infrared Cameras Inc. [15, 16], respectively.

.

In this paper, we analyze the temporal sensor signals using convolutional,
additive neural networks and the discriminator of a generative adversarial
network (GAN) to detect and classify VOC gas leaks and other dangerous gas
emissions. The proposed analysis is applicable to both Chemically-sensitive
Field Effect Transistors (ChemFETs) and Electrochemical Impedance Spectroscopy
(EIS) and infra-red sensors as they all produce time-varying signals.

The rest of the paper is organized as follows. Section II describes the
machine learning algorithms used in this paper. Section III presents
experimental results. We use an infrared data set and two publicly available
chemical sensor drift data sets obtained at the University of California at
San Diego (UCSD) [11] and [17]. The paper finishes by offering a brief set of
conclusions in Section IV.

Figure 3: Example infrared sensor time-series data near a gas leak. As one can
see, it is not possible to find a threshold that can isolate leak-free
intensity signals from those corresponding to a gas leak. Furthermore, the
intensity of leak-free point signals is time-varying. This demonstrates the
effect of noise, resolution and lighting factors that in turn lend further
complexity to the task of distinguishing between the two classes of signals.
The two sets of examples are distinguished by dotting.

##  II Deep Learning Algorithms for IR and Chemical Sensor Data Processing

In this paper, we consider three tasks. Task 1 is infra-red sensor-based gas-
leakage detection. In tasks 2 and 3, we identify different types of gas
analytes.

Our first network is an energy-efficient network, namely, an additive neural
network, which is a neural network that performs no vector-multiplication
except in its last layer. Our second neural network is the discriminator of a
generative adversarial neural network, to which we refer shortly as DiscGAN.

###  II-A Convolutional Neural Networks

Convolutional neural networks (or ConvNets) have been extensively used in
computer vision [18, 19] and time-series data analysis [20]. In ConvNets,
convolutions (or local correlations) between the inputs and the filter weights
are used to extract local features at different scales in subsequent layers.

###  II-B Additive Neural Networks (AddNet)

Despite their ability to learn and recognize images and signals, deep learning
algorithms are computationally expensive. This is attributed to the large
number of add-multiply operations needed to be implemented in order to realize
convolutions. This poses a problem when it comes to using such methods on
platforms where energy is limited. As a result, simpler and, thus, more
efficient algorithms are generally required to implement computationally
expensive deep learning algorithms in such cases.

Nevertheless, there have been attempts to leverage convolutional neural
networks across energy-limited devices by means of methods that aim to either
implement fewer dot-product operations, or to replace dot-product operations
with computationally simpler operations. Binarizing the weights and/or the
activations results in replacing real-number multiplication operations with
binary logical operations when realizing convolution, as in the case of
BinaryConnect[21], XNOR-Net[22] and Binarized Neural Networks [23].

An additive neural network (AddNet) falls under the second category, i.e.,
replacing real-valued multiplication operations in vector-vector and matrix-
vector product operations by special addition operations. The new “product”
operation comprises binary sign calculation, unsigned addition and regular
addition.

In what follows, we define the scalar version of our binary operation and
extend it straightforwardly to its vector operation. In this regard, let $x$
and $y\in\mathbf{R}$, the multiplication-devoid (abbreviated md) operation
denoted by $\oplus$ and defined as follows:

$x\oplus y:=\text{sgn}(x.y)(|x|+|y|)$ (1)

where sgn denotes the signum function. Alternatively, we can express the
$\oplus$ operation as follows:

$x\oplus y:=\text{sgn}(x)y+\text{sgn}(y)x$ (2)

This is because $x=\text{sgn}(x)|x|$. One key property of the md operation is
that it preserves the sign of regular multiplication operations [24, 25]. We
define the vector version of the md operation as follows. Let $\bf{x}$ and
$\bf{w}$ be two vectors in $\bf{R}^{N}$. The md dot “product” is defined as:

$\mathbf{w}^{T}\oplus\mathbf{x}:=\sum_{i=1}^{N}\text{sgn}(x_{i}.w_{i})(|x_{i}|+|w_{i}|)$
(3)

It can be seen that the md operation expressed in Eq. 3 requires no real-
valued multiplication whatsoever. As such, instead of using add-multiply
operations as in an ordinary dot product, we use ordinary addition and
addition with sign multiplication in the md vector operation. Furthermore, we
can restrict the operands $x_{i}$ and $w_{i}$ to be 8-bit numbers in order to
speed up the vector addition operations. Another property of the md operation
is that it induces the $\ell_{1}$ norm. This is shown as follows:

$\mathbf{x}^{T}\oplus\mathbf{x}=\sum_{i=1}^{N}\text{sgn}(x_{i}.x_{i})(|x_{i}|+|x_{i}|)=2{||\mathbf{x}||}_{1}$
(4)

In the context of neural networks, we use convolution and matrix-vector
multiplication operations in convolutional and dense layers, respectively. In
AddNet, we replace the aforementioned dot-product operations with the md
vector product. The feed-forwarding pass in dense layers in a neural network
can be expressed as follows:

$o^{l}_{i}=\phi\big{(}{\mathbf{w}_{i}^{l}}^{T}\mathbf{o}^{l-1}+b^{l}_{i}\big{)}$
(5)

where the superscript denotes the layer index, the subscript the neuron index,
$\mathbf{w}_{i}^{l}$ the weights connecting the output of the previous layer
(the $(l-1)$st layer) to the $ith$ neuron, $o_{i}^{l}$ the output of the $ith$
neuron, and bold $\mathbf{o}^{l-1}$ the vector output of the previous layer.
$\phi$ is the non-linearity function applied element-wise and, finally,
$b^{l}_{i}$ denotes the bias term added to the pre-activated response
${\mathbf{w}_{i}^{l}}^{T}\mathbf{o}^{l-1}$. Similarly, we can define AddNet
layers by replacing the dot-product ${\mathbf{w}_{i}^{l}}^{T}\mathbf{o}^{l-1}$
by our md operator as follows:

$o^{l}_{i}=\phi\big{(}{\mathbf{w}_{i}^{l}}^{T}\oplus\mathbf{o}^{l-1}+b_{i}^{l}\big{)}$
(6)

Since the md operator is additive, it will result in a larger output than
ordinary multiplication does when either of the operands is of small
magnitude, e.g. $3\oplus 0.1=3.1>3\times 0.1=0.3$. In the context of neural
networks, the layer outputs and the weights are usually small values. As a
result, the responses of the md layers will be of larger variance than those
of the regular layer. This poses a problem in deep layers, where the dimension
of the dot-product is quite large. In other words, if the depth of a
convolutional layer is 64 and the kernel size is $3\times 3$, the convolution
operations will carry out dot-products between two vectors, each of which
$\in\mathbb{R}^{3\times 3\times 64}$. In the case of the md layer, this will
cause the output to exhibit inordinately high magnitudes. In order to overcome
this, we introduce a scaling factor $\alpha$. As such, the feedforwarding pass
in Eq. 6 becomes

$o^{l}_{i}=\phi\big{(}\alpha_{i}^{l}({\mathbf{w}_{i}^{l}}^{T}\oplus\mathbf{o}^{l-1})+b_{i}^{l}\big{)}$
(7)

The scaling factor $\alpha^{l}_{i}$ enables us to control the range of the
output prior to applying the activation function $\phi$ and, thus, leads to a
controlled range of responses in subsequent layers. Note that the scaling by
$\alpha^{l}_{i}$ in Eq. 7 implies real-valued multiplication. Nevertheless, it
requires only one real-valued multiplication per neuron. Therefore, carrying
out scaling is not computationally expensive. Numerous options exist for
selecting the scaling factor $\alpha^{l}_{i}$. One possibility may be the
setting of $\alpha^{l}_{i}$ to $\frac{1}{{||w_{i}^{l}||}_{1}}$, i.e., the
reciprocal of the $\ell_{1}$ norm of the associated weights. Another option
would be having $\alpha^{l}_{i}$ be trainable by backpropagation. The latter
delivers more flexibility for the model.

Nevertheless, batch normalization is a common practice in neural networks and
has shown to be quite effective in accelerating the training of deep networks
[26]. Therefore, one can simply apply batch normalization to the pre-
activation responses in AddNet. Such normalization eliminates the need to
carry out scaling by $\alpha^{l}_{i}$ as it will be subsumed by the scaling
induced by batch normalization.

The proof of AddNet with linear and/or ReLU activation functions satisfying
the universal approximation property over the space of Lebesgue integrable
functions can be found in [27].

As for training the md layers by backpropagation, it is worth mentioning that
the derivative of the signum function used in the definition has to be
computed. This is because $\frac{d~{}\text{sgn}(w)}{dw}=2\delta(w)$, where
$\delta$ is the Dirac-delta function. In practice, this means that the
derivative of the signum function is zero almost everywhere except when $w=0$.
The partial derivative of the md operator w.r.t. $w$ is:

$\frac{\partial(w\oplus x)}{\partial w}=\text{sgn}(x)+2x\delta(w)$ (8)

We approximate the derivative of the signum operator using the hyperbolic
tangent as follows:

$\frac{d~{}\text{sgn}(w)}{dw}\approx\frac{d~{}\tanh(aw)}{dw}=a\operatorname{sech}^{2}(aw)$
(9)

where $\operatorname{sech}(x)=\frac{2}{e^{x}+e^{-x}}$ is the hyperbolic secant
function, and $a$ is a hyperparameter indicating how sharp the hyperbolic
tangent is. The larger the hyperparameter $a$ is, the closer $\tanh$ is to the
signum function. Figure 4 shows the approximate derivative of the signum
function for $a=10$.

Figure 4: The derivative of $\tanh(aw)=a\operatorname{sech}^{2}(aw)$ as a
function of parameter $w$, with $a$ set to 10.

As we can see from Fig. 4, the derivative has high magnitude for $w$ values
close to zero, whereas it is effectively zero for large values. This can be
seen as allowing small weights to have finer updates than larger weights and
thus allowing them to change their sign more often during training. We found
empirically that this approximate derivative computation provides satisfactory
convergence rates in Google’s Tensorflow software.

###  II-C DiscGan (Discriminator of GAN as Classifier)

Generative Adversarial Networks (GAN) have become the benchmark in image
synthesis [28, 29]. A typical GAN has a generative network, which attempts to
generate images (or data) resembling real images from noise input, and a
discriminator network, which attempts to discriminate between the real images
and those synthesized by the generator. The generator and the discriminator
are optimized in an adversarial scheme, i.e., the generator tries to fool the
discriminator by the synthetic data it produces, and, in turn, the
discriminator tries to counteract the generator by discriminating between the
real data samples and the fake ones.

In this paper, our aim is not to synthesize realistic data but rather to make
use of the adversarial nature of GAN training in order to obtain a
discriminator network capable of classifying the input with an unbalanced set
of training data. As the recordings of gas leak data may fall short of the
clean air recordings for this purpose, we have the generator of the GAN to
compensate for the data set with a smaller number of data instances by
producing “artificial” gas leak data during training.

In this regard, we perform a two-phase training of the GAN. First, we carry
out adversarial training of both the discriminator and the generator using the
data of one of the classes. In the second phase, we use data from both classes
and carry supervised binary-classification training of the discriminator which
now acts as a classifier. In this setting, let $x^{i}$ represent the $ith$
data instance of one of the classes. In this case, $x^{i}$s denote the gas
leak recordings (or the anomalous class). Let $z$ be a random noise vector,
e.g. Gaussian noise or uniform noise. Let $D$ be the discriminator and $G$ be
the generator, with each having a set of parameters $\theta_{D}$ and
$\theta_{G}$, respectively. In the adversarial-training phase, we seek to
optimize the following loss function:

$\max_{\theta_{D}}\min_{\theta_{G}}\sum_{i}\log(D(x^{i}))+\sum_{i}\log(1-D(G(z^{i}))$
(10)

where $D(x^{i})$ is the soft prediction result of the discriminator
corresponding to data point $x^{i}$. From the discriminator perspective, the
prediction output $D(x^{i})$ should be close to 1 because $x^{i}$ is “real”.
The generator $G$ produces “fake” data signals from noise vector $z^{i}$, that
is $G(z^{i})$, and the prediction $D(G(z^{i}))$ should be close to zero
because $G(z^{i})$ is an artificial data instance. The generator, on the other
hand, will try to produce $G(z^{i})$ that will be assigned the prediction
$D(G(z^{i}))$ close to 1. Once training the first stage is accomplished, we
move on to the second stage of supervised training of the entire training
data, in which the cost function we seek to minimize is the regular binary
cross entropy function $CE$ expressed as follows:

$CE:=-\frac{1}{N}\Big{(}\sum_{i}(1-t^{i})\log(1-D(x^{i}))+t^{i}\log(D(x^{i}))\Big{)}$
(11)

where $t^{i}~{}\in\\{0,1\\}$ denotes the true class of $x^{i}$.

When there are multiple classes we can still use the discriminator of a GAN
with a slight modification of the loss functions. In this regard, let us
assume that there are $N$-classes. In this case, the one-hot encoded label for
each input is an $N$-dimensional vector, with all entries equal to zero,
except for the $kth$ entry, where $k$ is the true class. During training, the
discriminator (or classifier) will minimize the cross entropy of the softmax
layer applied at the output layer ($N$ logits). The generator $G$ will attack
the output of the $kth$ node. Here we consider the output of the $kth$ node to
be the logit of a binary class, i.e., the adversarial loss criterion becomes:

$max_{\theta_{D}}min_{\theta_{G}}\log(D_{k}\big{(}G(z)\big{)}$ (12)

where $D_{k}\big{(}G(z)\big{)}$ is the discriminator _sigmoidal_ response of
the $kth$ node, i.e., we apply the sigmoid function to the logits before
taking the logarithm in determining the loss. Note that the loss here is
different from the multi-class case, in which we consider multi-class logits,
i.e., we use sigmoid normalization instead of the softmax normalization. In
practice, since we do a mini-batch update, we take the average of the loss
functions and minimize the loss functions based on the mini-batch gradients.

##  III Datasets and Experimental Results

###  III-A Infra-red VOC Dataset

Our first data set consists of infra-red imaging signals of VOC gas leaks in
open air and clean air recordings. Specifically, we have two classes of
discrete-time signals corresponding to VOC gas leaks and clean air,
respectively. Each signal is a time series containing 50 samples corresponding
to two seconds of recording with a sampling rate of 25 samples per second. The
recorded value varies in open air because of background temperature variations
and low resolution error as it can be observed in Fig. 3. Furthermore, the
sensors may not be calibrated in practice, so their sensitivity may differ
across time. We gathered about 30,000 VOC gas leak and 30,000 clean air data
instances.

The images are obtained using an MWIR camera produced by FLIR systems and
Infrared Cameras Inc. [15, 16]. VOC gas absorbs the infra-red light appearing
as a white cloud in the black-hot mode infra-red image as shown in Fig. 2. In
these videos, a gas leak erupts from the source with the gas spreading out as
time progresses. We manually selected regions of interest and assigned normal
event designations to temporal measurements where no gas is present throughout
these series, while designating the rest as anomalous events.

We used min-max normalization in order to scale signal data points between 0
and 1. The normalized signal $\hat{x}$ is obtained as follows

$\hat{x}[n]=\frac{x[n]-\min(x)}{\max(x)-\min(x)},\quad n=0,1,...\ ,49$ (13)

where $\max(x)$ and $\min(x)$ represent the maximum and minimum values of a
given infrared signal $x$, respectively.

We used convolutional neural networks with the architecture specified in Table
I. In order to obtain more temporal data points, and in order to ensure the
network is translation-invariant to the gas eruption location, we chose to
randomly crop the input data into temporal signals of size $32$ each.

TABLE I: Architecture of the convolutional neural network used in classifying the data set of Sec. III-A Layer | Specification
---|---
Input Layer | input size: $32\times 1$
Conv Layer | 16 $3\times 1$ filters, no strides
Max-pooling Layer | down-sampling by 2
Batch-normalization Layer | -
Conv Layer | 32 $3\times 16$ filters, no strides
Max-pooling Layer | down-sampling by 2
Batch-normalization Layer | -
Conv Layer | 64 $3\times 32$ filters, no strides
Max-pooling Layer | down-sampling by 2
Batch-normalization Layer | -
Global Average-pooling Layer | output size: 64
Dense Layer | output size: 64
Batch-normalization Layer | -
Output Linear Layer | output size: 1

We divided our data set into three disjoint sets. The training data consists
of 8,000 recordings of each class. Another set of 8,000 recordings of each
class is used as the validation data set. The rest of the data was reserved
for testing. We trained our networks using the RMSProp optimizer algorithm
[30]. We tested the hypothesis of whether dropout helps achieve better results
[31] by using a dropout rate of $50\%$. As for the GAN approach, we used a
generator which is a multi-layer perceptron (MLP) with one hidden layer of
size 256. The regular convolutional neural network and AddNet exhibit
comparable results. We obtained an accuracy of $99.8\%$ for no-gas data and
$99.7\%$ for gas-leak data for a regular ConvNet. AddNet attained a
recognition rate of $98.9\%$ for no-gas data and $99.3\%$ for gas-leak data.

In the second set of experiments, we assumed that we have an unbalanced data
set. In practice, we may not have VOC or ammonia gas leak recordings as clean
air. We trained the models with only 50 recordings of gas leak signals against
8,000 recordings of clean air recordings. The test data set contains 14,000
recording instances of VOC gas leaks and clean air recordings. Classification
results are also summarized in Table II. AddNet produces the best results but
the discriminator of the GAN Network is also quite close to AddNet. The
confusion matrix of the results of the best model is given in Table III.

TABLE II: Accuracy results for infra-red VOC data. Classifiers are trained with only 50 VOC gas leak recordings vs 8000 clean air recordings. Model |  | No-gas
---
Accuracy
(specificity)
| Gas-leak
---
Accuracy
(sensitivity)
| Total
---
Accuracy
| ConvNet
---
(dropout $50\%$)
$98.3\%$ | $95.8\%$ | $97.1\%$
| ConvNet
---
no dropout
$98.0\%$ | $94.2\%$ | $96.1\%$
| AddNet
---
(dropout $50\%$)
$98.2\%$ | $96.0\%$ | $97.1\%$
| AddNet
---
(no dropout)
$99.1\%$ | $97.3\%$ | $98.2\%$
| DiscGAN
---
$99.0\%$ | $97.1\%$ | $98.1\%$
TABLE III: Confusion matrix for the best achieving neural network (AddNet with no dropout) over the testing data. The true positive rate (sensitivity) is $97.3\%$. The true negative rate (specificity) is $99.1\%$.  Actual Class |  | Predicted Class
---
Total Count
Leak | No Leak
(positive) | (negative)
Leak (positive) | 13,622 | 378 | 14,000
No Leak (negative) | 126 | 13,874 | 14,000

We also investigated pruning the weights in both AddNet and ConvNet during
inference. In this regard, we discard the magnitudes of the smallest magnitude
weights while retaining their sign information. We keep the bias coefficients
and the coefficients of the last layer intact. Results of various pruning
rates are shown in Table IV. Apparently, in AddNet, we can discard the
magnitude information of the weights up to a high rate ($67.4\%$) without
severely degrading performance. On the other hand, the magnitude information
is quite critical in the case of a regular ConvNet. These results clearly show
the advantages of AddNet, which requires reduced memory space in a mobile
device and consumes less energy as it performs much fewer arithmetic
operations during inference.

TABLE IV: Effect of compressing weights of AddNet and ConvNet by discarding the smallest $K\%$ magnitude while keeping the sign information. ConvNet fails to produce reasonable results when the compression rate exceeds $16.1\%$. The compression rate is estimated by allocating 32 bits to intact weight values and 1 bit for every binarized weight factor. | Model
---
Accuracy
| Weight Compression
---
Rate (smallest K%)
| $0$ | $16.1$ | $19.7$ | $67.4$ | $76.8$ | $86.6$
AddNet | 98.9 | 97.2 | 97.9 | 98.0 | 97.1 | 61.3
ConvNet | 99.8 | 67.4 | $-$ | $-$ | $-$ | $-$

###  III-B Gas Sensor Array Recordings under Dynamic Gas Mixtures

We consider a gas type identification problem, in which we have three types of
gases to identify, namely, CO, Ethylene and Methane. We used the data set
obtained by Fonollosa et al. [17]. The data set consists of time-series
measurements of a sensor array of 16 chemical metal-oxide sensors under
exposure to two different kinds of gas mixtures, ethylene and methane in air,
and ethylene and CO in air. Sensors were exposed to volatile organic compounds
at different concentration levels under tightly-controlled operating
conditions during the experiment. The data is obtained at a sampling frequency
of 100 $Hz$. The 16 chemical sensors are of four different types, with each
having four identical sensors.333For more details, the reader may refer to the
original paper [17]. Furthermore, switching between different mixtures of VOCs
may occur too fast making it challenging if not impossible for the sensors to
reach steady state. This makes identifying the gas analytes difficult using a
machine learning method.

The recorded sensor data is deposited to the UC Irvine Machine Learning
Repository online in the form of two long time-series. We extracted portions
of the time series such that the sensor array is exposed to one type of
analyte at a given time. Each recording corresponds to 100 seconds of data. We
observed that it is enough to sample the sensor response every 2 seconds.
Example sensor response signals to CO, ethylene and methane gas vapor
exposures are shown in Fig. 5. Each sub-figure contains four different sensor
responses.

We gathered a total of 215 instances from the raw recordings, in which we have
49 CO, 116 ethylene and 50 methane time-series signals. Each instance has $50$
time measurements for each sensor. Thus, a total of $50\times 16$ measurements
per instance are used. Since the number of instances in the data set is small,
we employed cross validation with holdout method, where our validation set
consists of 35 examples, with the experiment repeated 4 times. Thus, we
validated our results over 140 examples. Furthermore, since the number of
instances is small compared to the input dimension $50\times 16$, we opted to
randomly crop data points during training into smaller time series of size
$40\times 16$. This allows the classifier to be invariant to the exact time
where the exposure takes place. Furthermore, it increases the number of data
points during training.

Since the sensors are of different types, and since even the sensors of the
same type produce different temporal responses, we process the temporal sensor
data using 1-D convolutional networks. The input to each neural network is a
matrix of size $40\times 16$, for $40$ time instances and 16 sensors.

TABLE V: Architecture of the convolutional neural network used in classifying the data set of Sec. III-B. Layer | Specification
---|---
Input Layer | input size: $40\times 16$
Conv Layer | 64 $5\times 16$ filters, no strides
Max-pooling Layer | pooling size: 4, stride size: 3
Batch-normalization Layer | -
Conv Layer | 128 $5\times 64$ filters, no strides
Max-pooling Layer | pooling size: 4, stride size: 3
Batch-normalization Layer | -
Conv Layer | 256 $5\times 128$ filters, no strides
Max-pooling Layer | pooling size: 4, stride size: 3
Batch-normalization Layer | -
Global Average-pooling Layer | output size: 256
Dense Layer | output size: 256
Batch-normalization Layer | -
Output Linear Layer | output size: 3

We used ReLU non-linearity between layers. Our loss function is the cross-
entropy with the softmax operator. We used the RMSProp optimizer to carry out
the parameter updates during training. We trained a regular ConvNet and an
AddNet of the same architecture as in Table V. Our classification accuracy
results over the testing data are shown in Table VI. The confusion matrix of
the results over the validation data set obtained by AddNet is given in Table
VII.

TABLE VI: Recognition rates for the two neural networks over the test data set |  | Gas Type-based Accuracy
---
Average Accuracy
CO | Ethylene | Methane
ConvNet | $91.1\%$ | $98.6\%$ | $100\%$ | $96.6\%$
AddNet | $91.1\%$ | $97.2\%$ | $100\%$ | $96.1\%$
TABLE VII: Confusion matrix for AddNet over the validation data sets for repeated trials  True |  | Predicted Class
---
Total
Class | CO | Ethylene | Methane | Count
CO | 31 | 3 | 0 | 34
Ethylene | 2 | 70 | 0 | 72
Methane | 0 | 0 | 34 | 34

It can be observed in Table VI that the recognition capabilities of both
AddNet and ConvNet are on par with one another. It is worth emphasizing the
computational frugality of the scheme as use of the regular dot-product is
confined solely to the last layer in AddNet.

(a) CO

(b) Ethylene

(c) Methane

Figure 5: Time-series data generated by four different sensors under exposure
to different type of gases (50 time samples for each sensor).

###  III-C Chemical Gas Sensor Array Drift Dataset

The third data set is the publicly available chemical VOC gas sensor drift
data set compiled by Vergara et al. at UCSD [11]. The data set was obtained by
exposing an array of 16 distinct chemical sensors to 6 types of gas mixtures
(ammonia, acetone, ethylene, ethanol, toluene and acetaldehyde) at a variety
of concentration levels. Each data record is a vector time series. Vectors
contain 8 feature parameters extracted from the sensor time series signals
during a gas release experiment, conducted over a period of three years at
UCSD. The feature parameters include the steady state resistance value and the
normalized resistance change. The remaining 6 parameter features are the
maxima and minima of the exponential moving average (emaα) transform governed
by the following input-output relation:

$y[k]=(1-\alpha)y[k-1]+\alpha(r[k]-r[k-1])$ (14)

where $r[k]$ is the resistance value at time step $k$, and $y[k]$ is the
transformed value after applying the ema filter. The maxima and minima
features are reported for $\alpha$ values equal to $0.1$, $0.01$ and $0.001$
over an entire experiment. These ema features have distinct time constants for
different $\alpha$ values, as they contain temporal information.
Unfortunately, the raw time-domain sensor signals are not available in this
data set.

Since there are 16 sensors, a total of $16\times 8=128$ feature values are
recorded per experiment. The data set is divided into 10 batches ordered
chronologically. Full details about the experiment and the data set can be
found in [11].

We carried out our classification tasks by training neural networks for $N=2$
batches and testing on successive batches. This is identical to the sensor
drift estimation approach given in [11]. Because feature values have huge
variances, we opted to apply the signed square root function element-wise to
control the ranges of the reported values. The modification delivered improved
results in our experiments, especially for later batches.

We trained an MLP model with two hidden layers, each with 512 output units,
and an output layer. Furthermore, we trained the network for 100 epochs using
the RMSProp optimizer [30]. We applied a dropout rate of $20\%$ and used a
batch size of 128 in order to prevent complex co-adaptation. To augment the
data, we added a zero-mean Gaussian noise with standard deviation of 0.1.

We also tried combining AddNet with the GAN approach, in which case, the
discriminator is an AddNet and the generator is a regular MLP. The
architecture of the network is the same as that of the GAN we use.
Furthermore, we tried utilizing the other batches by passing them to the
classifier and carrying out backpropagation according to their guessed labels.
This is done in order for the network to utilize the correctly guessed labels
so that it could be helpful in improving the classification accuracy for the
mis-classified data point. A numerical comparison of the proposed methods to
the SVM-classifier ensemble used in [11] is given in Table VIII. In general,
the AddNet-MLP, the MLP and the multi-class GAN discriminator produce better
sensor-drift compensated results than does the SVM based method.

TABLE VIII: Comparative accuracy (in $\%$) results of the various models when training on batches 1 and 2 and testing on batches 3-10. Bold-text numbers correspond to the best accuracy results obtained amongst the different algorithms for each batch. Batch ID |  | SVM Classifier Ensemble[11]
---
MLP |  | AddNet-MLP
---
| DiscGAN
---
| AddNet-DiscGAN
---
| Domain
---
adaptation
Batch 3 | 87.8 | 98.6 | 98.6 | 98.3 | 97.8 | 98.7
Batch 4 | 90.6 | 83.8 | 75.1 | 71.4 | 69.6 | 73.3
Batch 5 | 72.1 | 99.5 | 99.4 | 98.4 | 98.9 | 99.5
Batch 6 | 44.5 | 74.9 | 75.9 | 72.3 | 73.9 | 76.4
Batch 7 | 42.5 | 59.8 | 57.4 | 61.5 | 66.3 | 59.2
Batch 8 | 29.9 | 34.0 | 34.0 | 62.3 | 58.8 | 39.1
Batch 9 | 59.8 | 31.6 | 38.9 | 63.2 | 63.8 | 52.3
Batch 10 | 39.7 | 47.3 | 54.3 | 43.8 | 44.5 | 46.1

As we can see from Table VIII, using DiscGAN (with a regular discriminator or
AddNet), we were able to obtain better recognition rates for later batches
(batches 7, 8 and 9). This could be attributed to the fact that the generator
did expose the discriminator to novel unseen points in the data space during
training. Therefore, the discriminator would have been able to learn
additional meaningful features. As for AddNet, it can perform as well as the
regular MLP, either in conventional binary classification or in the case of
DiscGAN. It is also worth noting that the domain adaptation scheme we employed
did not yield any significant improvements. We believe that improved
classification results would have been attained, if the entire temporal sensor
signal set were at our disposal as input to our algorithms.

##  IV Conclusions

In this paper, we have introduced a variety of deep-learning based algorithms
and applied them to VOC gas and ammonia vapor leak detection and gas type
identification problems. The first algorithm is based on AddNet. In AddNet, we
replace the computationally expensive dot-product operations in deep neural
networks with a modified addition operation that retains the sign of
multiplication. Its computational efficiency enables AddNet to be used in
embedded and mobile systems, in which we envision a smart gas leakage
monitoring and detection CPS being reliably used.

The second algorithm is called DiscGAN, which uses the discriminator of a
generative adversarial neural network as a classifier in a bid to enhance the
recognition capabilities of the system. The generator part helps in exposing
the discriminator to realistic synthetic data points that can be helpful in
classification tasks.

We considered three detection and classification tasks. The first task is to
detect VOC gas leakage from temporal IR data. Our proposed algorithms achieved
accuracy rates of $97-98\%$. The second task we considered is to identify gas
types using temporal data of sensor arrays. We were able to attain recognition
rates of $96.1-96.5\%$. Our third task was to identify gas types using non-
temporal data, where the readings are obtained for the same sensor array over
a period of 36 months. The sensor measurements suffer from degradation due to
sensor drift.

Although our gas identification accuracy results for the early batches in the
last data set were quite high, the degradation incurred in later batches
resulted in significant identification accuracy drop. We believe that the non-
temporal global features reported for the experiments are highly affected by
sensor drift. As a result, the features are not sufficiently expressive of the
sensor responses for different gas analyte types. Based on our high
recognition rates for two temporal data sets considered in this work, we
conclude that using sensor measurements in their temporal presentation, and
feeding these recordings into deep neural network algorithms, achieves better
performance as these algorithms learn discriminative features by themselves
with no need to hand-craft features that could be sensitive to error as in the
case of the sensor drift problem.

## References

  * [1] A. P. Jones, “Indoor air quality and health,” _Atmospheric environment_ , vol. 33, no. 28, pp. 4535–4564, 1999.
  * [2] S. Brown, M. R. Sim, M. J. Abramson, and C. N. Gray, “Concentrations of volatile organic compounds in indoor air–a review,” _Indoor air_ , vol. 4, no. 2, pp. 123–134, 1994.
  * [3] C. Maltoni, A. Ciliberti, G. Cotti, B. Conti, and F. Belpoggi, “Benzene, an experimental multipotential carcinogen: results of the long-term bioassays performed at the Bologna Institute of Oncology.” _Environmental health perspectives_ , vol. 82, p. 109, 1989.
  * [4] J. Kang, J. Liu, and J. Pei, “The indoor volatile organic compound (VOC) characteristics and source identification in a new university campus in Tianjin, China,” _Journal of the Air & Waste Management Association_, vol. 67, no. 6, pp. 725–737, 2017.
  * [5] D. Badawi, S. Ozev, J. B. Christen, C. Yang, A. Orailoglu, and A. E. Çetin, “Detecting gas vapor leaks through uncalibrated sensor based cps,” in _ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)_. IEEE, 2019, pp. 8296–8300.
  * [6] F. Erden, E. B. Soyer, B. U. Toreyin, and A. E. Cetin, “VOC gas leak detection using pyro-electric infrared sensors,” in _Acoustics Speech and Signal Processing (ICASSP), 2010 IEEE International Conference on_. IEEE, 2010, pp. 1682–1685.
  * [7] A. E. Cetin and B. U. Toreyin, “Method, device and system for determining the presence of volatile organic compounds (VOC) in video,” Apr. 30 2013, uS Patent 8,432,451.
  * [8] W. Göpel and K.-D. Schierbaum, “Definitions and typical examples,” _Sensors: Chemical and Biochemical Sensors-Part I_ , vol. 2, pp. 1–27, 1991\.
  * [9] F. Davide, C. Di Natale, M. Holmberg, and F. Winquist, “Frequency analysis of drift in chemical sensors,” in _Proceedings of the 1st Italian Conference on Sensors and Microsystems, Rome, Italy_ , 1996, pp. 150–154.
  * [10] M. Zuppa, C. Distante, P. Siciliano, and K. C. Persaud, “Drift counteraction with multiple self-organising maps for an electronic nose,” _Sensors and Actuators B: Chemical_ , vol. 98, no. 2-3, pp. 305–317, 2004.
  * [11] A. Vergara, S. Vembu, T. Ayhan, M. A. Ryan, M. L. Homer, and R. Huerta, “Chemical gas sensor drift compensation using classifier ensembles,” _Sensors and Actuators B: Chemical_ , vol. 166, pp. 320–329, 2012.
  * [12] T. Artursson, T. Eklöv, I. Lundström, P. Mårtensson, M. Sjöström, and M. Holmberg, “Drift correction for gas sensors using multivariate methods,” _Journal of chemometrics_ , vol. 14, no. 5-6, pp. 711–723, 2000.
  * [13] D. E. Williams, G. S. Henshaw, and K. F. Pratt, “Detection of sensor poisoning using self-diagnostic gas sensors,” _Journal of the Chemical Society, Faraday Transactions_ , vol. 91, no. 18, pp. 3307–3308, 1995.
  * [14] National Institute of Standards and Technology. Ammonia. Accessed: 2019-june-16. [Online]. Available: https://webbook.nist.gov/cgi/cbook.cgi?ID=C7664417&Type=IR-SPEC&Index=1
  * [15] FLIR Systems Australia. Accessed: 2019-june-16. [Online]. Available: http://www.ferret.com.au/latest-videos
  * [16] Infrared Cameras Inc. Accessed: 2019-june-6. [Online]. Available: https://infraredcameras.com/thermal-infrared-media/videos/
  * [17] J. Fonollosa, S. Sheik, R. Huerta, and S. Marco, “Reservoir computing compensates slow response of chemosensor arrays exposed to fast varying gas concentrations in continuous monitoring,” _Sensors and Actuators B: Chemical_ , vol. 215, pp. 618–629, 2015.
  * [18] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” in _Advances in neural information processing systems_ , 2012, pp. 1097–1105.
  * [19] Y. LeCun, Y. Bengio _et al._ , “Convolutional networks for images, speech, and time series,” _The handbook of brain theory and neural networks_ , vol. 3361, no. 10, 1995.
  * [20] M. Längkvist, L. Karlsson, and A. Loutfi, “A review of unsupervised feature learning and deep learning for time-series modeling,” _Pattern Recognition Letters_ , vol. 42, pp. 11–24, 2014.
  * [21] M. Courbariaux, Y. Bengio, and J.-P. David, “Binaryconnect: Training deep neural networks with binary weights during propagations,” in _Advances in neural information processing systems_ , 2015, pp. 3123–3131.
  * [22] M. Rastegari, V. Ordonez, J. Redmon, and A. Farhadi, “XNOR-Net: ImagenNet classification using binary convolutional neural networks,” in _European Conference on Computer Vision_. Springer, 2016, pp. 525–542.
  * [23] M. Courbariaux, I. Hubara, D. Soudry, R. El-Yaniv, and Y. Bengio, “Binarized neural networks: Training deep neural networks with weights and activations constrained to+ 1 or-1,” _arXiv preprint arXiv:1602.02830_ , 2016.
  * [24] D. Badawi, E. Akhan, M. Mallah, A. Üner, R. Çetin-Atalay, and A. E. Çetin, “Multiplication free neural network for cancer stem cell detection in h-and-e stained liver images,” in _Compressive Sensing VI: From Diverse Modalities to Big Data Analytics_ , vol. 10211. International Society for Optics and Photonics, 2017, p. 102110C.
  * [25] A. Afrasiyabi, D. Badawi, B. Nasir, O. Yıldız, F. T. Yarman-Vural, and A. E. Çetin, “Non-euclidean vector product for neural networks,” in _2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)_. IEEE, 2018, pp. 6862–6866.
  * [26] S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep network training by reducing internal covariate shift,” _arXiv preprint arXiv:1502.03167_ , 2015.
  * [27] G. Cybenko, “Approximation by superpositions of a sigmoidal function,” _Mathematics of control, signals and systems_ , vol. 2, no. 4, pp. 303–314, 1989.
  * [28] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, “Generative adversarial nets,” in _Advances in neural information processing systems_ , 2014, pp. 2672–2680.
  * [29] A. Radford, L. Metz, and S. Chintala, “Unsupervised representation learning with deep convolutional generative adversarial networks,” _arXiv preprint arXiv:1511.06434_ , 2015.
  * [30] T. Tieleman and G. Hinton, “Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude,” _COURSERA: Neural networks for machine learning_ , vol. 4, no. 2, pp. 26–31, 2012.
  * [31] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: a simple way to prevent neural networks from overfitting,” _The Journal of Machine Learning Research_ , vol. 15, no. 1, pp. 1929–1958, 2014.